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

vim's -l command-line option not quite vi-compatible

Expand Messages
  • Dorai Sitaram
    Minor but hopefully easy fix. vim s -l command-line option seems to apply the lisp option only to the first file that it opens. Per vi tradition, every file
    Message 1 of 3 , May 1, 2003
    • 0 Attachment
      Minor but hopefully easy fix.

      vim's -l command-line option seems to apply the 'lisp'
      option only to the first file that it opens. Per vi
      tradition, every file opened by vim -l, whether given
      on the command line, or opened with a :e, should get
      the 'lisp' option set.

      (In other words, this is somewhat like -R option, which
      also applies to every file opened.)
    • Bram Moolenaar
      ... Indeed. Strange that nobody noticed this until now. The fix is quite easy: ... *************** *** 677,683 **** case l : /* -l lisp mode, lisp and
      Message 2 of 3 , May 1, 2003
      • 0 Attachment
        Dorai wrote:

        > Minor but hopefully easy fix.
        >
        > vim's -l command-line option seems to apply the 'lisp'
        > option only to the first file that it opens. Per vi
        > tradition, every file opened by vim -l, whether given
        > on the command line, or opened with a :e, should get
        > the 'lisp' option set.
        >
        > (In other words, this is somewhat like -R option, which
        > also applies to every file opened.)

        Indeed. Strange that nobody noticed this until now. The fix is quite
        easy:

        *** main.c~ Tue Apr 29 16:24:53 2003
        --- main.c Thu May 1 19:23:56 2003
        ***************
        *** 677,683 ****

        case 'l': /* "-l" lisp mode, 'lisp' and 'showmatch' on */
        #ifdef FEAT_LISP
        ! curbuf->b_p_lisp = TRUE;
        p_sm = TRUE;
        #endif
        break;
        --- 677,683 ----

        case 'l': /* "-l" lisp mode, 'lisp' and 'showmatch' on */
        #ifdef FEAT_LISP
        ! set_option_value((char_u *)"lisp", 1L, NULL, 0);
        p_sm = TRUE;
        #endif
        break;

        --
        Why is it called "Windows"? "Gates" would be more appropriate...

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
        \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
        \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///
      • Dorai Sitaram
        ... Well, here s a patch for doc/options.txt that should solve the low visibility of vim among Lisp users. 1/2:-) ... *************** *** 3564,3570 **** {not
        Message 3 of 3 , May 1, 2003
        • 0 Attachment
          Bram wrote:
          >
          > Dorai wrote:
          >
          > > Minor but hopefully easy fix.
          > >
          > > vim's -l command-line option seems to apply the 'lisp'
          > > option only to the first file that it opens. Per vi
          > > tradition, every file opened by vim -l, whether given
          > > on the command line, or opened with a :e, should get
          > > the 'lisp' option set.
          > >
          > > (In other words, this is somewhat like -R option, which
          > > also applies to every file opened.)
          >
          > Indeed. Strange that nobody noticed this until now.

          Well, here's a patch for doc/options.txt that should
          solve the low visibility of vim among Lisp users. 1/2:-)


          *** options.txt Wed Apr 23 10:29:14 2003
          --- options.txt.new Thu May 1 14:24:39 2003
          ***************
          *** 3564,3570 ****
          {not available when compiled without the |+lispindent|
          feature}
          Lisp mode: When <Enter> is typed in insert mode set the indent for
          ! the next line to Lisp standards (well, sort of). Also happens with
          "cc" or "S". 'autoindent' must also be on for this to work. The 'p'
          flag in 'cpoptions' changes the method of indenting: Vi compatible or
          better. Also see 'lispwords'.
          --- 3564,3570 ----
          {not available when compiled without the |+lispindent|
          feature}
          Lisp mode: When <Enter> is typed in insert mode set the indent for
          ! the next line to Lisp standards. Also happens with
          "cc" or "S". 'autoindent' must also be on for this to work. The 'p'
          flag in 'cpoptions' changes the method of indenting: Vi compatible or
          better. Also see 'lispwords'.
        Your message has been successfully submitted and would be delivered to recipients shortly.