aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCharles A. Roelli2018-07-16 20:57:06 +0200
committerCharles A. Roelli2018-07-16 20:57:06 +0200
commit94a16e7360b69191001bc594ab1b66f2b6bf97c2 (patch)
treee45677f82a0abd6aa640f9b85c30317f12a2c234
parentd45b2a31ca1181e8ee6d177e2e48669746ebbb79 (diff)
downloademacs-94a16e7360b69191001bc594ab1b66f2b6bf97c2.tar.gz
emacs-94a16e7360b69191001bc594ab1b66f2b6bf97c2.zip
Improve description of window configs in 'register-val-describe'
* etc/NEWS: Describe the change. * lisp/register.el (register-val-describe) [(window-configuration-p (car val))]: Include the shown buffers in the return value to make 'register-read-with-preview' more useful. (Bug#30863)
-rw-r--r--etc/NEWS4
-rw-r--r--lisp/register.el15
2 files changed, 18 insertions, 1 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 2a93bdf0253..76c19acd8c6 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -539,6 +539,10 @@ are obsoleted in GVFS.
539Tramp for some look-alike remote file names. 539Tramp for some look-alike remote file names.
540 540
541--- 541---
542** Register
543*** The return value of method 'register-val-describe' includes the
544names of buffers shown by the windows of a window configuration.
545
542** The options.el library has been removed. 546** The options.el library has been removed.
543It was obsolete since Emacs 22.1, replaced by customize. 547It was obsolete since Emacs 22.1, replaced by customize.
544 548
diff --git a/lisp/register.el b/lisp/register.el
index 3d61044c03c..e25f9fd5889 100644
--- a/lisp/register.el
+++ b/lisp/register.el
@@ -391,7 +391,20 @@ Interactively, reads the register using `register-read-with-preview'."
391(cl-defmethod register-val-describe ((val cons) verbose) 391(cl-defmethod register-val-describe ((val cons) verbose)
392 (cond 392 (cond
393 ((window-configuration-p (car val)) 393 ((window-configuration-p (car val))
394 (princ "a window configuration.")) 394 (let* ((stored-window-config (car val))
395 (window-config-frame (window-configuration-frame stored-window-config))
396 (current-frame (selected-frame)))
397 (princ (format "a window configuration: %s."
398 (if (frame-live-p window-config-frame)
399 (with-selected-frame window-config-frame
400 (save-window-excursion
401 (set-window-configuration stored-window-config)
402 (concat
403 (mapconcat (lambda (w) (buffer-name (window-buffer w)))
404 (window-list (selected-frame)) ", ")
405 (unless (eq current-frame window-config-frame)
406 " in another frame"))))
407 "dead frame")))))
395 408
396 ((frame-configuration-p (car val)) 409 ((frame-configuration-p (car val))
397 (princ "a frame configuration.")) 410 (princ "a frame configuration."))