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

Re: E461: Illegal variable name: s:syntax_menu_synonly

Expand Messages
  • Benji Fisher
    ... I think the problem is the line an 50.200 &Syntax.Set &syntax only :let s:syntax_menu_synonly=1 in runtime/synmenu.vim . According to ...
    Message 1 of 3 , Jun 5, 2003
    View Source
    • 0 Attachment
      Øyvind A. Holm wrote:
      > In gvim, the error message
      >
      > E461: Illegal variable name: s:syntax_menu_synonly
      >
      > occurs when selecting "Syntax / Show filetypes in menu" followed by a
      > "Syntax / Set 'syntax' only" in the menu. Grepping through the newest
      > CVS source shows that the "syntax_menu_synonly" string only occurs in
      > runtime/synmenu.vim and is not mentioned in any of the CVS logs, so is
      > this variable really used anywhere?
      >
      > Regards,
      > Øyvind

      I think the problem is the line

      an 50.200 &Syntax.Set\ '&syntax'\ only :let s:syntax_menu_synonly=1<CR>

      in runtime/synmenu.vim . According to

      :help s:var

      script-local variables cannot be used in mappings. A work-around is

      fun! s:SetSynOnly()
      let s:syntax_menu_synonly = 1
      endfun
      an 50.200 &Syntax.Set\ '&syntax'\ only :call <SID>SetSynOnly()<CR>

      The next line uses a similar function, s:Nosynonly() , so maybe Bram will decide
      to define one function that does both jobs ...

      HTH --Benji Fisher

      P.S. To answer your question: Being a script-local variable, it cannot be used
      anywhere else.
    • Øyvind A. Holm
      ... Ahh, works great, the error is gone. Thank you. Not that the error message was extremely annoying, but at least I got some introduction to the Art of
      Message 2 of 3 , Jun 6, 2003
      View Source
      • 0 Attachment
        On 2003-06-05 17:02-0400 Benji Fisher wrote:
        > Øyvind A. Holm wrote:
        > > In gvim, the error message
        > >
        > > E461: Illegal variable name: s:syntax_menu_synonly
        > >
        > > occurs when selecting "Syntax / Show filetypes in menu" followed by
        > > a "Syntax / Set 'syntax' only" in the menu. Grepping through the
        > > newest CVS source shows that the "syntax_menu_synonly" string only
        > > occurs in runtime/synmenu.vim and is not mentioned in any of the CVS
        > > logs, so is this variable really used anywhere?
        >
        > I think the problem is the line
        >
        > an 50.200 &Syntax.Set\ '&syntax'\ only :let s:syntax_menu_synonly=1<CR>
        >
        > in runtime/synmenu.vim . According to
        >
        > :help s:var
        >
        > script-local variables cannot be used in mappings. A work-around is
        >
        > fun! s:SetSynOnly()
        > let s:syntax_menu_synonly = 1
        > endfun
        > an 50.200 &Syntax.Set\ '&syntax'\ only :call <SID>SetSynOnly()<CR>

        Ahh, works great, the error is gone. Thank you. Not that the error
        message was extremely annoying, but at least I got some introduction to
        the Art of Vimscripting.

        Regards,
        Øyvind
        ---------------------
        cat /dev/urandom >SCO
      Your message has been successfully submitted and would be delivered to recipients shortly.