bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#50303: Add interlinks to docstrings of inverse abbrev


From: Juri Linkov
Subject: bug#50303: Add interlinks to docstrings of inverse abbrev
Date: Tue, 31 Aug 2021 21:11:05 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

>> @@ -287,6 +287,7 @@ add-mode-abbrev
>> +You can also use the opposite command `inverse-add-mode-abbrev'.
>
> Thanks, but I think "you can also use" is not the best text here.  It
> could be interpreted to mean that the other command does something
> similar, which is not true, and contradicts the "opposite" part.
> This makes the text confusing.
>
> How about saying explicitly what that command does.  For example:
>
>   To define expansion for the word at point, use `inverse-add-mode-abbrev'.
>
> And similarly for the other doc strings.

The intention was to indicate that these are opposite commands.
A good explanation is in (info "(emacs) Defining Abbrevs"):

     ‘C-x a i g’ (‘inverse-add-global-abbrev’) and ‘C-x a i l’
  (‘inverse-add-mode-abbrev’) perform the opposite task: if the abbrev
  text is already in the buffer, you use these commands to define an
  abbrev by specifying the expansion in the minibuffer.  These commands
  will expand the abbrev text used for the definition.

Also to reduce confusion, to explicitly mention what another command does:

1. the abbrev is in the buffer, read the expansion from the minibuffer
2. the expansion is in the buffer, read the abbrev from the minibuffer

So maybe this patch is better:

diff --git a/lisp/abbrev.el b/lisp/abbrev.el
index 54783db2c3..74c9a49b3b 100644
--- a/lisp/abbrev.el
+++ b/lisp/abbrev.el
@@ -288,6 +288,9 @@ add-mode-abbrev
 A negative argument means to undefine the specified abbrev.
 Reads the abbreviation in the minibuffer.
 
+Instead of this, to read the expansion in the minibuffer
+for the abbreviation at point, use `inverse-add-mode-abbrev'.
+
 Don't use this function in a Lisp program; use `define-abbrev' instead."
   (interactive "p")
   (add-abbrev
@@ -304,6 +307,9 @@ add-global-abbrev
 A negative argument means to undefine the specified abbrev.
 This command uses the minibuffer to read the abbreviation.
 
+Instead of this, to read the expansion in the minibuffer
+for the abbreviation at point, use `inverse-add-global-abbrev'.
+
 Don't use this function in a Lisp program; use `define-abbrev' instead."
   (interactive "p")
   (add-abbrev global-abbrev-table "Global" arg))
@@ -330,7 +336,10 @@ inverse-add-mode-abbrev
   "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.
+
+Instead of this, to read the abbreviation in the minibuffer
+for the expansion at point, use `add-mode-abbrev'."
   (interactive "p")
   (inverse-add-abbrev
    (if only-global-abbrevs
@@ -343,7 +352,10 @@ inverse-add-global-abbrev
   "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.
+
+Instead of this, to read the abbreviation in the minibuffer
+for the expansion at point, use `add-global-abbrev'."
   (interactive "p")
   (inverse-add-abbrev global-abbrev-table "Global" n))
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]