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

Re: oddity with :noautocmd when editing a help file

Expand Messages
  • Bram Moolenaar
    ... help files are handled a bit special. The filetype is automatically set to help when loading the file. syntax stays at log , because setting
    Message 1 of 4 , Jul 7 12:28 AM
      Benji Fisher wrote:

      > Bug or feature? While editing this e-mail,
      >
      > :set ft=log
      >
      > :set ft? syntax?
      > filetype=log
      > syntax=log
      >
      > :noa e!
      > "/tmp/mutt-localhost-19331-88"
      > "/tmp/mutt-localhost-19331-88" 7L, 108C
      >
      > :set ft? syntax?
      > filetype=log
      > syntax=log
      >
      > as expected. While editing a help file,
      >
      > :set ft=log
      >
      > :set ft? syntax?
      > filetype=log
      > syntax=log
      >
      > :noa e!
      > "autocmd.txt"
      > "autocmd.txt" [readonly] 1260L, 52535C
      >
      > :set ft? syntax?
      > filetype=help
      > syntax=log
      >
      > How did 'filetype' get set to "help"?

      help files are handled a bit special. The filetype is automatically set
      to "help" when loading the file. 'syntax' stays at "log", because
      setting 'syntax' is done with an autocommand and you disabled that.

      --
      "Beware of bugs in the above code; I have only proved
      it correct, not tried it." -- Donald Knuth

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ download, build and distribute -- http://www.A-A-P.org ///
      \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
    • Benji Fisher
      ... Right you are. Thanks! --Benji Fisher
      Message 2 of 4 , Jul 7 11:43 AM
        On Thu, Jul 06, 2006 at 01:19:48PM -0400, Charles E Campbell Jr wrote:
        > Benji Fisher wrote:
        >
        > >How did 'filetype' get set to "help"?
        > >
        > >
        >
        > Dr BF! You forgot one of your favorite answers! :) Try
        >
        > :verbose set ft?
        >
        > (it was probably set via a modeline at the bottom of the help page)

        Right you are. Thanks!

        --Benji Fisher
      Your message has been successfully submitted and would be delivered to recipients shortly.