From 45c34bd84aa512b262f9d60e3f25f547cb5c189a Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 5 Aug 2019 03:33:45 +0200 Subject: :doautocmd : Never show "No matching autocommands" #10689 The message is useless, it doesn't even mention the event name. vim_dev discussion: https://groups.google.com/forum/#!msg/vim_dev/RTbq58TMq9w/Xr4rSoUTCgAJ ref: https://github.com/vim/vim/issues/4300 --- runtime/doc/autocmd.txt | 31 ++++++++++++++----------------- runtime/doc/vim_diff.txt | 3 +++ 2 files changed, 17 insertions(+), 17 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index ba89c207c2..6b39f1a103 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -1087,14 +1087,12 @@ TextChangedP After a change was made to the text in the popup menu is visible. Otherwise the same as TextChanged. *User* -User Never executed automatically. To be used for - autocommands that are only executed with - ":doautocmd". - Note that when `:doautocmd User MyEvent` is - used while there are no matching autocommands, - you will get an error. If you don't want - that, define a dummy autocommand yourself. - *UserGettingBored* +User Not executed automatically. Use |:doautocmd| + to trigger this, typically for "custom events" + in a plugin. Example: > + :autocmd User MyPlugin echom 'got MyPlugin event' + :doautocmd User MyPlugin +< *UserGettingBored* UserGettingBored When the user presses the same key 42 times. Just kidding! :-) *VimEnter* @@ -1389,18 +1387,17 @@ option will not cause any commands to be executed. When the [group] argument is not given, Vim executes the autocommands for all groups. When the [group] argument is included, Vim executes only the matching - autocommands for that group. Note: if you use an - undefined group name, Vim gives you an error message. + autocommands for that group. Undefined group is an + error. ** After applying the autocommands the modelines are processed, so that their settings overrule the - settings from autocommands, like what happens when - editing a file. This is skipped when the - argument is present. You probably want to use - for events that are not used when loading - a buffer, such as |User|. - Processing modelines is also skipped when no - matching autocommands were executed. + settings from autocommands when editing a file. This + is skipped if is specified. You probably + want to use for events not used when + loading a buffer, such as |User|. + Modelines are also skipped when no matching + autocommands were executed. *:doautoa* *:doautoall* :doautoa[ll] [] [group] {event} [fname] diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index bc742b9221..a358da460c 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -310,6 +310,9 @@ other arguments if used). |input()| and |inputdialog()| support user-defined cmdline highlighting. +Commands: + |:doautocmd| does not warn about "No matching autocommands". + Highlight groups: |hl-ColorColumn|, |hl-CursorColumn| are lower priority than most other groups -- cgit