Subject: Re: bug#20489: 25.0.50; next-error-find-buffer chooses non-current buffer without good reason

From: Juri Linkov <[email-masked]>
Date: Wed, 07 Mar 2018 00:17:53 +0200

>>> Anyway, I've fixed the current problem (see below), so this is a matter of
>>> opinion. If you still consider this feature to be important, I think
>>> ideally we'd abstract it away behind a new -function variable as well.
>>
>> Please clarify what do you have in mind.  In what place in code such
>> function could be called?
>
> Any place that contains
>
>   (setq next-error-last-buffer buffer)
>   (setq-default next-error-last-buffer buffer)
>
> now, would instead call
>
>   (funcall next-error-save-last-buffer-function target-buf target-win)

But isn't it possible to do this in next-error-hook?
It's called by run-hooks in the same place in next-error.