From 4733bb302f384acfb6a05aa2d47b2b486e7ef238 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Mon, 2 May 2022 14:42:51 +0100 Subject: [PATCH] el/dot-emacs.el (mdw-switch-window-configuration): Print a message afterwards. --- el/dot-emacs.el | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/el/dot-emacs.el b/el/dot-emacs.el index 09b7708..9088736 100644 --- a/el/dot-emacs.el +++ b/el/dot-emacs.el @@ -319,13 +319,17 @@ prevailing configuration." (or (and (consp arg) (= (car arg) 4) (= (car arg) 64)) (and (integerp arg) (not (zerop (logand arg 1)))))))) - (let ((current-windows (list (current-window-configuration) + (let ((previous mdw-current-window-configuration) + (current-windows (list (current-window-configuration) (point-marker))) (register-value (and register (get-register register)))) (when (and mdw-current-window-configuration (not no-save)) (set-register mdw-current-window-configuration current-windows)) (cond ((null register) - (setq mdw-current-window-configuration nil)) + (setq mdw-current-window-configuration nil) + (if previous + (message "Left window configuration `%c'." previous) + (message "Nothing to do!"))) ((not (or (null register-value) (and (consp register-value) (window-configuration-p (car register-value)) @@ -334,10 +338,14 @@ prevailing configuration." (error "Register `%c' is not a window configuration" register)) (t (cond ((null register-value) - (set-register register current-windows)) + (set-register register current-windows) + (message "Started new window configuration `%c'." + register)) (t (set-window-configuration (car register-value)) - (goto-char (cadr register-value)))) + (goto-char (cadr register-value)) + (message "Switched to window configuration `%c'." + register))) (setq mdw-current-window-configuration register))))) ;; Don't raise windows unless I say so. -- 2.11.0