Hi Bram
Hi Christian


On 2015-08-14 Friday at 23:14 +0200 Bram Moolenaar wrote:
> Roland Eggner wrote:
> > hg log -p --rev 349e6c01f35d00f6035aec42fc43d02173eb00cc
> > > diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
> > > --- a/runtime/doc/autocmd.txt
> > > +++ b/runtime/doc/autocmd.txt
> > > @@ -1,4 +1,4 @@
> > > -*autocmd.txt*   For Vim version 7.4.  Last change: 2015 Jul 20
> > > +*autocmd.txt*   For Vim version 7.4.  Last change: 2015 Aug 05
> > >
> > >
> > >                   VIM REFERENCE MANUAL    by Bram Moolenaar
> > > @@ -1072,7 +1072,7 @@ Instead of a pattern buffer-local autocommands use 
> > > one of these forms:
> > >  Examples: >
> > >      :au CursorHold <buffer>  echo 'hold'
> > >      :au CursorHold <buffer=33>  echo 'hold'
> > > -    :au CursorHold <buffer=abuf>  echo 'hold'
> > > +    :au BufNewFile * CursorHold <buffer=abuf>  echo 'hold'
> > 
> > This hunk perhaps accidental?
> 
> The original use of "abuf" didn't work.  This example was suggested on
> the maillist.  If I remember correctly...

Not suggested by me.


On 2015-08-12 Wednesday at 09:39 +0200 Christian Brabandt wrote:
> Am 2015-08-12 09:16, schrieb Roland Eggner:
> >> -    :au CursorHold <buffer=abuf>  echo 'hold'
> >> +    :au BufNewFile * CursorHold <buffer=abuf>  echo 'hold'
> > 
> > This hunk perhaps accidental?
> 
> No, it must be
> 
>    :au BufNewFile * au CursorHold <buffer=abuf>  echo 'hold'

Clearly looks more reasonable:
“CursorHold” is valid only as argument to “:autocmd”, not in command position 
AFAIK.

> 
> which shows, that the buffer=abuf is only valid when an autocommand
> is executed.
> 
> But I think, there is something else strange:
> 
> +     On Unix and a few other systems you can also use backticks for the file 
> name
> +     argument, for example: >
> +             :next `find . -name ver\\*.c -print`
> +     The backslashes before the star are required to prevent the shell from
> +     expanding "ver*.c" prior to execution of the find program.  The 
> backslash
> +     before the shell pipe symbol "|" prevents Vim from parsing it as command
> +     termination.
> 
> The example is missing the pipe symbol

Good catch.  Bram dropped the 2nd example I proposed in my patch.


I attached 2 variants of a new patch covering both issues.  They differ only 
regarding the 2nd issue:
(1)  re-adds my example:  IMHO it is a useful template for “real life” command 
     lines.  Even for me being rather experienced with command lines it is 
     not obvious, that a single backslash is required rather than 3 of them.
(2)  drops the sentence being superfluous without my example.

Bram may choose which variant he prefers.



-- 
Best regards,
Roland Eggner

-- 
-- 
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.
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 43f7f40..13e9d35 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -1072,7 +1072,7 @@ Instead of a pattern buffer-local autocommands use one of 
these forms:
 Examples: >
     :au CursorHold <buffer>  echo 'hold'
     :au CursorHold <buffer=33>  echo 'hold'
-    :au BufNewFile * CursorHold <buffer=abuf>  echo 'hold'
+    :au BufNewFile * au CursorHold <buffer=abuf>  echo 'hold'
 
 All the commands for autocommands also work with buffer-local autocommands,
 simply use the special string instead of the pattern.  Examples: >
diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt
index 1be6a6d..eb90d4a 100644
--- a/runtime/doc/editing.txt
+++ b/runtime/doc/editing.txt
@@ -415,6 +415,7 @@ Finds files:
 On Unix and a few other systems you can also use backticks for the file name
 argument, for example: >
        :next `find . -name ver\\*.c -print`
+       :view `ls -t *.patch  \| head -n1`
 The backslashes before the star are required to prevent the shell from
 expanding "ver*.c" prior to execution of the find program.  The backslash
 before the shell pipe symbol "|" prevents Vim from parsing it as command
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 43f7f40..13e9d35 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -1072,7 +1072,7 @@ Instead of a pattern buffer-local autocommands use one of 
these forms:
 Examples: >
     :au CursorHold <buffer>  echo 'hold'
     :au CursorHold <buffer=33>  echo 'hold'
-    :au BufNewFile * CursorHold <buffer=abuf>  echo 'hold'
+    :au BufNewFile * au CursorHold <buffer=abuf>  echo 'hold'
 
 All the commands for autocommands also work with buffer-local autocommands,
 simply use the special string instead of the pattern.  Examples: >
diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt
index 1be6a6d..6d40458 100644
--- a/runtime/doc/editing.txt
+++ b/runtime/doc/editing.txt
@@ -416,9 +416,7 @@ On Unix and a few other systems you can also use backticks 
for the file name
 argument, for example: >
        :next `find . -name ver\\*.c -print`
 The backslashes before the star are required to prevent the shell from
-expanding "ver*.c" prior to execution of the find program.  The backslash
-before the shell pipe symbol "|" prevents Vim from parsing it as command
-termination.
+expanding "ver*.c" prior to execution of the find program.
 This also works for most other systems, with the restriction that the
 backticks must be around the whole item.  It is not possible to have text
 directly before the first or just after the last backtick.

Attachment: pgp9RN8T8Lm_p.pgp
Description: PGP signature

Raspunde prin e-mail lui