unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Drew Adams <drew.adams@oracle.com>
Cc: 19033@debbugs.gnu.org
Subject: bug#19033: 25.0.50; (elisp) `Advising Named Functions' does not describe FUNCTION
Date: Wed, 09 Oct 2019 03:46:14 +0200	[thread overview]
Message-ID: <87y2xuwv15.fsf@gnus.org> (raw)
In-Reply-To: <97aa8252-de9e-4a3d-9a79-4d080bc17aaa@default> (Drew Adams's message of "Wed, 12 Nov 2014 09:11:47 -0800 (PST)")

Drew Adams <drew.adams@oracle.com> writes:

> This node sends you off to node `Core Advising Primitives' for
> information about parameters WHERE and PROPS.
>
> That's bad enough, since `Advising Named Functions' is intended as the
> MAIN entry point for advising functions:
>
>   "But you should use `advice-add' and `advice-remove' for that instead."
>
> But `Advising Named Functions' tells you nothing about FUNCTION.  In
> particular, it does not tell you what its signature must be or must fit.
>
> Worse still, neither does node `Core Advising Primitives' tell you
> anything about the signature of FUNCTION!  So it would not even be
> enough to send readers to that node for information about FUNCTION,
> as we do now for WHERE and PROPS.
>
> What must FUNCTION accept as argument(s)?  What must it return?
> If there are no restrictions on its signature, then say so.

If I understand correctly, what you want is that the

@defmac add-function where place function &optional props

in

@node Core Advising Primitives

should describe what parameters @var{function} takes in that macro.
That is indeed not described in that node, presumably because it's
complicated.  Instead, we're directed to

@var{where} determines how @var{function} is composed with the
existing function, e.g., whether @var{function} should be called before, or
after the original function.  @xref{Advice Combinators}, for the list of
available ways to compose the two functions.

where we find stuff like

@table @code
@item :before
Call @var{function} before the old function.  Both functions receive the
same arguments

I think that makes sense -- trying to say anything about the parameters
before talking about @var{where} is pretty futile, because @var{where}
decides what parameters the function will receive.

So I don't see anything to fix here, and I'm closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





      reply	other threads:[~2019-10-09  1:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-12 17:11 bug#19033: 25.0.50; (elisp) `Advising Named Functions' does not describe FUNCTION Drew Adams
2019-10-09  1:46 ` Lars Ingebrigtsen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y2xuwv15.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=19033@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).