all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Crappyness of Emacs Version 24.5.1 defadvice
@ 2016-06-27  5:46 Davin Pearson
  2016-06-28  5:58 ` Davin Pearson
  2016-07-01 11:39 ` Fwd: " Andreas Röhler
  0 siblings, 2 replies; 16+ 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] 16+ 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)
  2016-07-01 11:39 ` Fwd: " Andreas Röhler
  1 sibling, 3 replies; 16+ 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] 16+ 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; 16+ 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] 16+ 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; 16+ 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] 16+ 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; 16+ 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] 16+ messages in thread

* 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; 16+ 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] 16+ 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; 16+ 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] 16+ 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  9:02           ` Alexis
  2016-06-29  7:05         ` Davin Pearson
  1 sibling, 1 reply; 16+ 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] 16+ 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; 16+ 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] 16+ messages in thread

* Re: Crappyness of Emacs Version 24.5.1 defadvice
  2016-06-29  7:01         ` Davin Pearson
@ 2016-06-29  9:02           ` Alexis
  0 siblings, 0 replies; 16+ messages in thread
From: Alexis @ 2016-06-29  9:02 UTC (permalink / raw
  To: Davin Pearson; +Cc: help-gnu-emacs


Davin Pearson <davin.pearson@gmail.com> writes:

> Thanks for your helpful advice.  I use defadvice a lot and I am 
> still unsure why Stephen Monier removed that feature.

The current Emacs Lisp Reference Manual suggests the new advice 
implementation is simpler (and thus easier for the Emacs devs to 
maintain) and has behaviour that's easier to understand:

https://www.gnu.org/software/emacs/manual/html_node/elisp/Porting-old-advices.html#Porting-old-advices


Alexis.



^ permalink raw reply	[flat|nested] 16+ 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; 16+ 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] 16+ 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; 16+ 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] 16+ 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; 16+ 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] 16+ messages in thread

* 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; 16+ 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] 16+ 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; 16+ 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] 16+ messages in thread

* Fwd: 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-07-01 11:39 ` Andreas Röhler
  1 sibling, 0 replies; 16+ messages in thread
From: Andreas Röhler @ 2016-07-01 11:39 UTC (permalink / raw
  To: emacs-devel@gnu.org

[-- Attachment #1: Type: text/plain, Size: 1340 bytes --]

Hi,

have a function which needs to trigger some cleanup when done - removing 
temporary files.

Understand it being a case to advice it. As we have some users with 
Emacs 23 still

a change in advice.el of Emacs 24.4 goes into the way.

Forward this message, as there seem to be others too stumbling over this.
Also reading in NEWS.24

** `defadvice' does not honor the `freeze' flag and cannot advise
special-forms any more.

Maybe switching back might not break anything and being recommendable?

There exists nadvice.el still for the folks needing the most advanced.

Just a question,

Andreas



-------- Forwarded Message --------
Subject: 	Crappyness of Emacs Version 24.5.1 defadvice
Date: 	Sun, 26 Jun 2016 22:46:09 -0700 (PDT)
From: 	Davin Pearson <davin.pearson@gmail.com>
To: 	help-gnu-emacs@gnu.org
Newsgroups: 	gnu.emacs.help



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.


[-- Attachment #2: Type: text/html, Size: 2806 bytes --]

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

end of thread, other threads:[~2016-07-01 11:39 UTC | newest]

Thread overview: 16+ 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
2016-07-01 11:39 ` Fwd: " Andreas Röhler

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.