From: charles@aurox.ch (Charles A. Roelli)
To: 30863@debbugs.gnu.org
Subject: bug#30863: 27.0.50: more precise register-read-with-preview
Date: Mon, 19 Mar 2018 21:00:16 +0100 [thread overview]
Message-ID: <m2po3zhm3z.fsf@aurox.ch> (raw)
The following change makes register-read-with-preview more precise
with respect to window configurations:
diff --git a/lisp/register.el b/lisp/register.el
index 77d84c0..e5aef58 100644
--- a/lisp/register.el
+++ b/lisp/register.el
@@ -390,7 +390,20 @@ describe-register-1
(cl-defmethod register-val-describe ((val cons) verbose)
(cond
((window-configuration-p (car val))
- (princ "a window configuration."))
+ (let* ((stored-window-config (car val))
+ (window-config-frame (window-configuration-frame stored-window-config))
+ (current-frame (selected-frame)))
+ (princ (format "a window configuration: %s."
+ (if (frame-live-p window-config-frame)
+ (with-selected-frame window-config-frame
+ (save-window-excursion
+ (set-window-configuration stored-window-config)
+ (concat
+ (mapconcat (lambda (w) (buffer-name (window-buffer w)))
+ (window-list (selected-frame)) ", ")
+ (unless (eq current-frame window-config-frame)
+ " in another frame"))))
+ "dead frame")))))
((frame-configuration-p (car val))
(princ "a frame configuration."))
For example, after typing "C-x r w a", then "C-x r j" in a frame with
three windows, the register preview will now show something like this,
a: window configuration: *Messages*, *scratch*, *GNU Emacs*
instead of just
a: window configuration.
It also tells whether the window configuration points to a dead frame
or a frame besides the selected one.
It would be a cleaner solution if we could easily extract the list of
buffers from any given window configuration (rather than temporarily
setting the configuration and iterating through the window-list as
above). Does anyone know how to do that?
next reply other threads:[~2018-03-19 20:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-19 20:00 Charles A. Roelli [this message]
2018-07-16 18:58 ` bug#30863: close Charles A. Roelli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2po3zhm3z.fsf@aurox.ch \
--to=charles@aurox.ch \
--cc=30863@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.