GNU bug report logs - #59381
Should xref--marker-ring be per-window?

Previous Next

Package: emacs;

Reported by: Ackerley Tng <ackerleytng <at> gmail.com>

Date: Sat, 19 Nov 2022 09:26:02 UTC

Severity: wishlist

Done: Dmitry Gutov <dgutov <at> yandex.ru>

Bug is archived. No further changes may be made.

Full log


Message #61 received at 59381 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Ackerley Tng <ackerleytng <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 59381 <at> debbugs.gnu.org, juri <at> linkov.net
Subject: Re: bug#59381: Should xref--marker-ring be per-window?
Date: Thu, 24 Nov 2022 05:28:59 +0200
On 22/11/22 04:46, Ackerley Tng wrote:
> Here's a patch for review!

It's reasonable, but what if we turn xref-storage-type into a variable 
that gets set to a function? One that knows how to retrieve and set the 
value. E.g.:

(defcustom xref-storage-type 'xref-window-local-history
  ...)

(defun xref-window-local-history (&optional new-value)
  (let ((w (selected-window)))
    (if new-value
        (set-window-parameter w 'xref--history new-value)
      (or (window-parameter w 'xref--history)
          (cons nil nil)))))

(defun xref-global-history (&optional new-value)
  (if new-value
      (setq xref--history new-value)
    xref--history))

Then it will be trivial to extend with new storage mechanisms.

> I made 'window-local the default storage so that we would hopefully
> get more feedback, do let me know if I should leave the default as
> 'global.

That's not how we introduce changes here, with rare exceptions.

window-local storage is going to be disruptive (I'm fairly sure), so 
let's keep the current behavior as default.




This bug report was last modified 2 years and 236 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.