emacs-devel
[Top][All Lists]
Advanced

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

Re: goto-line-history should not be buffer local.


From: Alan Mackenzie
Subject: Re: goto-line-history should not be buffer local.
Date: Tue, 16 Feb 2021 20:57:53 +0000

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.

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

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