diff options
author | Juri Linkov <juri@linkov.net> | 2018-10-19 02:01:54 +0300 |
---|---|---|
committer | Juri Linkov <juri@linkov.net> | 2018-10-19 02:01:54 +0300 |
commit | e37825fe2a39d07320b508f66568ece67d752d48 (patch) | |
tree | f2a9c5040438c0541643661ea584d3d05de8f6da /lisp/window.el | |
parent | f35916ce510968cf32a34cc32ebc21dd9be30443 (diff) | |
download | emacs-e37825fe2a39d07320b508f66568ece67d752d48.tar.gz |
Use buffer objects for non-writable states in window-state-get.
* lisp/window.el (window--state-get-1): Use buffer objects for
buffer, next-buffers, prev-buffers if 'writable' is nil. (Bug#32850)
Diffstat (limited to 'lisp/window.el')
-rw-r--r-- | lisp/window.el | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/lisp/window.el b/lisp/window.el index 47dbf0e1c86..e7f54cee56a 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -5584,7 +5584,7 @@ specific buffers." (let ((point (window-point window)) (start (window-start window))) `((buffer - ,(buffer-name buffer) + ,(if writable (buffer-name buffer) buffer) (selected . ,selected) (hscroll . ,(window-hscroll window)) (fringes . ,(window-fringes window)) @@ -5604,20 +5604,20 @@ specific buffers." (with-current-buffer buffer (copy-marker start)))))))) ,@(when next-buffers - `((next-buffers . ,(mapcar (lambda (buffer) - (buffer-name buffer)) - next-buffers)))) + `((next-buffers + . ,(if writable + (mapcar (lambda (buffer) (buffer-name buffer)) + next-buffers) + next-buffers)))) ,@(when prev-buffers - `((prev-buffers . - ,(mapcar (lambda (entry) - (list (buffer-name (nth 0 entry)) - (if writable - (marker-position (nth 1 entry)) - (nth 1 entry)) - (if writable - (marker-position (nth 2 entry)) - (nth 2 entry)))) - prev-buffers)))))) + `((prev-buffers + . ,(if writable + (mapcar (lambda (entry) + (list (buffer-name (nth 0 entry)) + (marker-position (nth 1 entry)) + (marker-position (nth 2 entry)))) + prev-buffers) + prev-buffers)))))) (tail (when (memq type '(vc hc)) (let (list) |