diff --git a/popper-echo.el b/popper-echo.el index 33251cb..f99d48e 100644 --- a/popper-echo.el +++ b/popper-echo.el @@ -87,8 +87,8 @@ NOTE: This feature is experimental." :type 'boolean :group 'popper) -(defcustom popper-echo-dispatch-keys '("M-0" "M-1" "M-2" "M-3" "M-4" - "M-5" "M-6" "M-7" "M-8" "M-9") +(defcustom popper-echo-dispatch-keys '("M-1" "M-2" "M-3" "M-4" + "M-5" "M-6" "M-7" "M-8" "M-9" "M-0") "List of keys used for dispatching to popup buffers. The first element is bound to the currently open popup. @@ -279,21 +279,29 @@ To define buffers as popups and customize popup display, see (defun popper-tab-line--format (tab tabs) (let ((name (tab-line-tab-name-format-default tab tabs)) (idx (cl-position tab tabs))) - (concat (propertize (char-to-string (+ idx #x2460)) - 'face 'tab-line-tab-inactive) ;; #x2776 - name))) + (concat + (propertize + (char-to-string (+ idx #x2460)) ;; #x2776 + 'face (if (eq tab (current-buffer)) + (if (mode-line-window-selected-p) + 'tab-line-tab-current 'tab-line-tab) + 'tab-line-tab-inactive)) + name))) (defun popper-tab-line--ensure () - (pcase-let ((`(_ . ,buried-popups) (popper-echo--popup-info)) - (open-popup (buffer-name))) + (pcase-let ((`(_ . ,buried-popups) (popper-echo--popup-info))) (if (not buried-popups) (tab-line-mode -1) (unless tab-line-mode - (setq-local tab-line-tabs-function (lambda () (cdr (popper-echo--popup-info))) + (setq-local tab-line-tabs-function + (lambda () + (cl-sort (cons (current-buffer) (cdr (popper-echo--popup-info))) + #'string< :key #'buffer-name)) tab-line-tab-name-format-function #'popper-tab-line--format) (tab-line-mode 1))) - (popper-echo--activate-keymap (cons open-popup buried-popups) - #'popper-tab-line--ensure))) + (popper-echo--activate-keymap + (cl-sort (cons (current-buffer) buried-popups) #'string< :key #'buffer-name) + #'popper-tab-line--ensure))) ;;;###autoload (define-minor-mode popper-tab-line-mode