aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2019-10-28 23:55:16 +0200
committerJuri Linkov2019-10-28 23:55:16 +0200
commit4e3676726a64018cd4688d2669657878a2975f2c (patch)
tree228c9585d1c491a30a035f15bd7eafba29fbaa2d
parent2aed0430c7cbcab793782c6e24623f9a0a23fafa (diff)
downloademacs-4e3676726a64018cd4688d2669657878a2975f2c.tar.gz
emacs-4e3676726a64018cd4688d2669657878a2975f2c.zip
* lisp/tab-bar.el: Check for minibuffer-depth in tab-bar-history-mode.
* lisp/tab-bar.el (tab-bar-history--pre-change): Store also minibuffer-depth. (tab-bar-history-change): Check stored minibuffer-depth for zero. (tab-bar-history-mode): Use prefix -- for internal functions.
-rw-r--r--lisp/tab-bar.el26
1 files changed, 16 insertions, 10 deletions
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index 1151df923b7..c4763337a25 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -870,17 +870,23 @@ function `tab-bar-tab-name-function'."
870(defvar tab-bar-history-forward (make-hash-table) 870(defvar tab-bar-history-forward (make-hash-table)
871 "History of forward changes in every tab per frame.") 871 "History of forward changes in every tab per frame.")
872 872
873(defvar tab-bar-history-pre-change nil 873(defvar tab-bar-history--pre-change nil
874 "Window configuration before the current command.") 874 "Window configuration and minibuffer depth before the current command.")
875 875
876(defun tab-bar-history-pre-change () 876(defun tab-bar-history--pre-change ()
877 (setq tab-bar-history-pre-change (current-window-configuration))) 877 (setq tab-bar-history--pre-change
878 (list (current-window-configuration)
879 (minibuffer-depth))))
878 880
879(defun tab-bar-history-change () 881(defun tab-bar--history-change ()
880 (when (and (not tab-bar-history-omit) 882 (when (and (not tab-bar-history-omit)
883 tab-bar-history--pre-change
884 ;; Entering the minibuffer
885 (zerop (nth 1 tab-bar-history--pre-change))
886 ;; Exiting the minibuffer
881 (zerop (minibuffer-depth))) 887 (zerop (minibuffer-depth)))
882 (puthash (selected-frame) 888 (puthash (selected-frame)
883 (cons tab-bar-history-pre-change 889 (cons (nth 0 tab-bar-history--pre-change)
884 (gethash (selected-frame) tab-bar-history-back)) 890 (gethash (selected-frame) tab-bar-history-back))
885 tab-bar-history-back)) 891 tab-bar-history-back))
886 (when tab-bar-history-omit 892 (when tab-bar-history-omit
@@ -934,10 +940,10 @@ function `tab-bar-tab-name-function'."
934 :ascent center)) 940 :ascent center))
935 tab-bar-forward-button)) 941 tab-bar-forward-button))
936 942
937 (add-hook 'pre-command-hook 'tab-bar-history-pre-change) 943 (add-hook 'pre-command-hook 'tab-bar-history--pre-change)
938 (add-hook 'window-configuration-change-hook 'tab-bar-history-change)) 944 (add-hook 'window-configuration-change-hook 'tab-bar--history-change))
939 (remove-hook 'pre-command-hook 'tab-bar-history-pre-change) 945 (remove-hook 'pre-command-hook 'tab-bar-history--pre-change)
940 (remove-hook 'window-configuration-change-hook 'tab-bar-history-change))) 946 (remove-hook 'window-configuration-change-hook 'tab-bar--history-change)))
941 947
942 948
943;;; Short aliases 949;;; Short aliases