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

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

bug#57974: 2022-08-30; Enhancing help facility for function doc string


From: Ikumi Keita
Subject: bug#57974: 2022-08-30; Enhancing help facility for function doc string
Date: Wed, 21 Sep 2022 23:21:20 +0900

Hi Lars,

>>>>> Lars Ingebrigtsen <larsi@gnus.org> writes:
> I'm not quite sure I follow your meaning here.

> Do you have a complete recipe, starting from "emacs -Q", that displays
> the problem?

1. Save the following file as /tmp/foo.el
----------------------------------------------------------------------
(defun func-A ()
  "doc string of A"
  nil)

(defun func-B ()
  "doc string of B"
  t)

(advice-add 'func-A :override #'func-B)
----------------------------------------------------------------------
2. emacs -Q -l /tmp/foo.el
3. Type C-h f func-A RET
4. Then *Help* buffer pops up and shows
----------------------------------------------------------------------
func-A is a Lisp function in ‘/tmp/foo.el’.

(func-A)

doc string of A

This function has :override advice: ‘func-B’.
----------------------------------------------------------------------
The function A behaves as if it were the function B by the nature of
:override advice, so the doc string of A is almost useless. The actual
behavior is described by the doc string of B.

Unfortunately, when A is a mode function and has a long doc string,
users can easily look over the line
This function has :override advice: ‘func-B’.
far downward in the *Help* buffer when they see the output of C-h m.
That results in that they miss the "true" mode description provided by
the doc string of B.

Stephan suggested that such situation can be improved as
,----
| Maybe the help facility should be more careful in how it builds the
| docstring when a function has an `:override` advice, indeed.
`----
, in https://lists.gnu.org/r/auctex-devel/2022-09/msg00046.html

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine





reply via email to

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