unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Juri Linkov <juri@linkov.net>
Cc: 28864@debbugs.gnu.org, Noam Postavsky <npostavs@gmail.com>,
	Tino Calancha <tino.calancha@gmail.com>
Subject: bug#28864: 25.3.50; next-error-no-select does select
Date: Wed, 1 Nov 2017 01:42:21 +0200	[thread overview]
Message-ID: <0cee613e-6189-2eef-2407-b84c46dd3175@yandex.ru> (raw)
In-Reply-To: <87o9onc775.fsf@localhost>

On 10/31/17 11:56 PM, Juri Linkov wrote:

> I'm thinking about adding 3 customizable options for
> next-error-find-buffer-function:
> 
> 1. buffer-local - new default
> 2. window-local - useful for one window per each navigation buffer

I'm not sure either can be congruent to all next-error-function 
applications. Some next-error source buffers contain their own errors 
(so buffer-local is natural), and others point to errors in other 
buffers (supposing they can learn to open those in the same window, 
window-local might be fitting). But both kinds are there, and all users 
deal with both.

> 3. frame-local - old implicit default now separated into its own function

That doesn't sound like a sufficient description: the old default also 
includes visibility-based logic. So it's not just one value per frame.

>> In general, next-error can jump between windows, so window-local is not
>> a good fit for my mental model.
> 
> It's bad when next-error unpredictably jumps between windows.
> I hope we could find a way to fix this erratic behavior.

It basically a rule now that Grep opens errors in a different windows 
(so that the Grep buffer stays visible). So erratic or not, multiple 
windows are used routinely.

>> Do we need the buffer-local-ity changes to next-error-last-buffer for that?
>> Because if we do, that's okay, let's commit it and everything, but
>> otherwise I'd rather wait and look for a more elegant approach (for other
>> issues aside from this one).
> 
> In the last previous patch, next-error visits next-error-find-buffer,
> calls next-error-function that possibly navigates to another buffer,
> then sets both global and buffer-local of next-error-last-buffer.
> This seems quite logical.  And it works in all my tests.

That... doesn't answer my question, I think. Or I didn't understand the 
answer.

So let me try again: is the new next-error-find-buffer stuff necessary 
to fix the current bug? Or is suppressing the change to 
next-error-last-buffer during next-error-function calls enough for that?

> We could use "current" for 0.

Fine by me.

> Could you also find a value for "last"?

I don't think it's needed. first/previous/current/current is enough.

>>> +(defun next-error-internal ()
>>> +  "Visit the source code corresponding to the `next-error' message at point."
>>> +  (let ((next-error-buffer (current-buffer)))
>>>        ;; we know here that next-error-function is a valid symbol we can funcall
>>> -    (with-current-buffer next-error-last-buffer
>>> -      (funcall next-error-function (prefix-numeric-value arg) reset)
>>> +    (with-current-buffer next-error-buffer
>>> +      (funcall next-error-function 0 nil)
>>> +      ;; next-error-function might change the value of
>>> +      ;; next-error-last-buffer, so set it later
>>> +      (setq next-error-last-buffer next-error-buffer)
>>> +      (setq-default next-error-last-buffer next-error-last-buffer)
>>>          (when next-error-recenter
>>>            (recenter next-error-recenter))
>>> +      (message "Showing another error from %s" next-error-last-buffer)
>>
>> Is it really "another"? Or maybe it's "current", "last" or "closest" error?
> 
> Maybe just "Showing error from %s"?  Or simply "Error from %s".
> Then we could simplify the above messages as well: "%s error from %s"
> for e.g. "Next error from %s", "Previous error from %s", ...

Why not use "current" here as well? After all, we pass 0 to 
next-error-function here.





  reply	other threads:[~2017-10-31 23:42 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-16 13:07 bug#28864: 25.3.50; next-error-no-select does select Tino Calancha
2017-10-17 13:37 ` Dmitry Gutov
2017-10-17 14:17   ` Tino Calancha
2017-10-18  7:44     ` Dmitry Gutov
2017-10-20  7:21       ` Tino Calancha
2017-10-20 21:49         ` Dmitry Gutov
2017-10-21  3:52           ` Tino Calancha
2017-10-22 20:32             ` Juri Linkov
2017-10-22 22:29               ` Dmitry Gutov
2017-10-23 20:12                 ` Juri Linkov
2017-10-23 20:23                   ` Dmitry Gutov
2017-10-24 20:22                     ` Juri Linkov
2017-10-24 22:23                       ` Dmitry Gutov
2017-10-25 23:58                         ` Dmitry Gutov
2017-10-28 21:07                         ` Juri Linkov
2017-10-28 22:46                           ` Dmitry Gutov
2017-10-29 21:42                             ` Juri Linkov
2017-10-30 14:59                               ` Dmitry Gutov
2017-10-30 18:30                                 ` Eli Zaretskii
2017-10-30 21:13                                   ` Dmitry Gutov
2017-10-30 21:15                                   ` Juri Linkov
2017-10-30 21:14                                 ` Juri Linkov
2017-10-31  0:02                                   ` Dmitry Gutov
2017-10-31 21:56                                     ` Juri Linkov
2017-10-31 23:42                                       ` Dmitry Gutov [this message]
2017-11-02 22:00                                         ` Juri Linkov
2017-11-05 13:37                                           ` Dmitry Gutov
2017-11-06 21:41                                             ` Juri Linkov
2017-10-28 20:54             ` Juri Linkov
2017-10-28 22:42               ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0cee613e-6189-2eef-2407-b84c46dd3175@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=28864@debbugs.gnu.org \
    --cc=juri@linkov.net \
    --cc=npostavs@gmail.com \
    --cc=tino.calancha@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).