summaryrefslogtreecommitdiff
path: root/lisp/window.el
diff options
context:
space:
mode:
authorJuri Linkov <juri@linkov.net>2018-10-19 02:01:54 +0300
committerJuri Linkov <juri@linkov.net>2018-10-19 02:01:54 +0300
commite37825fe2a39d07320b508f66568ece67d752d48 (patch)
treef2a9c5040438c0541643661ea584d3d05de8f6da /lisp/window.el
parentf35916ce510968cf32a34cc32ebc21dd9be30443 (diff)
downloademacs-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.el28
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)