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

perl - prolog

Expand Messages
  • KONTRA Gergely
    Hi! A few weeks I was doing my homework in prolog, when I realized, that perl and prolog uses the same extension: .pl So vim must fine-tune filetype detection.
    Message 1 of 23 , Feb 8, 2002
      Hi!

      A few weeks I was doing my homework in prolog, when I realized, that
      perl and prolog uses the same extension: .pl
      So vim must fine-tune filetype detection.
      I don't know a solution, maybe when a file has 'perl' in the first row
      should be perl type, all others prolog. But this is a silly idea only.

      thx
      Gergo

      +-[Kontra, Gergely @ Budapest University of Technology and Economics]-+
      | Email: kgergely@... kgergely@... |
      | URL: turul.eet.bme.hu/~kgergely Mobile: (+36 20) 356 9656 |
      +-------"Olyan langesz vagyok, hogy poroltoval kellene jarnom!"-------+
      .
      Magyar php mirror es magyar php dokumentacio: http://hu.php.net
    • Thomas Köhler
      ... Well, I used to use .pdb for the prolog files at university (pdb for prolog data base). But that won t solve the original problem :-} ... Ciao, Thomas --
      Message 2 of 23 , Feb 8, 2002
        KONTRA Gergely wrote [020208 14:47]:
        > Hi!
        >
        > A few weeks I was doing my homework in prolog, when I realized, that
        > perl and prolog uses the same extension: .pl
        > So vim must fine-tune filetype detection.
        > I don't know a solution, maybe when a file has 'perl' in the first row
        > should be perl type, all others prolog. But this is a silly idea only.

        Well, I used to use ".pdb" for the prolog files at university
        (pdb for prolog data base). But that won't solve the original
        problem :-}

        > thx
        > Gergo

        Ciao,
        Thomas

        --
        Thomas Köhler Email: jean-luc@... | LCARS - Linux
        <>< WWW: http://jeanluc-picard.de | for Computers
        IRC: jeanluc | on All Real
        PGP public key available from Homepage! | Starships
      • Kontra, Gergely
        Hi!The promised perl - prolog chooser.Luckily perl and prolog use different comments.Prolog use % for line comment, and /* */ for region comment.So: if
        Message 3 of 23 , Feb 27, 2002
          Hi!

          The promised perl - prolog chooser.

          Luckily perl and prolog use different comments.

          Prolog use % for line comment, and /* */ for region comment.

          So: if the first nonblank line begins with %, or /* or contains the
          word prolog, let it be a prolog file, else it must be a perl file.

          Gergo

          +-[Kontra, Gergely @ Budapest University of Technology and Economics]-+
          | Email: kgergely@..., kgergely@... |
          | URL: turul.eet.bme.hu/~kgergely Mobile: (+36 20) 356 9656 |
          +-------"Olyan langesz vagyok, hogy poroltoval kellene jarnom!"-------+
          .
          Magyar php mirror es magyar php dokumentacio: http://hu.php.net
        • Bram Moolenaar
          ... Looks like a good idea. Let me add g:filetype_pl, so that the user can overrule the choice when he uses only one of the two languages. Also, it s probably
          Message 4 of 23 , Feb 27, 2002
            Kontra Gergely wrote:

            > The promised perl - prolog chooser.
            >
            > Luckily perl and prolog use different comments.
            >
            > Prolog use % for line comment, and /* */ for region comment.
            >
            > So: if the first nonblank line begins with %, or /* or contains the
            > word prolog, let it be a prolog file, else it must be a perl file.

            Looks like a good idea. Let me add g:filetype_pl, so that the user can
            overrule the choice when he uses only one of the two languages.

            Also, it's probably better to check for "prolog" as a whole word.

            Wouldn't ":-" appear somewhere in the first line of a perl file?
            Or have a line that starts with "%" or "/*"?

            Here is my update of the patch:

            *** ../vim61a.009/runtime/filetype.vim Tue Feb 26 17:07:10 2002
            --- runtime/filetype.vim Wed Feb 27 19:48:32 2002
            ***************
            *** 714,723 ****

            " Perl
            if has("fname_case")
            ! au BufNewFile,BufRead *.pl,*.PL setf perl
            else
            ! au BufNewFile,BufRead *.pl setf perl
            endif

            " Perl, XPM or XPM2
            au BufNewFile,BufRead *.pm
            --- 714,736 ----

            " Perl
            if has("fname_case")
            ! au BufNewFile,BufRead *.pl,*.PL call FTCheck_pl()
            else
            ! au BufNewFile,BufRead *.pl call FTCheck_pl()
            endif
            +
            + fun! FTCheck_pl()
            + if exists("g:filetype_pl")
            + exe "setf " . g:filetype_pl
            + else
            + let l = getline(nextnonblank(1))
            + if l =~ '\<prolog\>' || l =~ '^\s*\(%\|/\*\)' || l =~ ':-'
            + setf prolog
            + else
            + setf perl
            + endif
            + endif
            + endfun

            " Perl, XPM or XPM2
            au BufNewFile,BufRead *.pm

            --
            hundred-and-one symptoms of being an internet addict:
            61. Your best friends know your e-mail address, but neither your phone number
            nor the address where you live.

            /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
            /// Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim \\\
            \\\ Project leader for A-A-P -- http://www.a-a-p.org ///
            \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
          • Thomas Köhler
            ... [...] ... Any perl script may start like this: %hash=(); Ugly. :-( Ciao, Thomas -- Thomas Köhler Email: jean-luc@picard.franken.de | LCARS - Linux
            Message 5 of 23 , Feb 27, 2002
              Bram Moolenaar wrote [020227 20:10]:
              > Kontra Gergely wrote:
              [...]
              > Wouldn't ":-" appear somewhere in the first line of a perl file?
              > Or have a line that starts with "%" or "/*"?

              Any perl script may start like this:

              %hash=();

              Ugly. :-(

              Ciao,
              Thomas

              --
              Thomas Köhler Email: jean-luc@... | LCARS - Linux
              <>< WWW: http://jeanluc-picard.de | for Computers
              IRC: jeanluc | on All Real
              PGP public key available from Homepage! | Starships
            • Bram Moolenaar
              ... Are there enough Perl files that start with a line like this that we should worry about the file being recognized as prolog? We could require a blank after
              Message 6 of 23 , Feb 27, 2002
                Thomas Koehler wrote:

                > Bram Moolenaar wrote [020227 20:10]:
                > > Kontra Gergely wrote:
                > [...]
                > > Wouldn't ":-" appear somewhere in the first line of a perl file?
                > > Or have a line that starts with "%" or "/*"?
                >
                > Any perl script may start like this:
                >
                > %hash=();
                >
                > Ugly. :-(

                Are there enough Perl files that start with a line like this that we
                should worry about the file being recognized as prolog?

                We could require a blank after the %, assuming that's how most people
                write comments.

                --
                hundred-and-one symptoms of being an internet addict:
                73. You give your dog used motherboards instead of bones

                /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
                /// Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim \\\
                \\\ Project leader for A-A-P -- http://www.a-a-p.org ///
                \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
              • Matthew Winn
                ... Probably not. A quick search through the Perl directories on my machine didn t find any files where the first line began with % . Most started with lines
                Message 7 of 23 , Feb 28, 2002
                  On Wed, Feb 27, 2002 at 10:43:36PM +0100, Bram Moolenaar wrote:
                  >
                  > Thomas Koehler wrote:
                  >
                  > > Any perl script may start like this:
                  > >
                  > > %hash=();
                  > >
                  > > Ugly. :-(
                  >
                  > Are there enough Perl files that start with a line like this that we
                  > should worry about the file being recognized as prolog?

                  Probably not. A quick search through the Perl directories on my
                  machine didn't find any files where the first line began with "%".
                  Most started with lines matching one of the following:

                  ^#
                  ^package
                  ^use\s
                  ^=head1
                  ^{
                  ^BEGIN
                  ^$
                  ^;#

                  I found one which started with "/*", but that was a C program I'd
                  partially converted to Perl before I decided I didn't need it after
                  all.

                  --
                  Matthew Winn (matthew@...)
                • Kontra, Gergely
                  ... Right. BTW, it is my version of g:filetype_pl ... I don t know, that a prolog program can start with #!prolog If so, keep the Maybe some other
                  Message 8 of 23 , Feb 28, 2002
                    >Looks like a good idea. Let me add g:filetype_pl, so that the user can
                    >overrule the choice when he uses only one of the two languages.
                    >
                    >Also, it's probably better to check for "prolog" as a whole word.

                    Right. BTW, it is my version of g:filetype_pl ...
                    I don't know, that a prolog program can start with
                    #!prolog

                    If so, keep the \<prolog\>

                    Maybe some other prolog users should tell it to us.


                    >Wouldn't ":-" appear somewhere in the first line of a perl file?

                    Well, theoretically you can have a line like this.
                    But it is not so common. (in a string)
                    If I'm wrong, we can refine :- to appear at the start or end of the
                    line.

                    Gergo

                    +-[Kontra, Gergely @ Budapest University of Technology and Economics]-+
                    | Email: kgergely@..., kgergely@... |
                    | URL: turul.eet.bme.hu/~kgergely Mobile: (+36 20) 356 9656 |
                    +-------"Olyan langesz vagyok, hogy poroltoval kellene jarnom!"-------+
                    .
                    Magyar php mirror es magyar php dokumentacio: http://hu.php.net
                  • Bram Moolenaar
                    ... I m mostly concerned about a Perl command that contains the world prologue . ... We should make the checks as strict as possible. It can be very annoying
                    Message 9 of 23 , Feb 28, 2002
                      Kontra Gergely wrote:

                      > >Looks like a good idea. Let me add g:filetype_pl, so that the user can
                      > >overrule the choice when he uses only one of the two languages.
                      > >
                      > >Also, it's probably better to check for "prolog" as a whole word.
                      >
                      > Right. BTW, it is my version of g:filetype_pl ...
                      > I don't know, that a prolog program can start with
                      > #!prolog
                      >
                      > If so, keep the \<prolog\>
                      >
                      > Maybe some other prolog users should tell it to us.

                      I'm mostly concerned about a Perl command that contains the world
                      "prologue".

                      > >Wouldn't ":-" appear somewhere in the first line of a perl file?
                      >
                      > Well, theoretically you can have a line like this.
                      > But it is not so common. (in a string)
                      > If I'm wrong, we can refine :- to appear at the start or end of the
                      > line.

                      We should make the checks as strict as possible. It can be very
                      annoying if your Perl file is highlighted as if it was Prolog! The
                      other way around is also true, of course, but there are many more people
                      editing Perl.

                      --
                      From "know your smileys":
                      :----} You lie like Pinocchio

                      /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
                      /// Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim \\\
                      \\\ Project leader for A-A-P -- http://www.a-a-p.org ///
                      \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
                    • Jonathan D Johnston
                      Greetings from one who uses Vim, Perl, & Prolog, Having Vim think my Prolog files are Perl files has been a minor irritant. Devising a filetype discriminator
                      Message 10 of 23 , Mar 1, 2002
                        Greetings from one who uses Vim, Perl, & Prolog,

                        Having Vim think my Prolog files are Perl files has been a minor
                        irritant. Devising a filetype discriminator has been on my ToDo list.
                        In the meantime, I've gotten into the habit of setting the filetype in
                        the modeline.

                        Of the discriminators discussed in this thread, my favorite is looking
                        for "/*" at the beginning of the first non-blank line. Can't be Perl -
                        would be interpreted as the beginning of an invalid regular
                        expression. However, *many* Prolog files begin with "/*". The library
                        files that come with my favorite Prolog system (SWI-Prolog) start with
                        a standardized header enclosed in /*...*/.

                        For the Prolog files that use "%" comments, I would suggest using the
                        regex /^\s*%\+\(\s\+\|$\)/ - Allows various styles of header comments
                        without matching a Perl hash variable (eg. %hash). For example:
                        % Comment
                        or
                        %% Comment
                        or
                        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

                        A regex for either comment style would look something like:
                        #^\s*\(/\*\|%\+\(\s\+\|$\)\)#

                        The use of ":-" as a discriminator is more problematic. The following
                        script, while useless, will be executed by Perl without complaint
                        (well...with a warning if "-w" is used):
                        <code>
                        :-1;
                        $x = ":-
                        ";
                        print $x;
                        </code>

                        I'm not sure why Perl doesn't croak on the first line. I suppose Perl
                        is treating the ":" as a nameless label (or is that an oxymoron?).

                        Bram Moolenaar wrote:
                        > We should make the checks as strict as possible. It can be very
                        > annoying if your Perl file is highlighted as if it was Prolog! The
                        > other way around is also true, of course, but there are many more
                        > people editing Perl.
                        Agreed.

                        Regards,
                        Jonathan D Johnston
                        ________________________________________________________________
                        GET INTERNET ACCESS FROM JUNO!
                        Juno offers FREE or PREMIUM Internet access for less!
                        Join Juno today! For your FREE software, visit:
                        http://dl.www.juno.com/get/web/.
                      • Kontra, Gergely
                        ... If you write a code like this, than: You request that! :) btw you can prefix the prog with #!perl +-[Kontra, Gergely @ Budapest University of Technology
                        Message 11 of 23 , Mar 1, 2002
                          >The use of ":-" as a discriminator is more problematic. The following
                          >script, while useless, will be executed by Perl without complaint
                          >(well...with a warning if "-w" is used):
                          ><code>
                          >:-1;
                          >$x = ":-
                          >";
                          >print $x;
                          ></code>

                          If you write a code like this, than: You request that! :)
                          btw you can prefix the prog with
                          #!perl


                          +-[Kontra, Gergely @ Budapest University of Technology and Economics]-+
                          | Email: kgergely@..., kgergely@... |
                          | URL: turul.eet.bme.hu/~kgergely Mobile: (+36 20) 356 9656 |
                          +-------"Olyan langesz vagyok, hogy poroltoval kellene jarnom!"-------+
                          .
                          Magyar php mirror es magyar php dokumentacio: http://hu.php.net
                        • Thomas Köhler
                          ... Well, surely none of the perl-included nor one of the perl modules from CPAN start that strange. It s more the quick-and-dirty hacks some people write
                          Message 12 of 23 , Mar 3, 2002
                            Bram Moolenaar wrote [020228 07:56]:
                            > Thomas Koehler wrote:
                            > > Bram Moolenaar wrote [020227 20:10]:
                            > > > Kontra Gergely wrote:
                            > > [...]
                            > > > Wouldn't ":-" appear somewhere in the first line of a perl file?
                            > > > Or have a line that starts with "%" or "/*"?
                            > >
                            > > Any perl script may start like this:
                            > >
                            > > %hash=();
                            > >
                            > > Ugly. :-(
                            >
                            > Are there enough Perl files that start with a line like this that we
                            > should worry about the file being recognized as prolog?

                            Well, surely none of the perl-included nor one of the perl
                            modules from CPAN start that strange. It's more the
                            quick-and-dirty hacks some people write after too much beer (or
                            before having had enough coffee, or whatever ;) that worry me
                            here ;)

                            Side note: Is there any global variable that can override vim's
                            autodetection for .pl in either direction? So if, for example,
                            the user starts with an empty file, the filetype gets set as he
                            wants it?

                            (That whole .pl<->.pl issue is surely worth a note in the docs)

                            > We could require a blank after the %, assuming that's how most
                            > people write comments.

                            This perl code also works:
                            % hash = ();

                            :-}

                            Ciao,
                            Thomas

                            --
                            Thomas Köhler Email: jean-luc@... | LCARS - Linux
                            <>< WWW: http://jeanluc-picard.de | for Computers
                            IRC: jeanluc | on All Real
                            PGP public key available from Homepage! | Starships
                          • Bram Moolenaar
                            ... In that state of mind you experience the wrong highlighting as a psygedelic effect, thus you might actually enjoy it! :-) ... Yes, I added g:filetype_pl
                            Message 13 of 23 , Mar 4, 2002
                              Thomas Koehler wrote:

                              > > > [...]
                              > > > > Wouldn't ":-" appear somewhere in the first line of a perl file?
                              > > > > Or have a line that starts with "%" or "/*"?
                              > > >
                              > > > Any perl script may start like this:
                              > > >
                              > > > %hash=();
                              > > >
                              > > > Ugly. :-(
                              > >
                              > > Are there enough Perl files that start with a line like this that we
                              > > should worry about the file being recognized as prolog?
                              >
                              > Well, surely none of the perl-included nor one of the perl
                              > modules from CPAN start that strange. It's more the
                              > quick-and-dirty hacks some people write after too much beer (or
                              > before having had enough coffee, or whatever ;) that worry me
                              > here ;)

                              In that state of mind you experience the wrong highlighting as a
                              psygedelic effect, thus you might actually enjoy it! :-)

                              > Side note: Is there any global variable that can override vim's
                              > autodetection for .pl in either direction? So if, for example,
                              > the user starts with an empty file, the filetype gets set as he
                              > wants it?

                              Yes, I added g:filetype_pl for this.

                              > (That whole .pl<->.pl issue is surely worth a note in the docs)

                              Suggestion?

                              > > We could require a blank after the %, assuming that's how most
                              > > people write comments.
                              >
                              > This perl code also works:
                              > % hash = ();
                              >
                              > :-}

                              How often does this occur? The filetype check needs to be as good as
                              possible. That includes not recognizing a Prolog file as being Perl.
                              Thus we have to do some statistics based guesses.

                              --
                              hundred-and-one symptoms of being an internet addict:
                              114. You are counting items, you go "0,1,2,3,4,5,6,7,8,9,A,B,C,D...".

                              /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
                              /// Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim \\\
                              \\\ Project leader for A-A-P -- http://www.a-a-p.org ///
                              \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
                            • Thomas Köhler
                              ... hehehe :-) ... Fine. I d better have a look into that some time later... ... Hm. Is that the right place to put it? ~/vim/TEST/doc diff -u filetype.txt~
                              Message 14 of 23 , Mar 4, 2002
                                Bram Moolenaar wrote [020304 18:51]:
                                > Thomas Koehler wrote:
                                > > > > [...]
                                > > > > > Wouldn't ":-" appear somewhere in the first line of a
                                > > > > > perl file? Or have a line that starts with "%" or "/*"?
                                > > > > Any perl script may start like this:
                                > > > >
                                > > > > %hash=();
                                > > > >
                                > > > > Ugly. :-(
                                > > > Are there enough Perl files that start with a line like
                                > > > this that we should worry about the file being recognized
                                > > > as prolog?
                                > > Well, surely none of the perl-included nor one of the perl
                                > > modules from CPAN start that strange. It's more the
                                > > quick-and-dirty hacks some people write after too much beer (or
                                > > before having had enough coffee, or whatever ;) that worry me
                                > > here ;)
                                > In that state of mind you experience the wrong highlighting as a
                                > psygedelic effect, thus you might actually enjoy it! :-)

                                hehehe :-)

                                > > Side note: Is there any global variable that can override vim's
                                > > autodetection for .pl in either direction? So if, for example,
                                > > the user starts with an empty file, the filetype gets set as he
                                > > wants it?
                                >
                                > Yes, I added g:filetype_pl for this.

                                Fine. I'd better have a look into that some time later...

                                > > (That whole .pl<->.pl issue is surely worth a note in the docs)
                                >
                                > Suggestion?

                                Hm. Is that the right place to put it?

                                ~/vim/TEST/doc> diff -u filetype.txt~ filetype.txt
                                --- filetype.txt~ Mon Mar 4 19:51:07 2002
                                +++ filetype.txt Mon Mar 4 19:55:18 2002
                                @@ -19,7 +19,8 @@

                                Vim can detect the type of file that is edited. This is done by checking the
                                file name and sometimes by inspecting the contents of the file for specific
                                -text.
                                +text. This is necessary for files matching *.pl, for example: These are
                                +either perl or prolog script files!

                                *:filetype* *:filet*
                                To enable file type detection, use this command in your vimrc: >


                                > > > We could require a blank after the %, assuming that's how most
                                > > > people write comments.
                                > >
                                > > This perl code also works:
                                > > % hash = ();
                                > >
                                > > :-}
                                >
                                > How often does this occur? The filetype check needs to be as
                                > good as possible. That includes not recognizing a Prolog file
                                > as being Perl. Thus we have to do some statistics based
                                > guesses.

                                _This_ really only occurs if you're out for psygedelic effects,
                                and vim doesn't even highlight that hash as a perl hash ;-)

                                Ciao,
                                Thomas

                                --
                                Thomas Köhler Email: jean-luc@... | LCARS - Linux
                                <>< WWW: http://jeanluc-picard.de | for Computers
                                IRC: jeanluc | on All Real
                                PGP public key available from Homepage! | Starships
                              • Kontra, Gergely
                                ... Another good question is how to open a new file, which must be a prolog file :) Or, if you have templates, how to know, that you will edit a prolog file?
                                Message 15 of 23 , Mar 6, 2002
                                  >> > Side note: Is there any global variable that can override vim's
                                  >> > autodetection for .pl in either direction? So if, for example,
                                  >> > the user starts with an empty file, the filetype gets set as he
                                  >> > wants it?
                                  >>
                                  >> Yes, I added g:filetype_pl for this.
                                  >

                                  Another good question is how to open a new file, which must be a prolog
                                  file :)
                                  Or, if you have templates, how to know, that you will edit a prolog
                                  file? (I assume you edit perl files also)

                                  Gergo

                                  +-[Kontra, Gergely @ Budapest University of Technology and Economics]-+
                                  | Email: kgergely@..., kgergely@... |
                                  | URL: turul.eet.bme.hu/~kgergely Mobile: (+36 20) 356 9656 |
                                  +-------"Olyan langesz vagyok, hogy poroltoval kellene jarnom!"-------+
                                  .
                                  Magyar php mirror es magyar php dokumentacio: http://hu.php.net
                                • Thomas Köhler
                                  ... Indeed. But... setting g:filetype_pl solves that, too... ... In fact, I only use templates for C and LaTeX so far, so not much of a problem there (yet) ;-)
                                  Message 16 of 23 , Mar 6, 2002
                                    Kontra, Gergely wrote [020306 18:07]:
                                    > >> > Side note: Is there any global variable that can override vim's
                                    > >> > autodetection for .pl in either direction? So if, for example,
                                    > >> > the user starts with an empty file, the filetype gets set as he
                                    > >> > wants it?
                                    > >>
                                    > >> Yes, I added g:filetype_pl for this.
                                    > >
                                    >
                                    > Another good question is how to open a new file, which must be
                                    > a prolog file :)

                                    Indeed. But... setting g:filetype_pl solves that, too...

                                    > Or, if you have templates, how to know, that you will edit a prolog
                                    > file? (I assume you edit perl files also)

                                    In fact, I only use templates for C and LaTeX so far, so not much
                                    of a problem there (yet) ;-)

                                    > Gergo

                                    Ciao,
                                    Thomas

                                    --
                                    Thomas Köhler Email: jean-luc@... | LCARS - Linux
                                    <>< WWW: http://jeanluc-picard.de | for Computers
                                    IRC: jeanluc | on All Real
                                    PGP public key available from Homepage! | Starships
                                  • Kontra, Gergely
                                    ... Yes and NO. If you edit both perl and prolog files, you don t want to set filetype_pl, do you? And this problem stands for other filetypes, where the name
                                    Message 17 of 23 , Mar 6, 2002
                                      >> Another good question is how to open a new file, which must be
                                      >> a prolog file :)
                                      >
                                      >Indeed. But... setting g:filetype_pl solves that, too...

                                      Yes and NO.
                                      If you edit both perl and prolog files, you don't want to set
                                      filetype_pl, do you?

                                      And this problem stands for other filetypes, where the name is not
                                      sufficient to determine filetype...

                                      Gergo


                                      +-[Kontra, Gergely @ Budapest University of Technology and Economics]-+
                                      | Email: kgergely@..., kgergely@... |
                                      | URL: turul.eet.bme.hu/~kgergely Mobile: (+36 20) 356 9656 |
                                      +-------"Olyan langesz vagyok, hogy poroltoval kellene jarnom!"-------+
                                      .
                                      Magyar php mirror es magyar php dokumentacio: http://hu.php.net
                                    • Thomas Köhler
                                      ... In such cases, you always loose :-} ... Ciao, Thomas -- Thomas Köhler Email: jean-luc@picard.franken.de | LCARS - Linux
                                      Message 18 of 23 , Mar 7, 2002
                                        Kontra, Gergely wrote [020307 09:54]:
                                        > >> Another good question is how to open a new file, which must be
                                        > >> a prolog file :)
                                        > >
                                        > >Indeed. But... setting g:filetype_pl solves that, too...
                                        >
                                        > Yes and NO.
                                        > If you edit both perl and prolog files, you don't want to set
                                        > filetype_pl, do you?
                                        >
                                        > And this problem stands for other filetypes, where the name is not
                                        > sufficient to determine filetype...

                                        In such cases, you always loose :-}

                                        > Gergo

                                        Ciao,
                                        Thomas

                                        --
                                        Thomas Köhler Email: jean-luc@... | LCARS - Linux
                                        <>< WWW: http://jeanluc-picard.de | for Computers
                                        IRC: jeanluc | on All Real
                                        PGP public key available from Homepage! | Starships
                                      • Kontra, Gergely
                                        ... Should I recommend to extend the sp and new and e commands to optionally give the filetype? I mean ... Gergo +-[Kontra, Gergely @ Budapest University of
                                        Message 19 of 23 , Mar 7, 2002
                                          >> If you edit both perl and prolog files, you don't want to set
                                          >> filetype_pl, do you?
                                          >>
                                          >> And this problem stands for other filetypes, where the name is not
                                          >> sufficient to determine filetype...
                                          >
                                          >In such cases, you always loose :-}

                                          Should I recommend to extend the sp and new and e commands to optionally
                                          give the filetype?
                                          I mean
                                          :e myperl.pl perl
                                          :sp myprolog.pl prolog

                                          Gergo
                                          +-[Kontra, Gergely @ Budapest University of Technology and Economics]-+
                                          | Email: kgergely@..., kgergely@... |
                                          | URL: turul.eet.bme.hu/~kgergely Mobile: (+36 20) 356 9656 |
                                          +-------"Olyan langesz vagyok, hogy poroltoval kellene jarnom!"-------+
                                          .
                                          Magyar php mirror es magyar php dokumentacio: http://hu.php.net
                                        • Thomas Köhler
                                          ... Hm. Don t know, what does it buy you? And what goes wrong in turn? Ciao, Thomas -- Thomas Köhler Email: jean-luc@picard.franken.de | LCARS - Linux
                                          Message 20 of 23 , Mar 8, 2002
                                            Kontra, Gergely wrote [020308 10:25]:
                                            > >> If you edit both perl and prolog files, you don't want to set
                                            > >> filetype_pl, do you?
                                            > >>
                                            > >> And this problem stands for other filetypes, where the name is not
                                            > >> sufficient to determine filetype...
                                            > >
                                            > >In such cases, you always loose :-}
                                            >
                                            > Should I recommend to extend the sp and new and e commands to
                                            > optionally give the filetype?
                                            > I mean
                                            > :e myperl.pl perl
                                            > :sp myprolog.pl prolog

                                            Hm. Don't know, what does it buy you? And what goes wrong in
                                            turn?

                                            Ciao,
                                            Thomas

                                            --
                                            Thomas Köhler Email: jean-luc@... | LCARS - Linux
                                            <>< WWW: http://jeanluc-picard.de | for Computers
                                            IRC: jeanluc | on All Real
                                            PGP public key available from Homepage! | Starships
                                          • Kontra, Gergely
                                            ... It will allow me to tell to vim, which template to load, the perl one, or the prolog one, if I start editing a new file. Gergo +-[Kontra, Gergely @
                                            Message 21 of 23 , Mar 12, 2002
                                              >> >> If you edit both perl and prolog files, you don't want to set
                                              >> >> filetype_pl, do you?
                                              >> >>
                                              >> >> And this problem stands for other filetypes, where the name is not
                                              >> >> sufficient to determine filetype...
                                              >> >
                                              >> >In such cases, you always loose :-}
                                              >>
                                              >> Should I recommend to extend the sp and new and e commands to
                                              >> optionally give the filetype?
                                              >> I mean
                                              >> :e myperl.pl perl
                                              >> :sp myprolog.pl prolog
                                              >
                                              >Hm. Don't know, what does it buy you? And what goes wrong in
                                              >turn?

                                              It will allow me to tell to vim, which template to load, the perl one,
                                              or the prolog one, if I start editing a new file.

                                              Gergo

                                              +-[Kontra, Gergely @ Budapest University of Technology and Economics]-+
                                              | Email: kgergely@..., kgergely@... |
                                              | URL: turul.eet.bme.hu/~kgergely Mobile: (+36 20) 356 9656 |
                                              +-------"Olyan langesz vagyok, hogy poroltoval kellene jarnom!"-------+
                                              .
                                              Magyar php mirror es magyar php dokumentacio: http://hu.php.net
                                            • Vince Negri
                                              ... That could be done with a user Ex command... Vince
                                              Message 22 of 23 , Mar 12, 2002
                                                > perhaps explicit filetype specification could be handled
                                                >via

                                                > :ef myperl.pl perl

                                                >("edit with filetype")

                                                That could be done with a user Ex command...

                                                Vince
                                              • Charles E. Campbell
                                                ... How about sticky filetypes -- ie. if one is currently editing a perl file, barring explicit specification such as that shown above (:e myperl.pl perl),
                                                Message 23 of 23 , Mar 12, 2002
                                                  Thus saith Kontra, Gergely:
                                                  > >> Should I recommend to extend the sp and new and e commands to
                                                  > >> optionally give the filetype?
                                                  > >> I mean
                                                  > >> :e myperl.pl perl
                                                  > >> :sp myprolog.pl prolog
                                                  > >
                                                  > >Hm. Don't know, what does it buy you? And what goes wrong in
                                                  > >turn?
                                                  >
                                                  > It will allow me to tell to vim, which template to load, the perl one,
                                                  > or the prolog one, if I start editing a new file.
                                                  ---------------------------------------------------------------------

                                                  How about "sticky filetypes" -- ie. if one is currently editing
                                                  a perl file, barring explicit specification such as that shown
                                                  above (:e myperl.pl perl), assume perl, etc.

                                                  Personally I'd rather an extended :e handle multiple files (:e file1
                                                  file2 ....); perhaps explicit filetype specification could be handled
                                                  via

                                                  :ef myperl.pl perl

                                                  ("edit with filetype")

                                                  Regards,
                                                  Charles Campbell

                                                  --
                                                  Charles E Campbell, Jr, PhD _ __ __
                                                  Goddard Space Flight Center / /_/\_\_/ /
                                                  cec@... /_/ \/_//_/
                                                  PGP public key: http://www.erols.com/astronaut/pgp.html
                                                Your message has been successfully submitted and would be delivered to recipients shortly.