From 6372a3f6e51c35b7b993a423d8ce7b06880f9004 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 2 Sep 2021 20:34:28 +0300 Subject: [PATCH] * lisp/abbrev.el: Improve docstrings of inverse commands (bug#50303) * lisp/abbrev.el (add-mode-abbrev, add-global-abbrev) (inverse-add-mode-abbrev, inverse-add-global-abbrev): Add interlinking to opposite commands in docstrings. --- lisp/abbrev.el | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/lisp/abbrev.el b/lisp/abbrev.el index 54783db2c3e..f370bd3ea6a 100644 --- a/lisp/abbrev.el +++ b/lisp/abbrev.el @@ -288,6 +288,10 @@ or zero means the region is the expansion. A negative argument means to undefine the specified abbrev. Reads the abbreviation in the minibuffer. +See also `inverse-add-mode-abbrev', which performs the opposite task: +if the abbrev text is already in the buffer, use this command to +define an abbrev by specifying the expansion in the minibuffer. + Don't use this function in a Lisp program; use `define-abbrev' instead." (interactive "p") (add-abbrev @@ -304,6 +308,10 @@ expansion; or zero means the region is the expansion. A negative argument means to undefine the specified abbrev. This command uses the minibuffer to read the abbreviation. +See also `inverse-add-global-abbrev', which performs the opposite task: +if the abbrev text is already in the buffer, use this command to +define an abbrev by specifying the expansion in the minibuffer. + Don't use this function in a Lisp program; use `define-abbrev' instead." (interactive "p") (add-abbrev global-abbrev-table "Global" arg)) @@ -330,7 +338,11 @@ Don't use this function in a Lisp program; use `define-abbrev' instead." "Define last word before point as a mode-specific abbrev. With prefix argument N, defines the Nth word before point. This command uses the minibuffer to read the expansion. -Expands the abbreviation after defining it." +Expands the abbreviation after defining it. + +See also `add-mode-abbrev', which performs the opposite task: +if the expansion is already in the buffer, use this command +to define an abbrev by specifying the abbrev in the minibuffer." (interactive "p") (inverse-add-abbrev (if only-global-abbrevs @@ -343,7 +355,11 @@ Expands the abbreviation after defining it." "Define last word before point as a global (mode-independent) abbrev. With prefix argument N, defines the Nth word before point. This command uses the minibuffer to read the expansion. -Expands the abbreviation after defining it." +Expands the abbreviation after defining it. + +See also `add-global-abbrev', which performs the opposite task: +if the expansion is already in the buffer, use this command +to define an abbrev by specifying the abbrev in the minibuffer." (interactive "p") (inverse-add-abbrev global-abbrev-table "Global" n)) -- 2.39.2