Loading ...
Sorry, an error occurred while loading the content.

Re: [PATCH] Add runtime files for the Clojure programming language

Expand Messages
  • Sung Pae
    ... I should clarify: I meant local to filetype in a loose way. Previously, the syntax file set `setlocal iskeyword+=…` instead of the ftplugin (where we
    Message 1 of 8 , Feb 6 8:06 PM
    • 0 Attachment
      On Wed, Feb 06, 2013 at 07:11:35PM -0800, Gary Johnson wrote:

      > On 2013-02-06, Sung Pae wrote:
      >
      > > However, I can see now that setting 'iskeyword' in the syntax file
      > > instead of the ftplugin is problematic because the setting becomes
      > > local to the buffer and not to the filetype, which will cause
      > > confusion if a user changes filetypes for a buffer.
      >
      > There is no "local to filetype". Filetype plugins make settings that
      > are local to the buffer.
      >
      > When a user changes filetypes for a buffer, Vim and the filetype
      > plugins take care of setting or resetting filetype-dependent
      > buffer-local options appropriately.

      I should clarify: I meant "local to filetype" in a loose way.
      Previously, the syntax file set `setlocal iskeyword+=…` instead of the
      ftplugin (where we can add 'setlocal iskeyword<' to b:undo_ftplugin).
      Should the user open a new buffer then do:

      :setf clojure | setf foo

      The buffer will now have loaded foo's filetype settings, but will still
      have the additions to 'iskeyword' from Clojure's syntax script since
      this setting is buffer-local. This is broken and should be fixed.

      Bram, I have attached new patches (cumulative and incremental as before)
      with my proposed changes:

      * HiLink command is replaced with 'hi def link' and the version
      compat check with < 600 is removed.
      * 'iskeyword' is moved to ftplugin/clojure.vim

      I tried several variations of changing the `syntax keyword` definitions
      to `syntax match`, but the performance degrades from 4-10x, depending on
      the buffer. Both startup and scrolling are noticeably affected.

      If I can convince you that iskeyword+=… is justified for the Clojure
      filetype, then I think the syntax groups in question should remain in
      `syntax keyword` form in the interest of performance.

      Thank you,
      Sung Pae
    • Ben Fritz
      ... For what it s worth, I personally expect that iskeyword should reflect the rules for the specific filetype being edited. As long as the ftplugin sets it,
      Message 2 of 8 , Feb 7 8:23 AM
      • 0 Attachment
        On Wednesday, February 6, 2013 10:06:32 PM UTC-6, Sung Pae wrote:
        >
        > If I can convince you that iskeyword+=… is justified for the Clojure
        >
        > filetype, then I think the syntax groups in question should remain in
        >
        > `syntax keyword` form in the interest of performance.
        >

        For what it's worth, I personally expect that 'iskeyword' should reflect the rules for the specific filetype being edited.

        As long as the ftplugin sets it, and also includes a reset in the b:undo_ftplugin variable, I don't see a problem with it.

        --
        --
        You received this message from the "vim_dev" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php

        ---
        You received this message because you are subscribed to the Google Groups "vim_dev" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      Your message has been successfully submitted and would be delivered to recipients shortly.