GNU bug report logs -
#59379
29.0.50; `define-advice' documentation needs improving
Previous Next
Reported by: Stefan Kangas <stefankangas <at> gmail.com>
Date: Sat, 19 Nov 2022 07:27:02 UTC
Severity: normal
Found in version 29.0.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#59379: 29.0.50; `define-advice' documentation needs improving
which was filed against the emacs package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 59379 <at> debbugs.gnu.org.
--
59379: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=59379
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
> Cc: 59379 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
> From: Visuwesh <visuweshm <at> gmail.com>
> Date: Thu, 08 Feb 2024 19:19:43 +0530
>
> Kindly ignore this message: somehow I managed to fat finger very badly
> and sent a mail that was addressed to my Prof to debbugs... Sorry for
> the noise.
Closing.
[Message part 3 (message/rfc822, inline)]
This bug report is about the documentation of the `define-advice' macro.
1. It is mentioned in
(info "(elisp) Advising Named Functions")
but there is no explanation of when one would want to use it instead
of `advice-add'. In fact, apart from its definition in that info
node, and its entry in the index, I see no other mention of it in the
manual.
It is mentioned before the `advice-add' function, which seems to
imply that it is more important?
2. It would also be good to have an example of how to use it, at least
it in the manual.
3. This is its argument list:
(define-advice SYMBOL (HOW LAMBDA-LIST &optional NAME DEPTH) &rest
BODY)
The HOW, LAMBDA-LIST, NAME, DEPTH parameters are not documented in
the docstring, nor in the info manual.
4. There also seem to be a mistake (or merely a typo) in the argument
list as described in the argument list (note that "HOW" above is
replaced with "where"):
-- Macro: define-advice symbol (where lambda-list &optional name depth)
&rest body
5. The documentation of NAME says that: "The advice is an anonymous
function if NAME is ‘nil’ or a function named ‘symbol <at> name’."
I struggle with parsing this sentence. It sounds like it is saying
that, if I want an anonymous function, I should define a function
named `symbol <at> name' (substituting `symbol' and `name') and then pass
that argument as the NAME argument? But then the function is not
anonymous?
6. Finally, the info manual says: "This macro defines a piece of advice
and adds it to the function named SYMBOL." Could the words "a piece
of advice" simply be replaced with "an advice", or is there some
important meaning that would be lost?
Thanks.
This bug report was last modified 1 year and 162 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.