[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/which-key 2042f11 1/6: Preserve window configuration

From: ELPA Syncer
Subject: [elpa] externals/which-key 2042f11 1/6: Preserve window configuration
Date: Thu, 25 Nov 2021 21:57:36 -0500 (EST)

branch: externals/which-key
commit 2042f11eb1c036f3e4dcf3ce447e978b9ee64357
Author: Frédéric Giquel <frederic.giquel@laposte.net>
Commit: Frédéric Giquel <frederic.giquel@laposte.net>

    Preserve window configuration
 which-key.el | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/which-key.el b/which-key.el
index 9a334cc..061afee 100644
--- a/which-key.el
+++ b/which-key.el
@@ -655,6 +655,8 @@ update.")
+(defvar which-key--saved-window-configuration nil)
 (defun which-key--rotate (list n)
   (let* ((len (length list))
          (n (if (< n 0) (+ len n) n))
@@ -1096,7 +1098,10 @@ total height."
   (when (buffer-live-p which-key--buffer)
     ;; in case which-key buffer was shown in an existing window, `quit-window'
     ;; will re-show the previous buffer, instead of closing the window
-    (quit-windows-on which-key--buffer)))
+    (quit-windows-on which-key--buffer)
+    (when which-key--saved-window-configuration
+      (set-window-configuration which-key--saved-window-configuration)
+      (setq which-key--saved-window-configuration nil))))
 (defun which-key--hide-buffer-frame ()
   "Hide which-key buffer when frame popup is used."
@@ -1135,6 +1140,8 @@ call signature in different emacs versions"
 (defun which-key--show-buffer-side-window (act-popup-dim)
   "Show which-key buffer when popup type is side-window."
+  (unless which-key--saved-window-configuration
+    (setq which-key--saved-window-configuration 
   (let* ((height (car act-popup-dim))
          (width (cdr act-popup-dim))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]