bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#37856: 27.0.50; 'next-error' advised with 'recenter' signals error w


From: Robert Pluim
Subject: bug#37856: 27.0.50; 'next-error' advised with 'recenter' signals error when run from "*grep*" buffer
Date: Tue, 22 Oct 2019 09:56:14 +0200

>>>>> On Tue, 22 Oct 2019 00:19:13 +0200, Stefan Kangas <stefan@marxist.se> 
>>>>> said:

    Stefan> Juanma Barranquero <lekktu@gmail.com> writes:
    >> > What am I missing?
    >> 
    >> What's wrong with
    >> 
    >> (add-hook 'next-error-hook 'recenter)

    Stefan> Oops, how silly of me.  Yes, I'll just use that.  Thanks.

    Stefan> I'm still a bit confounded by the above behaviour, but if everyone
    Stefan> else feels that everything is in order I'll just go ahead and close
    Stefan> this.  Sorry about the noise.

The add-function docstring says:

    Add a piece of advice on the function stored at PLACE.
    FUNCTION describes the code to add.  WHERE describes where to add it.
    WHERE can be explained by showing the resulting new function, as the
    result of combining FUNCTION and the previous value of PLACE, which we
    call OLDFUN here:
    `:before'   (lambda (&rest r) (apply FUNCTION r) (apply OLDFUN r))
    `:after'    (lambda (&rest r) (prog1 (apply OLDFUN r) (apply FUNCTION r)))
    `:around'   (lambda (&rest r) (apply FUNCTION OLDFUN r))

so I think Iʼd agree with your expectations. Of course, you could use
:around and call 'next-error' yourself in your function (untested).

Robert





reply via email to

[Prev in Thread] Current Thread [Next in Thread]