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

vim 5.8 applying wrong syntax rules for file ending in ".cls" under Win2000Pro

Expand Messages
  • Robert Retter
    operating system ... Windows 2000 Pro, service pack 2 Vim version ... vim 5.8, as gotten from mirror ftp site on 6/21/2001 output of :version command ... VIM -
    Message 1 of 8 , Jun 22, 2001
    • 0 Attachment
      operating system
      ----------------
      Windows 2000 Pro, service pack 2

      Vim version
      -----------
      vim 5.8, as gotten from mirror ftp site on 6/21/2001

      output of :version command
      --------------------------
      VIM - Vi IMproved 5.8 (2001 May 31, compiled May 31 2001 16:01:16)
      MS-Windows 32 bit GUI version
      Compiled with (+) or without (-):
      +autocmd +browse ++builtin_terms +byte_offset +cindent +cmdline_compl
      +cmdline_info +comments +cryptv -cscope +dialog_gui +digraphs +emacs_tags
      +eval
      +ex_extra +extra_search +farsi +file_in_path -osfiletype +find_in_path
      -hangul_input +insert_expand +langmap +linebreak +lispindent +menu
      +mksession
      +modify_fname +mouse +multi_byte -ole -perl -python +quickfix +rightleft
      +scrollbind +smartindent -sniff +statusline +syntax +tag_binary
      +tag_old_static
      -tag_any_white -tcl -tgetent +textobjects +title +user_commands +visualextra
      +viminfo +wildignore +wildmenu +writebackup -xfontset -xim -xterm_save
      user vimrc file: "$HOME\_vimrc"
      2nd user vimrc file: "$VIM\_vimrc"
      user exrc file: "$HOME\_exrc"
      2nd user exrc file: "$VIM\_exrc"
      user gvimrc file: "$HOME\_gvimrc"
      2nd user gvimrc file: "$VIM\_gvimrc"
      system menu file: "$VIMRUNTIME\menu.vim"


      problem description
      -------------------
      Invoked vim on a file Sheet2.cls (the result of exporting Visual Basic code
      from within Excel). Invoked Vim both through "Edit with Vim" menu add-on
      and also from within Vim using the :e command. Problem happens both ways.

      There exists no syntax file for files ending in ".cls", nor is there mention
      of that extension within the synload.vim file.

      Vim applies syntax rules for files of type "st" (SmallTalk).

      Why does it try to apply the "st" syntax file?

      I note that it correctly applies the "c" syntax when I rename my text file
      to be "Sheet2.c", but it tries to apply the Lisp syntax when I rename my
      text file to be "Sheet2.cl".

      So ".c" works correctly, but neither ".cl" nor ".cls" do.

      misc environment info
      ---------------------
      All the files under the syntax/ directory are as they came from the
      distribution.

      The viminfo and vimrc files are as the "install" program made them.

      $VIM is set correctly by Vim itself upon startup, not by an environment
      variable set beforehand.

      Vim (literally, gvim) is in the PATH, although this could be considered a
      minor bug, too, in that the docs say nothing about how to set PATH under
      Windows 2000, and it's different from 95/98 --- I had to figure it out for
      myself.

      perpetrator
      -----------
      Rob Retter
      rretter@...
    • Robert Retter
      Yep, that did it. Thank you very much for your help. I do have to wonder a bit, though, at the (apparently) growing complexity of support for file types and
      Message 2 of 8 , Jun 22, 2001
      • 0 Attachment
        Yep, that did it.
        Thank you very much for your help.
        I do have to wonder a bit, though, at the (apparently) growing complexity of
        support for file types and syntax highlighting. I mean, how many layers of
        aliasing/redirection will Vim ultimately embody in its quest for
        understanding of 300 kinds of languages (which is how many syntax files come
        in the distribution now)....
        Ah, well. Thanks once again for your quick and right-on-target diagnosis.

        -----Original Message-----
        From: maurice s. barnum [mailto:pixi@...]
        Sent: Friday, June 22, 2001 4:44 PM
        To: rretter@...
        Subject: Re: vim 5.8 applying wrong syntax rules for file ending in
        ".cls" under Win2000Pro



        look at filetype.vim in your $VIM/vim58 directory.
        "wrong" is of course subjective: just about any short extension has
        been used for more than one

        try: :help new-filetype

        --xmsb
      • Bram Moolenaar
        ... Currently all *.cls files are considered to be smalltalk. ... Well, is it normal to use .cls for this kind of file? If it is, then perhaps we can think of
        Message 3 of 8 , Jun 23, 2001
        • 0 Attachment
          Rob Retter wrote:

          > Invoked vim on a file Sheet2.cls (the result of exporting Visual Basic code
          > from within Excel). Invoked Vim both through "Edit with Vim" menu add-on
          > and also from within Vim using the :e command. Problem happens both ways.
          >
          > There exists no syntax file for files ending in ".cls", nor is there mention
          > of that extension within the synload.vim file.
          >
          > Vim applies syntax rules for files of type "st" (SmallTalk).
          >
          > Why does it try to apply the "st" syntax file?

          Currently all *.cls files are considered to be smalltalk.

          > I note that it correctly applies the "c" syntax when I rename my text file
          > to be "Sheet2.c", but it tries to apply the Lisp syntax when I rename my
          > text file to be "Sheet2.cl".
          >
          > So ".c" works correctly, but neither ".cl" nor ".cls" do.

          Well, is it normal to use .cls for this kind of file? If it is, then perhaps
          we can think of a check for the contents of the file to decide what it is.

          --
          Why i like vim:
          > I like VIM because, when I ask a question in this newsgroup, I get a
          > one-line answer. With xemacs, I get a 1Kb lisp script with bugs in it ;-)

          /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
          ((( Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim )))
          \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
        • Mary Ellen Foster
          ... Another possible use of .cls is for LaTeX class files, if you re thinking of adding some sort of auto-check. At the moment I just have au!
          Message 4 of 8 , Jun 25, 2001
          • 0 Attachment
            Bram Moolenaar <Bram@...> wrote:
            > Well, is it normal to use .cls for this kind of file? If it is, then perhaps
            > we can think of a check for the contents of the file to decide what it is.

            Another possible use of ".cls" is for LaTeX class files, if you're
            thinking of adding some sort of auto-check. At the moment I just have

            au! BufRead,BufNewFile *.cls setfiletype tex

            in my filetype.vim because I frequently edit LaTeX class files and have
            never touched smalltalk in my life. Not sure what the characteristic
            differences between these two filetypes are.

            MEF

            --
            Mary Ellen Foster / ICCS / Informatics / University of Edinburgh
            M.E.Foster@... http://www.iccs.informatics.ed.ac.uk/~mef/
            -------------------- Law of Software Envelopment: --------------------
            Every program attempts to expand until it can read mail.
          • Bram Moolenaar
            ... So now we have *.cls files that are tex, smalltalk and c. Anything else? Perhaps we can tell these apart by how a comment starts? Most files tend to
            Message 5 of 8 , Jun 25, 2001
            • 0 Attachment
              Mary Ellen Foster wrote:

              > Bram Moolenaar <Bram@...> wrote:
              > > Well, is it normal to use .cls for this kind of file? If it is, then
              > > perhaps we can think of a check for the contents of the file to decide
              > > what it is.
              >
              > Another possible use of ".cls" is for LaTeX class files, if you're
              > thinking of adding some sort of auto-check. At the moment I just have
              >
              > au! BufRead,BufNewFile *.cls setfiletype tex
              >
              > in my filetype.vim because I frequently edit LaTeX class files and have
              > never touched smalltalk in my life. Not sure what the characteristic
              > differences between these two filetypes are.

              So now we have *.cls files that are tex, smalltalk and c. Anything else?
              Perhaps we can tell these apart by how a comment starts? Most files tend to
              start with a comment.

              --
              It is too bad that the speed of light hasn't kept pace with the
              changes in CPU speed and network bandwidth. -- <wietse@...>

              /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
              ((( Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim )))
              \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
            • Michael Piefel
              ... In fact all *.cls on my disk do start with a comment (a %). However I have to admit that a number of my C files (especially the really small ones) don t
              Message 6 of 8 , Jun 28, 2001
              • 0 Attachment
                On 25/06/01 at 11:13:22, Bram Moolenaar wrote:
                > So now we have *.cls files that are tex, smalltalk and c. Anything else?
                > Perhaps we can tell these apart by how a comment starts? Most files tend to
                > start with a comment.

                In fact all *.cls on my disk do start with a comment (a %). However I
                have to admit that a number of my C files (especially the really small
                ones) don't start with a comment.

                As a related matter: Editing a file which ends in *.pl set the filetype
                to Perl. That's OK, since most pl-files are Perl. However, I work with
                Prolog, and my interpreter (SWI Prolog) really wants files ending in pl.

                Also note that, of course, looking at comments won't help for new,
                empty files. So the default should still be the most often used one. (Or
                the favourite of the author ;-)

                Bye,
                Mike

                --
                |=| Michael Piefel piefel@...-berlin.de
                |=| Humboldt-Universit├Ąt zu Berlin http://www.piefel.de
                |=| Tel. (+49 30) 2093 3831
              • Bram Moolenaar
                ... I think that we need a wizard that looks at what you are typing, and then Vim buddy pops up and ask you: It looks like you are editing a Prolog file.
                Message 7 of 8 , Jun 28, 2001
                • 0 Attachment
                  Michael Piefel wrote:

                  > On 25/06/01 at 11:13:22, Bram Moolenaar wrote:
                  > > So now we have *.cls files that are tex, smalltalk and c. Anything else?
                  > > Perhaps we can tell these apart by how a comment starts? Most files tend
                  > > to start with a comment.
                  >
                  > In fact all *.cls on my disk do start with a comment (a %). However I
                  > have to admit that a number of my C files (especially the really small
                  > ones) don't start with a comment.
                  >
                  > As a related matter: Editing a file which ends in *.pl set the filetype
                  > to Perl. That's OK, since most pl-files are Perl. However, I work with
                  > Prolog, and my interpreter (SWI Prolog) really wants files ending in pl.
                  >
                  > Also note that, of course, looking at comments won't help for new,
                  > empty files. So the default should still be the most often used one. (Or
                  > the favourite of the author ;-)

                  I think that we need a wizard that looks at what you are typing, and then Vim
                  buddy pops up and ask you:

                  "It looks like you are editing a Prolog file. Would you like me to
                  set the filetype to prolog?".

                  :-)

                  --
                  Q: What is the difference betwee open-source and commercial software?
                  A: If you have a problem with commercial software you can call a phone
                  number and they will tell you it might be solved in a future version.
                  For open-source sofware there isn't a phone number to call, but you
                  get the solution within a day.

                  /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
                  ((( Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim )))
                  \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
                • Eugene Lee
                  ... Long live Vigor... ;-) -- Eugene Lee eugene@anime.net
                  Message 8 of 8 , Jun 28, 2001
                  • 0 Attachment
                    On Thu, Jun 28, 2001 at 04:42:47PM +0200, Bram Moolenaar wrote:
                    :
                    : I think that we need a wizard that looks at what you are typing, and then Vim
                    : buddy pops up and ask you:
                    :
                    : "It looks like you are editing a Prolog file. Would you like me to
                    : set the filetype to prolog?".
                    :
                    : :-)

                    Long live Vigor... ;-)


                    --
                    Eugene Lee
                    eugene@...
                  Your message has been successfully submitted and would be delivered to recipients shortly.