GNU bug report logs - #14070
24.3.50; incorrect doc from `C-h f' when use `defadvice' with `before'

Previous Next

Package: emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Wed, 27 Mar 2013 17:27:01 UTC

Severity: minor

Tags: notabug, wontfix

Merged with 13581, 14734

Found in version 24.3.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'Stefan Monnier'" <monnier <at> iro.umontreal.ca>
Cc: 14070 <at> debbugs.gnu.org
Subject: bug#14070: 24.3.50; incorrect doc from `C-h f' when use `defadvice' with `before'
Date: Wed, 27 Mar 2013 12:39:48 -0700
> > :around advice: `ad-Advice-query-replace'
> > 1. It should be :before, not :around, no?
> > (When you click on that link it confirms that it is 
> > `Before-advice'.)
> 
> ad-Advice-query-replace is an "advice container" which in 
> turns contains all the advice added via `defadvice'.

Maybe so, but the point is that the description in `C-h f' is unclear.  The
occurrence of `:around', in particular (and why show a keyword here?) can
mislead.

If you cannot say anything here about what kinds of advice are currently
included in this container, then at least remove the :around - there is no
around advice in the recipe I gave.

The bug is about improving the doc displayed to users.  Please consider
reopening it and untagging it `notabug', until such improvement has actually
been made.

> > 2. How can you tell where that advice is defined?
> 
> You can't because defadvice does not record this information.

3. (Let me know if you prefer a separate enhancement request for this.)

So how about fixing that?

> If you replace your advice with something like:
> 
>    (advice-add 'query-replace :before
>                #'respect-search/replace-region-as-default-flag)

No such function, up through Emacs 24.3: `advice-add'.

Yes, it exists in the version I filed the bug for.  But I am not interested only
in that version.  And I am also interested in defadvice - which is still
supported AFAIK.

>    (defun respect-search/replace-region-as-default-flag (&rest ignore)
>      (interactive...)
>      nil)
> then C-h f should tell you it's a before advice and should 
> let you click your way to its source code.

Sounds good.

4. (Let me know if you prefer a separate bug report for this.)

`advice-add' should have face `font-lock-keyword-face', like `defun' etc.
And the advised function should have face `font-lock-function-name-face'.





This bug report was last modified 5 years and 240 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.