all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Florian Beck <fb@miszellen.de>
To: Glenn Morris <rgm@gnu.org>
Cc: 16959@debbugs.gnu.org
Subject: bug#16959: 24.3.50; defadvice docstring out of date
Date: Tue, 11 Mar 2014 06:37:17 +0100	[thread overview]
Message-ID: <531EA10D.20507@miszellen.de> (raw)
In-Reply-To: <vr38ip2a35.fsf@fencepost.gnu.org>

On 10.03.2014 19:16, Glenn Morris wrote:

> Why do you think it is obsolete?

Because every hint of its existence has been expunged from the 
documentation and the new advice seems to offer the same functionality.

>> BTW, the nadvice info could use some more examples and a note on how
>> to transition from defadvice.
>
> I'll leave this report open till someone does that.

Some specifics:

  - See the documentation of the old advice: it starts with "altering 
the behavior of an existing function" (yeah! that's what I'm here for), 
then gives a simple example, a use case ("Suppose you wanted ...").

  - In contrast, the beginning of the new "Advising Functions" is a bit 
confusing: appropriate setter function? set-process-filter? What are 
"such hooks"?

  - The difference between add-function and advice-add is not entirely 
clear to me: the latter is for the "function cell of a symbol", a "named 
function and macros", "macros and autoloaded functions". Which is it? I 
can write

(add-function :after (symbol-function 'somefun) 'someadvice)

but should I? I have the feeling I should stick with advice-add unless 
dealing with process filters.

  - Indeed, it seems the documentation is in the wrong order: from a 
user's perspective, advice-add is what she usually wants and 
add-function is a special case.

  - The docstring of advice-add is useless: it should give me the info I 
need when writing an advice, which is in add-function. IMO is should be 
the other way around: the fact that you need advice-add for macros, etc 
should be mentioned in the docstring of add-function.

  - The page title "Advising Primitives" is misleading in the context of 
"Advising Functions" and "Advising Named Functions".

  - Interactive functions are only discussed in the docstring of 
add-function.

  - Add some examples that show how arguments work for someone who is 
not familiar with &rest and apply.

  - How about reimplementing the two examples from the old docu ("A 
Simple Advice Example" and "Around Advice")? That would also demonstrate 
how to transition to the new mechanism.


-- 
Florian Beck





  reply	other threads:[~2014-03-11  5:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-07 15:00 bug#16959: 24.3.50; defadvice docstring out of date Florian Beck
2014-03-10 18:16 ` Glenn Morris
2014-03-11  5:37   ` Florian Beck [this message]
2014-03-12 13:49     ` Stefan Monnier
2014-03-12 16:30       ` Josh
2014-03-12 18:41         ` Stefan Monnier

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

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

  git send-email \
    --in-reply-to=531EA10D.20507@miszellen.de \
    --to=fb@miszellen.de \
    --cc=16959@debbugs.gnu.org \
    --cc=rgm@gnu.org \
    /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 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.