Hi,

Help says "[where]" but code comment and commit comment say "[what]".
Which is right?
--
thinca <[email protected]>


2016-03-13 6:47 GMT+09:00 Bram Moolenaar <[email protected]>:
>
> Patch 7.4.1553
> Problem:    ":runtime" does not use 'packpath'.
> Solution:   Add "what" argument.
> Files:      src/ex_cmds2.c, src/vim.h, runtime/doc/repeat.txt,
>             src/testdir/test_packadd.vim
>
>
> *** ../vim-7.4.1552/src/ex_cmds2.c      2016-03-12 22:11:34.239300280 +0100
> --- src/ex_cmds2.c      2016-03-12 22:42:18.755994876 +0100
> ***************
> *** 2901,2912 ****
>   #endif
>
>   /*
> !  * ":runtime {name}"
>    */
>       void
>   ex_runtime(exarg_T *eap)
>   {
> !     source_runtime(eap->arg, eap->forceit ? DIP_ALL : 0);
>   }
>
>       static void
> --- 2901,2938 ----
>   #endif
>
>   /*
> !  * ":runtime [what] {name}"
>    */
>       void
>   ex_runtime(exarg_T *eap)
>   {
> !     char_u  *arg = eap->arg;
> !     char_u  *p = skiptowhite(arg);
> !     int           len = (int)(p - arg);
> !     int           flags = eap->forceit ? DIP_ALL : 0;
> !
> !     if (STRNCMP(arg, "START", len) == 0)
> !     {
> !       flags += DIP_START + DIP_NORTP;
> !       arg = skipwhite(arg + len);
> !     }
> !     else if (STRNCMP(arg, "OPT", len) == 0)
> !     {
> !       flags += DIP_OPT + DIP_NORTP;
> !       arg = skipwhite(arg + len);
> !     }
> !     else if (STRNCMP(arg, "PACK", len) == 0)
> !     {
> !       flags += DIP_START + DIP_OPT + DIP_NORTP;
> !       arg = skipwhite(arg + len);
> !     }
> !     else if (STRNCMP(arg, "ALL", len) == 0)
> !     {
> !       flags += DIP_START + DIP_OPT;
> !       arg = skipwhite(arg + len);
> !     }
> !
> !     source_runtime(arg, flags);
>   }
>
>       static void
> ***************
> *** 3067,3081 ****
>       void      (*callback)(char_u *fname, void *ck),
>       void      *cookie)
>   {
> !     int               done;
>       char_u    *s;
>       int               len;
>       char      *start_dir = "pack/*/start/*/%s";
>       char      *opt_dir = "pack/*/opt/*/%s";
>
> !     done = do_in_path(p_rtp, name, flags, callback, cookie);
>
> !     if (done == FAIL && (flags & DIP_START))
>       {
>         len = STRLEN(start_dir) + STRLEN(name);
>         s = alloc(len);
> --- 3093,3108 ----
>       void      (*callback)(char_u *fname, void *ck),
>       void      *cookie)
>   {
> !     int               done = FAIL;
>       char_u    *s;
>       int               len;
>       char      *start_dir = "pack/*/start/*/%s";
>       char      *opt_dir = "pack/*/opt/*/%s";
>
> !     if ((flags & DIP_NORTP) == 0)
> !       done = do_in_path(p_rtp, name, flags, callback, cookie);
>
> !     if ((done == FAIL || (flags & DIP_ALL)) && (flags & DIP_START))
>       {
>         len = STRLEN(start_dir) + STRLEN(name);
>         s = alloc(len);
> ***************
> *** 3086,3092 ****
>         vim_free(s);
>       }
>
> !     if (done == FAIL && (flags & DIP_OPT))
>       {
>         len = STRLEN(opt_dir) + STRLEN(name);
>         s = alloc(len);
> --- 3113,3119 ----
>         vim_free(s);
>       }
>
> !     if ((done == FAIL || (flags & DIP_ALL)) && (flags & DIP_OPT))
>       {
>         len = STRLEN(opt_dir) + STRLEN(name);
>         s = alloc(len);
> *** ../vim-7.4.1552/src/vim.h   2016-03-12 22:11:34.247300195 +0100
> --- src/vim.h   2016-03-12 22:27:03.381577532 +0100
> ***************
> *** 2294,2298 ****
> --- 2294,2299 ----
>   #define DIP_ERR           0x04        /* give an error message when none 
> found. */
>   #define DIP_START   0x08      /* also use "start" directory in 'packpath' */
>   #define DIP_OPT           0x10        /* also use "opt" directory in 
> 'packpath' */
> + #define DIP_NORTP   0x20      /* do not use 'runtimepath' */
>
>   #endif /* VIM__H */
> *** ../vim-7.4.1552/runtime/doc/repeat.txt      2016-03-09 22:18:52.166442971 
> +0100
> --- runtime/doc/repeat.txt      2016-03-12 22:20:49.305494588 +0100
> ***************
> *** 175,184 ****
>                         {not in Vi}
>
>                                                         *:ru* *:runtime*
> ! :ru[ntime][!] {file} ..
>                         Read Ex commands from {file} in each directory given
> !                       by 'runtimepath'.  There is no error for non-existing
> !                       files.  Example: >
>                                 :runtime syntax/c.vim
>
>   <                     There can be multiple {file} arguments, separated by
> --- 182,193 ----
>                         {not in Vi}
>
>                                                         *:ru* *:runtime*
> ! :ru[ntime][!] [where] {file} ..
>                         Read Ex commands from {file} in each directory given
> !                       by 'runtimepath' and/or 'packpath'.  There is no error
> !                       for non-existing files.
> !
> !                       Example: >
>                                 :runtime syntax/c.vim
>
>   <                     There can be multiple {file} arguments, separated by
> ***************
> *** 192,197 ****
> --- 201,215 ----
>                         When it is not included only the first found file is
>                         sourced.
>
> +                       When [where] is omitted only 'runtimepath' is used.
> +                       Other values:
> +                               START   search under "start" in 'packpath'
> +                               OPT     search under "opt" in 'packpath'
> +                               PACK    search under "start" and "opt" in
> +                                       'packpath'
> +                               ALL     first use 'runtimepath', then search
> +                                       under "start" and "opt" in 'packpath'
> +
>                         When {file} contains wildcards it is expanded to all
>                         matching files.  Example: >
>                                 :runtime! plugin/*.vim
> ***************
> *** 231,236 ****
> --- 249,264 ----
>
>                         Also see |pack-add|.
>
> + :packloadall[!]               Load all packages in the "start" directories 
> under
> +                       'packpath'.  The directories found are added to
> +                       'runtimepath'.
> +                       This normally done during startup, after loading your
> +                       .vimrc file.  With this command it can be done
> +                       earlier.
> +                       Packages will be loaded only once.  After this command
> +                       it won't happen again.  When the optional ! is added
> +                       this command will load packages even when done before.
> +                       See |packages|.
>
>   :scripte[ncoding] [encoding]          *:scripte* *:scriptencoding* *E167*
>                         Specify the character encoding used in the script.
> ***************
> *** 454,461 ****
>   ones under "pack/foo/start".  See |pack-add| below for how the "opt" 
> directory
>   is used.
>
> ! Loading packages will not happen if loading plugins is disabled, see
> ! |load-plugins|.
>
>
>   Using a single plugin and loading it automatically ~
> --- 482,494 ----
>   ones under "pack/foo/start".  See |pack-add| below for how the "opt" 
> directory
>   is used.
>
> ! Loading packages automatically will not happen if loading plugins is 
> disabled,
> ! see |load-plugins|.
> !
> ! To load packages earlier, so that 'runtimepath' gets updated: >
> !       :packloadall
> ! This also works when loading plugins is disabled.  The automatic loading 
> will
> ! only happen once.
>
>
>   Using a single plugin and loading it automatically ~
> *** ../vim-7.4.1552/src/testdir/test_packadd.vim        2016-03-12 
> 22:11:34.255300112 +0100
> --- src/testdir/test_packadd.vim        2016-03-12 22:43:11.211445839 +0100
> ***************
> *** 134,136 ****
> --- 134,183 ----
>     colorscheme three
>     call assert_equal(1, g:found_three)
>   endfunc
> +
> + func Test_runtime()
> +   let rundir = &packpath . '/runtime/extra'
> +   let startdir = &packpath . '/pack/mine/start/foo/extra'
> +   let optdir = &packpath . '/pack/mine/opt/bar/extra'
> +   call mkdir(rundir, 'p')
> +   call mkdir(startdir, 'p')
> +   call mkdir(optdir, 'p')
> +   call writefile(['let g:sequence .= "run"'], rundir . '/bar.vim')
> +   call writefile(['let g:sequence .= "start"'], startdir . '/bar.vim')
> +   call writefile(['let g:sequence .= "foostart"'], startdir . '/foo.vim')
> +   call writefile(['let g:sequence .= "opt"'], optdir . '/bar.vim')
> +   call writefile(['let g:sequence .= "xxxopt"'], optdir . '/xxx.vim')
> +   exe 'set rtp=' . &packpath . '/runtime'
> +
> +   let g:sequence = ''
> +   runtime extra/bar.vim
> +   call assert_equal('run', g:sequence)
> +   let g:sequence = ''
> +   runtime START extra/bar.vim
> +   call assert_equal('start', g:sequence)
> +   let g:sequence = ''
> +   runtime OPT extra/bar.vim
> +   call assert_equal('opt', g:sequence)
> +   let g:sequence = ''
> +   runtime PACK extra/bar.vim
> +   call assert_equal('start', g:sequence)
> +   let g:sequence = ''
> +   runtime! PACK extra/bar.vim
> +   call assert_equal('startopt', g:sequence)
> +   let g:sequence = ''
> +   runtime PACK extra/xxx.vim
> +   call assert_equal('xxxopt', g:sequence)
> +
> +   let g:sequence = ''
> +   runtime ALL extra/bar.vim
> +   call assert_equal('run', g:sequence)
> +   let g:sequence = ''
> +   runtime ALL extra/foo.vim
> +   call assert_equal('foostart', g:sequence)
> +   let g:sequence = ''
> +   runtime! ALL extra/xxx.vim
> +   call assert_equal('xxxopt', g:sequence)
> +   let g:sequence = ''
> +   runtime! ALL extra/bar.vim
> +   call assert_equal('runstartopt', g:sequence)
> + endfunc
> *** ../vim-7.4.1552/src/version.c       2016-03-12 22:11:34.255300112 +0100
> --- src/version.c       2016-03-12 22:46:04.005634676 +0100
> ***************
> *** 745,746 ****
> --- 745,748 ----
>   {   /* Add new patch number below this line */
> + /**/
> +     1553,
>   /**/
>
> --
> The only backup you need is the one that you didn't have time for.
> (Murphy)
>
>  /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
> ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
> \\\  an exciting new programming language -- http://www.Zimbu.org        ///
>  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
>
> --
> --
> You received this message from the "vim_dev" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups 
> "vim_dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui