unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#50303: Add interlinks to docstrings of inverse abbrev
@ 2021-08-31 16:45 Juri Linkov
  2021-08-31 17:40 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Juri Linkov @ 2021-08-31 16:45 UTC (permalink / raw)
  To: 50303

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: abbrev-docstrings.patch --]
[-- Type: text/x-diff, Size: 1764 bytes --]

diff --git a/lisp/abbrev.el b/lisp/abbrev.el
index 54783db2c3..0d754cc9cf 100644
--- a/lisp/abbrev.el
+++ b/lisp/abbrev.el
@@ -287,6 +287,7 @@ add-mode-abbrev
 or zero means the region is the expansion.
 A negative argument means to undefine the specified abbrev.
 Reads the abbreviation in the minibuffer.
+You can also use the opposite command `inverse-add-mode-abbrev'.
 
 Don't use this function in a Lisp program; use `define-abbrev' instead."
   (interactive "p")
@@ -303,6 +304,7 @@ add-global-abbrev
 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.
+You can also use the opposite command `inverse-add-global-abbrev'.
 
 Don't use this function in a Lisp program; use `define-abbrev' instead."
   (interactive "p")
@@ -330,7 +332,8 @@ 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.
+You can also use the opposite command `add-mode-abbrev'."
   (interactive "p")
   (inverse-add-abbrev
    (if only-global-abbrevs
@@ -343,7 +346,8 @@ 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.
+You can also use the opposite command `add-global-abbrev'."
   (interactive "p")
   (inverse-add-abbrev global-abbrev-table "Global" n))
 





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* bug#50303: Add interlinks to docstrings of inverse abbrev
  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
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2021-08-31 17:40 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 50303

> From: Juri Linkov <juri@linkov.net>
> Date: Tue, 31 Aug 2021 19:45:32 +0300
> 
> diff --git a/lisp/abbrev.el b/lisp/abbrev.el
> index 54783db2c3..0d754cc9cf 100644
> --- a/lisp/abbrev.el
> +++ b/lisp/abbrev.el
> @@ -287,6 +287,7 @@ add-mode-abbrev
>  or zero means the region is the expansion.
>  A negative argument means to undefine the specified abbrev.
>  Reads the abbreviation in the minibuffer.
> +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.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#50303: Add interlinks to docstrings of inverse abbrev
  2021-08-31 17:40 ` Eli Zaretskii
@ 2021-08-31 18:11   ` Juri Linkov
  2021-08-31 19:03     ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Juri Linkov @ 2021-08-31 18:11 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 50303

[-- Attachment #1: Type: text/plain, Size: 1270 bytes --]

>> @@ -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:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: abbrev-docstrings-2.patch --]
[-- Type: text/x-diff, Size: 1956 bytes --]

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))
 

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* bug#50303: Add interlinks to docstrings of inverse abbrev
  2021-08-31 18:11   ` Juri Linkov
@ 2021-08-31 19:03     ` Eli Zaretskii
  2021-09-01 15:37       ` Juri Linkov
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2021-08-31 19:03 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 50303

> From: Juri Linkov <juri@linkov.net>
> Cc: 50303@debbugs.gnu.org
> Date: Tue, 31 Aug 2021 21:11:05 +0300
> 
> >> +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.

I understand.  But "opposite" is not well-defined in this case (it
could be a command that UN-defines an abbrev, for instance), and
therefore requires a long explanation:

> 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:

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.

Thanks.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#50303: Add interlinks to docstrings of inverse abbrev
  2021-08-31 19:03     ` Eli Zaretskii
@ 2021-09-01 15:37       ` Juri Linkov
  2021-09-01 16:08         ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Juri Linkov @ 2021-09-01 15:37 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 50303

[-- 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))
 

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* bug#50303: Add interlinks to docstrings of inverse abbrev
  2021-09-01 15:37       ` Juri Linkov
@ 2021-09-01 16:08         ` Eli Zaretskii
  2021-09-02 17:35           ` Juri Linkov
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2021-09-01 16:08 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 50303

> From: Juri Linkov <juri@linkov.net>
> Cc: 50303@debbugs.gnu.org
> Date: Wed, 01 Sep 2021 18:37:13 +0300
> 
> > 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:

Thanks, I think this is very good, but I'd like to suggest a minor
stylistic improvement:

> +`inverse-add-mode-abbrev' performs the opposite task: if the abbrev

I would begin this by saying

  See also `inverse-add-mode-abbrev', which performs the opposite
  task: ...





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#50303: Add interlinks to docstrings of inverse abbrev
  2021-09-01 16:08         ` Eli Zaretskii
@ 2021-09-02 17:35           ` Juri Linkov
  0 siblings, 0 replies; 7+ messages in thread
From: Juri Linkov @ 2021-09-02 17:35 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 50303

tags 50303 fixed
close 50303 28.0.50
quit

>> > 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:
>
> Thanks, I think this is very good, but I'd like to suggest a minor
> stylistic improvement:
>
>> +`inverse-add-mode-abbrev' performs the opposite task: if the abbrev
>
> I would begin this by saying
>
>   See also `inverse-add-mode-abbrev', which performs the opposite
>   task: ...

Now pushed with this text.





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-09-02 17:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2021-09-01 16:08         ` Eli Zaretskii
2021-09-02 17:35           ` Juri Linkov

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).