From: Matt Armstrong <matt@rfc20.org>
To: Alan Mackenzie <acm@muc.de>, Juri Linkov <juri@linkov.net>
Cc: "Richard Copley" <rcopley@gmail.com>,
"martin rudalics" <rudalics@gmx.at>,
"Óscar Fuentes" <ofv@wanadoo.es>,
"Emacs Development" <emacs-devel@gnu.org>
Subject: Re: goto-line-history should not be buffer local.
Date: Tue, 16 Feb 2021 14:52:05 -0800 [thread overview]
Message-ID: <m2o8gjzkve.fsf@matts-mbp-2016.lan> (raw)
In-Reply-To: <YCwx0eSqEeBz2xcW@ACM>
Alan Mackenzie <acm@muc.de> writes:
> Hello, Juri.
>
> On Tue, Feb 16, 2021 at 19:13:36 +0200, Juri Linkov wrote:
>> > -(defvar-local goto-line-history nil
>> > +(defcustom goto-line-history-local nil
>> > + "If this option is nil, `goto-line-history' is shared between all buffers.
>> > +if it is non-nil, each buffer has its own value of this history list.
>> > +
>> > +Note that on changing from non-nil to nil, the former contents of
>> > +`goto-line-history' for each buffer are discarded on use of
>> > +`goto-line' in that buffer."
>> > + :group 'editing
>> > + :type 'boolean
>> > + :safe #'booleanp
>> > + :version "28.1")
>
>> > Anybody have any objections to this?
>
>> This is not an objection, just sharing a tip that to make
>> Isearch history buffer-local like it's in web browsers,
>> where each web page tab uses own local search history,
>> is possible with a small code snippet:
>
>> (make-variable-buffer-local 'search-ring)
>> (make-variable-buffer-local 'regexp-search-ring)
>
>> OTOH, with using defcustom it's easier to customize this, indeed.
>
> The point about the approach I've taken is that once a variable has
> undergone make-variable-buffer-local, it cannot be changed back to a
> non-local variable, except by restarting Emacs (I'm not sure whether or
> not this is a design bug). So I've avoided the use of that primitive.
Why the option at all? Why not just make the history global?
I'm not strongly opposed, but I also don't think "make an option for it"
is always the right thing.
Who are the people who would set the option back to buffer local
history?
Note: the feature hasn't escaped to a stable release yet, so no strong
need for an option for backward compatibility reasons.
This is the strongest statement in favor of buffer locality I found:
https://lists.gnu.org/r/bug-gnu-emacs/2019-11/msg01580.html:
> I thought that it might be even better to have the history be
> buffer-local as well; because line numbers from one buffer don't
> really make sense on another.
"it might be better". We've now got people who actively found it
annoying.
FYI we've got a similar, not yet fixed, bug about goto-char's history:
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=6980. I'd say both should
work a similar way, but I'm unconvinced that every such case needs an
option covering a local vs. global choice.
next prev parent reply other threads:[~2021-02-16 22:52 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-14 19:18 goto-line-history should not be buffer local Alan Mackenzie
2021-02-14 23:08 ` Óscar Fuentes
2021-02-14 23:31 ` Richard Copley
2021-02-15 8:17 ` martin rudalics
2021-02-15 21:12 ` Alan Mackenzie
2021-02-16 11:46 ` Lars Ingebrigtsen
2021-02-16 17:13 ` Juri Linkov
2021-02-16 20:57 ` Alan Mackenzie
2021-02-16 22:52 ` Matt Armstrong [this message]
2021-02-16 22:56 ` Lars Ingebrigtsen
2021-02-18 0:26 ` Rolf Ade
2021-02-18 10:43 ` Alan Mackenzie
2021-02-18 11:04 ` Kévin Le Gouguec
2021-02-18 11:38 ` Rolf Ade
2021-02-18 10:53 ` Philip Kaludercic
2021-02-18 11:02 ` Andreas Schwab
2021-02-16 22:56 ` Stefan Monnier
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2o8gjzkve.fsf@matts-mbp-2016.lan \
--to=matt@rfc20.org \
--cc=acm@muc.de \
--cc=emacs-devel@gnu.org \
--cc=juri@linkov.net \
--cc=ofv@wanadoo.es \
--cc=rcopley@gmail.com \
--cc=rudalics@gmx.at \
/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 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.