[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/which-key 507292d 2/6: Add option (default off) to rest
From: |
ELPA Syncer |
Subject: |
[elpa] externals/which-key 507292d 2/6: Add option (default off) to restore window configuration |
Date: |
Thu, 25 Nov 2021 21:57:37 -0500 (EST) |
branch: externals/which-key
commit 507292dfde002d9d58c36034427feb8df2f421e1
Author: Frédéric Giquel <frederic.giquel@laposte.net>
Commit: Frédéric Giquel <frederic.giquel@laposte.net>
Add option (default off) to restore window configuration
---
which-key.el | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/which-key.el b/which-key.el
index 061afee..6bbe292 100644
--- a/which-key.el
+++ b/which-key.el
@@ -407,6 +407,15 @@ Note that `which-key-idle-delay' should be set before
turning on
:group 'which-key
:type 'boolean)
+(defcustom which-key-preserve-window-configuration nil
+ "If non-nil, save window configuration before which-key buffer is shown
+and restore it after which-key buffer is hidden. It prevents which-key from
+changing window position of visible buffers.
+Only takken into account when popup type is side-window."
+ :group
+ 'which-key
+ :type 'boolean)
+
(defvar which-key-C-h-map
(let ((map (make-sparse-keymap)))
(dolist (bind `(("\C-a" . which-key-abort)
@@ -1099,7 +1108,8 @@ total height."
;; 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)
- (when which-key--saved-window-configuration
+ (when (and which-key-preserve-window-configuration
+ which-key--saved-window-configuration)
(set-window-configuration which-key--saved-window-configuration)
(setq which-key--saved-window-configuration nil))))
@@ -1140,7 +1150,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
+ (when (and which-key-preserve-window-configuration
+ (not which-key--saved-window-configuration))
(setq which-key--saved-window-configuration
(current-window-configuration)))
(let* ((height (car act-popup-dim))
(width (cdr act-popup-dim))
- [elpa] externals/which-key updated (4790a14 -> 2165957), ELPA Syncer, 2021/11/25
- [elpa] externals/which-key 507292d 2/6: Add option (default off) to restore window configuration,
ELPA Syncer <=
- [elpa] externals/which-key a8da871 4/6: Merge pull request #321 from fredericgiquel/preserve-window-configuration, ELPA Syncer, 2021/11/25
- [elpa] externals/which-key 2042f11 1/6: Preserve window configuration, ELPA Syncer, 2021/11/25
- [elpa] externals/which-key 2165957 6/6: Allow binding to symbols in which-key-C-h-dispatch, ELPA Syncer, 2021/11/25
- [elpa] externals/which-key 9a3e50e 3/6: README.org: fix page flipping command names, ELPA Syncer, 2021/11/25
- [elpa] externals/which-key b73f791 5/6: Merge pull request #327 from anis-semmar/patch-1, ELPA Syncer, 2021/11/25