Subject: bug#69720: 29.2; `shortdoc-copy-function-as-kill' copies the ')' for some functions

From: tpeplt <[email-masked]>
Date: Thu, 14 Mar 2024 12:16:06 -0400

Here is a recipe for reproducing this error:

1. Start Emacs from a shell prompt with ‘emacs -Q’.

2. Run the ‘shortdoc’ command: M-x shortdoc

3. At the prompt "Show summary for functions in: ", type: buffer RET

4. In the buffer "*Shortdoc buffer*", position point on the line that
begins description of the ‘current-buffer’ entry, (current-buffer).

5. Type ‘w’ to copy the name of the function (w runs the command
‘shortdoc-copy-function-as-kill’).

6. Switch to the *scratch* buffer.

7. Type C-y to yank the name of the function ‘current-buffer’ into the
buffer.  Note that the text that is inserted is "current-buffer)", with
a trailing parenthesis instead of "current-buffer".

8. Repeat the sequence of operations above to copy the names of
functions that have at least one argument.  The function name is copied
correctly.

9. Repeat the sequence of operations above to copy the names of other
functions in the *Shortdoc buffer* that have no arguments (such as
‘point’, ‘point-min’, and so on).  Note that when the function name is
yanked into the *scratch* buffer, a trailing parenthesis is
(incorrectly) included in the text.

--