bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#59381: Should xref--marker-ring be per-window?


From: Dmitry Gutov
Subject: bug#59381: Should xref--marker-ring be per-window?
Date: Thu, 24 Nov 2022 05:28:59 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

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.





reply via email to

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