* Crappyness of Emacs Version 24.5.1 defadvice
@ 2016-06-27 5:46 Davin Pearson
2016-06-28 5:58 ` Davin Pearson
0 siblings, 1 reply; 15+ messages in thread
From: Davin Pearson @ 2016-06-27 5:46 UTC (permalink / raw)
To: help-gnu-emacs
I have recently upgraded Emacs Version 24.5.1
emacs-24.5-bin-i686-mingw32.zip
I have a bunch of defadvice forms for implementing a d-speedbar
feature that is superior to the built in speedbar feature.
(defadvice describe-mode (around d-speedbar activate)
(delete-other-windows)
ad-do-it)
C-h f describe-mode RET says:
:around advice: `ad-Advice-describe-mode'
it used to say:
:around advice: d-speedbar
The old behavior is preferable so I know which file the advice
is coming from.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Crappyness of Emacs Version 24.5.1 defadvice
2016-06-27 5:46 Crappyness of Emacs Version 24.5.1 defadvice Davin Pearson
@ 2016-06-28 5:58 ` Davin Pearson
2016-06-28 11:11 ` Dmitry Gutov
` (2 more replies)
0 siblings, 3 replies; 15+ messages in thread
From: Davin Pearson @ 2016-06-28 5:58 UTC (permalink / raw)
To: help-gnu-emacs
On Monday, June 27, 2016 at 5:46:10 PM UTC+12, Davin Pearson wrote:
> I have recently upgraded Emacs Version 24.5.1
>
> emacs-24.5-bin-i686-mingw32.zip
>
> I have a bunch of defadvice forms for implementing a d-speedbar
> feature that is superior to the built in speedbar feature.
>
> (defadvice describe-mode (around d-speedbar activate)
> (delete-other-windows)
> ad-do-it)
>
> C-h f describe-mode RET says:
>
> :around advice: `ad-Advice-describe-mode'
>
> it used to say:
>
> :around advice: d-speedbar
>
> The old behavior is preferable so I know which file the advice
> is coming from.
Could someone tell me how to get the old behavior back?
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Crappyness of Emacs Version 24.5.1 defadvice
2016-06-28 5:58 ` Davin Pearson
@ 2016-06-28 11:11 ` Dmitry Gutov
2016-06-28 12:59 ` Michael Heerdegen
2016-06-28 14:21 ` Drew Adams
[not found] ` <mailman.239.1467123719.26859.help-gnu-emacs@gnu.org>
2 siblings, 1 reply; 15+ messages in thread
From: Dmitry Gutov @ 2016-06-28 11:11 UTC (permalink / raw)
To: Davin Pearson, help-gnu-emacs
On 06/28/2016 08:58 AM, Davin Pearson wrote:
> Could someone tell me how to get the old behavior back?
You can use advice-add instead. It will make the help output better,
among other things.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Crappyness of Emacs Version 24.5.1 defadvice
2016-06-28 11:11 ` Dmitry Gutov
@ 2016-06-28 12:59 ` Michael Heerdegen
0 siblings, 0 replies; 15+ messages in thread
From: Michael Heerdegen @ 2016-06-28 12:59 UTC (permalink / raw)
To: help-gnu-emacs
Dmitry Gutov <dgutov@yandex.ru> writes:
> On 06/28/2016 08:58 AM, Davin Pearson wrote:
>
> > Could someone tell me how to get the old behavior back?
>
> You can use advice-add instead. It will make the help output better,
> among other things.
To say it more clearly: with advice.el, there is no way to get the old
behavior back (unless you load an old version of that file, maybe).
Michael.
^ permalink raw reply [flat|nested] 15+ messages in thread
* RE: Crappyness of Emacs Version 24.5.1 defadvice
2016-06-28 5:58 ` Davin Pearson
2016-06-28 11:11 ` Dmitry Gutov
@ 2016-06-28 14:21 ` Drew Adams
[not found] ` <mailman.239.1467123719.26859.help-gnu-emacs@gnu.org>
2 siblings, 0 replies; 15+ messages in thread
From: Drew Adams @ 2016-06-28 14:21 UTC (permalink / raw)
To: Davin Pearson, help-gnu-emacs
> > The old behavior is preferable so I know which file the advice
> > is coming from.
>
> Could someone tell me how to get the old behavior back?
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14734
("REGRESSION: defadvice broken wrt doc strings (C-h f)")
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14070
("incorrect doc from `C-h f' when use `defadvice' with `before'")
This post by Stefan provides the rationale behind the new advice
system. (You might want to read the rest of the thread too.)
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16402#31
("Document nadvice.el stuff in Elisp manual before Emacs 24.4")
^ permalink raw reply [flat|nested] 15+ messages in thread
[parent not found: <mailman.239.1467123719.26859.help-gnu-emacs@gnu.org>]
* Re: Crappyness of Emacs Version 24.5.1 defadvice
[not found] ` <mailman.239.1467123719.26859.help-gnu-emacs@gnu.org>
@ 2016-06-29 1:48 ` Davin Pearson
2016-06-29 1:55 ` Michael Heerdegen
` (2 more replies)
0 siblings, 3 replies; 15+ messages in thread
From: Davin Pearson @ 2016-06-29 1:48 UTC (permalink / raw)
To: help-gnu-emacs
On Wednesday, June 29, 2016 at 2:22:01 AM UTC+12, Drew Adams wrote:
> > > The old behavior is preferable so I know which file the advice
> > > is coming from.
> >
> > Could someone tell me how to get the old behavior back?
>
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14734
> ("REGRESSION: defadvice broken wrt doc strings (C-h f)")
>
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14070
> ("incorrect doc from `C-h f' when use `defadvice' with `before'")
>
> This post by Stefan provides the rationale behind the new advice
> system. (You might want to read the rest of the thread too.)
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16402#31
> ("Document nadvice.el stuff in Elisp manual before Emacs 24.4")
I tried the following code but it doesn't work.
(advice-add 'describe-mode
:around
#'(lambda () (delete-other-windows) ad-do-it)
)
Worse still, it brings up the following message when I try C-h f describe-mode RET
:around advice: No documentation
Where do I add the documentation to the advice mechanism?
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Crappyness of Emacs Version 24.5.1 defadvice
2016-06-29 1:48 ` Davin Pearson
@ 2016-06-29 1:55 ` Michael Heerdegen
[not found] ` <mailman.260.1467165391.26859.help-gnu-emacs@gnu.org>
2016-06-29 13:54 ` Rémi Vanicat
2 siblings, 0 replies; 15+ messages in thread
From: Michael Heerdegen @ 2016-06-29 1:55 UTC (permalink / raw)
To: help-gnu-emacs
Davin Pearson <davin.pearson@gmail.com> writes:
> I tried the following code but it doesn't work.
>
> (advice-add 'describe-mode
> :around
> #'(lambda () (delete-other-windows) ad-do-it)
> )
There is no `ad-do-it' pseudo variable/whatever in nadvice anymore. The
functions that are used as a piece of advice are simply called - and
how tells the doc of `add-function', or the manual.
> Worse still, it brings up the following message when I try C-h f
> describe-mode RET
>
> :around advice: No documentation
>
> Where do I add the documentation to the advice mechanism?
Document the function that "is" the advice.
Michael.
^ permalink raw reply [flat|nested] 15+ messages in thread
[parent not found: <mailman.260.1467165391.26859.help-gnu-emacs@gnu.org>]
* Re: Crappyness of Emacs Version 24.5.1 defadvice
[not found] ` <mailman.260.1467165391.26859.help-gnu-emacs@gnu.org>
@ 2016-06-29 7:01 ` Davin Pearson
2016-06-29 9:02 ` Alexis
2016-06-29 7:05 ` Davin Pearson
1 sibling, 1 reply; 15+ messages in thread
From: Davin Pearson @ 2016-06-29 7:01 UTC (permalink / raw)
To: help-gnu-emacs
On Wednesday, June 29, 2016 at 1:56:33 PM UTC+12, Michael Heerdegen wrote:
> Davin Pearson writes:
>
> > I tried the following code but it doesn't work.
> >
> > (advice-add 'describe-mode
> > :around
> > #'(lambda () (delete-other-windows) ad-do-it)
> > )
>
> There is no `ad-do-it' pseudo variable/whatever in nadvice anymore. The
> functions that are used as a piece of advice are simply called - and
> how tells the doc of `add-function', or the manual.
>
> > Worse still, it brings up the following message when I try C-h f
> > describe-mode RET
> >
> > :around advice: No documentation
> >
> > Where do I add the documentation to the advice mechanism?
>
> Document the function that "is" the advice.
>
>
> Michael.
Thanks for your helpful advice. I use defadvice a lot and I am still unsure why Stephen Monier removed that feature.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Crappyness of Emacs Version 24.5.1 defadvice
[not found] ` <mailman.260.1467165391.26859.help-gnu-emacs@gnu.org>
2016-06-29 7:01 ` Davin Pearson
@ 2016-06-29 7:05 ` Davin Pearson
2016-06-30 12:46 ` Michael Heerdegen
[not found] ` <mailman.320.1467290787.26859.help-gnu-emacs@gnu.org>
1 sibling, 2 replies; 15+ messages in thread
From: Davin Pearson @ 2016-06-29 7:05 UTC (permalink / raw)
To: help-gnu-emacs
On Wednesday, June 29, 2016 at 1:56:33 PM UTC+12, Michael Heerdegen wrote:
> Davin Pearson writes:
>
> > I tried the following code but it doesn't work.
> >
> > (advice-add 'describe-mode
> > :around
> > #'(lambda () (delete-other-windows) ad-do-it)
> > )
Why the # character before the lambda form?
Does it do the same thing as (function (lambda () ...))
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Crappyness of Emacs Version 24.5.1 defadvice
2016-06-29 7:05 ` Davin Pearson
@ 2016-06-30 12:46 ` Michael Heerdegen
[not found] ` <mailman.320.1467290787.26859.help-gnu-emacs@gnu.org>
1 sibling, 0 replies; 15+ messages in thread
From: Michael Heerdegen @ 2016-06-30 12:46 UTC (permalink / raw)
To: Davin Pearson; +Cc: help-gnu-emacs
Davin Pearson <davin.pearson@gmail.com> writes:
> Why the # character before the lambda form?
>
> Does it do the same thing as (function (lambda () ...))
Yes, #'THING is equivalent to (function THING). For lambda, it's
redundant in Emacs Lisp, since lambda is self-quoting with `function'.
It doesn't harm, though.
Michael.
^ permalink raw reply [flat|nested] 15+ messages in thread
[parent not found: <mailman.320.1467290787.26859.help-gnu-emacs@gnu.org>]
* Re: Crappyness of Emacs Version 24.5.1 defadvice
[not found] ` <mailman.320.1467290787.26859.help-gnu-emacs@gnu.org>
@ 2016-06-30 13:09 ` Joost Kremers
2016-06-30 21:16 ` Michael Heerdegen
0 siblings, 1 reply; 15+ messages in thread
From: Joost Kremers @ 2016-06-30 13:09 UTC (permalink / raw)
To: help-gnu-emacs
Michael Heerdegen wrote:
> Yes, #'THING is equivalent to (function THING). For lambda, it's
> redundant in Emacs Lisp, since lambda is self-quoting with `function'.
> It doesn't harm, though.
To the eyes it does. ;-)
--
Joost Kremers joostkremers@fastmail.fm
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Crappyness of Emacs Version 24.5.1 defadvice
2016-06-30 13:09 ` Joost Kremers
@ 2016-06-30 21:16 ` Michael Heerdegen
0 siblings, 0 replies; 15+ messages in thread
From: Michael Heerdegen @ 2016-06-30 21:16 UTC (permalink / raw)
To: help-gnu-emacs
Joost Kremers <joost.m.kremers@gmail.com> writes:
> > Yes, #'THING is equivalent to (function THING). For lambda, it's
> > redundant in Emacs Lisp, since lambda is self-quoting with `function'.
> > It doesn't harm, though.
>
> To the eyes it does. ;-)
;-) does even more harm to the eyes. Better write it as ;-\) to avoid
the unmatched paren. It doesn't look very friendly any more that way,
but that's second-tier.
Michael.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Crappyness of Emacs Version 24.5.1 defadvice
2016-06-29 1:48 ` Davin Pearson
2016-06-29 1:55 ` Michael Heerdegen
[not found] ` <mailman.260.1467165391.26859.help-gnu-emacs@gnu.org>
@ 2016-06-29 13:54 ` Rémi Vanicat
2016-06-30 12:43 ` Michael Heerdegen
2 siblings, 1 reply; 15+ messages in thread
From: Rémi Vanicat @ 2016-06-29 13:54 UTC (permalink / raw)
To: help-gnu-emacs
Davin Pearson <davin.pearson@gmail.com> writes:
> On Wednesday, June 29, 2016 at 2:22:01 AM UTC+12, Drew Adams wrote:
>> > > The old behavior is preferable so I know which file the advice
>> > > is coming from.
>> >
>> > Could someone tell me how to get the old behavior back?
>>
>> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14734
>> ("REGRESSION: defadvice broken wrt doc strings (C-h f)")
>>
>> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14070
>> ("incorrect doc from `C-h f' when use `defadvice' with `before'")
>>
>> This post by Stefan provides the rationale behind the new advice
>> system. (You might want to read the rest of the thread too.)
>> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16402#31
>> ("Document nadvice.el stuff in Elisp manual before Emacs 24.4")
>
> I tried the following code but it doesn't work.
>
> (advice-add 'describe-mode
> :around
> #'(lambda () (delete-other-windows) ad-do-it)
> )
>
(defun my-describe-mode-before-advice (oldfun &optional buffer)
"my documentation"
(delete-other-windows)
(apply oldfun buffer))
(advice-add 'describe-mode :around #'my-describe-mode-before-advice)
Or better with a before advice:
(defun my-describe-mode-before-advice (&optional buffer)
"my documentation"
(delete-other-windows))
(advice-add 'describe-mode :before #'my-desccribe-mode-before-advice)
--
Rémi Vanicat
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Crappyness of Emacs Version 24.5.1 defadvice
2016-06-29 13:54 ` Rémi Vanicat
@ 2016-06-30 12:43 ` Michael Heerdegen
0 siblings, 0 replies; 15+ messages in thread
From: Michael Heerdegen @ 2016-06-30 12:43 UTC (permalink / raw)
To: help-gnu-emacs
Rémi Vanicat <vanicat@debian.org> writes:
> (defun my-describe-mode-before-advice (oldfun &optional buffer)
> "my documentation"
> (delete-other-windows)
> (apply oldfun buffer))
>
> (advice-add 'describe-mode :around #'my-describe-mode-before-advice)
>
> Or better with a before advice:
>
> (defun my-describe-mode-before-advice (&optional buffer)
> "my documentation"
> (delete-other-windows))
>
> (advice-add 'describe-mode :before #'my-desccribe-mode-before-advice)
No need to repeat the argument list of the original function if you
don't use the arguments in the body:
(defun my-describe-mode-before-advice (&rest _ignore)
"my documentation"
(delete-other-windows))
Michael.
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2016-06-30 21:16 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-27 5:46 Crappyness of Emacs Version 24.5.1 defadvice Davin Pearson
2016-06-28 5:58 ` Davin Pearson
2016-06-28 11:11 ` Dmitry Gutov
2016-06-28 12:59 ` Michael Heerdegen
2016-06-28 14:21 ` Drew Adams
[not found] ` <mailman.239.1467123719.26859.help-gnu-emacs@gnu.org>
2016-06-29 1:48 ` Davin Pearson
2016-06-29 1:55 ` Michael Heerdegen
[not found] ` <mailman.260.1467165391.26859.help-gnu-emacs@gnu.org>
2016-06-29 7:01 ` Davin Pearson
2016-06-29 9:02 ` Alexis
2016-06-29 7:05 ` Davin Pearson
2016-06-30 12:46 ` Michael Heerdegen
[not found] ` <mailman.320.1467290787.26859.help-gnu-emacs@gnu.org>
2016-06-30 13:09 ` Joost Kremers
2016-06-30 21:16 ` Michael Heerdegen
2016-06-29 13:54 ` Rémi Vanicat
2016-06-30 12:43 ` Michael Heerdegen
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).