all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#59379: 29.0.50; `define-advice' documentation needs improving
@ 2022-11-19  7:26 Stefan Kangas
  2022-11-19 12:23 ` Visuwesh
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Kangas @ 2022-11-19  7:26 UTC (permalink / raw)
  To: 59379; +Cc: Stefan Monnier

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





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

end of thread, other threads:[~2024-02-08 13:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-19  7:26 bug#59379: 29.0.50; `define-advice' documentation needs improving Stefan Kangas
2022-11-19 12:23 ` Visuwesh
2022-11-19 13:52   ` Stefan Kangas
2022-11-19 14:44     ` Visuwesh
2022-11-19 15:34   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-08  6:46   ` Visuwesh
2024-02-08 13:49     ` Visuwesh
2024-02-08 13:54       ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.