From: Juri Linkov <juri@linkov.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 50303@debbugs.gnu.org
Subject: bug#50303: Add interlinks to docstrings of inverse abbrev
Date: Wed, 01 Sep 2021 18:37:13 +0300 [thread overview]
Message-ID: <87tuj448q6.fsf@mail.linkov.net> (raw)
In-Reply-To: <834kb5sahj.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 31 Aug 2021 22:03:04 +0300")
[-- Attachment #1: Type: text/plain, Size: 715 bytes --]
>> 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.
>
> If you like what the manual says, why not say in the doc string what
> the manual says, or some simple variant of that? I doubt that you'll
> be able to come up with a significantly shorter description that is
> still clear enough.
So here it uses the text copied from the manual:
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: abbrev-docstrings-3.patch --]
[-- Type: text/x-diff, Size: 2208 bytes --]
diff --git a/lisp/abbrev.el b/lisp/abbrev.el
index 54783db2c3..5b3804a006 100644
--- a/lisp/abbrev.el
+++ b/lisp/abbrev.el
@@ -288,6 +288,10 @@ add-mode-abbrev
A negative argument means to undefine the specified abbrev.
Reads the abbreviation in the minibuffer.
+`inverse-add-mode-abbrev' 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 @@ add-global-abbrev
A negative argument means to undefine the specified abbrev.
This command uses the minibuffer to read the abbreviation.
+`inverse-add-global-abbrev' 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 @@ 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.
+
+`add-mode-abbrev' 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 @@ 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.
+
+`add-global-abbrev' 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))
next prev parent reply other threads:[~2021-09-01 15:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-31 16:45 bug#50303: Add interlinks to docstrings of inverse abbrev Juri Linkov
2021-08-31 17:40 ` Eli Zaretskii
2021-08-31 18:11 ` Juri Linkov
2021-08-31 19:03 ` Eli Zaretskii
2021-09-01 15:37 ` Juri Linkov [this message]
2021-09-01 16:08 ` Eli Zaretskii
2021-09-02 17:35 ` Juri Linkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87tuj448q6.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=50303@debbugs.gnu.org \
--cc=eliz@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).