[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [PATCHES] Minor patches for Remember, Minibuffer and Tab Bar
From: |
Drew Adams |
Subject: |
RE: [PATCHES] Minor patches for Remember, Minibuffer and Tab Bar |
Date: |
Sat, 5 Dec 2020 08:03:09 -0800 (PST) |
> This patch:
> - adds a trailing space to minibuffer depth indicator, so
> it has some distance from minibuffer prompt
> - adds a new face 'minibuffer-depth-indicator'
Time travel...2006...
https://www.emacswiki.org/emacs/download/mb-depth%2b.el
And here's (all of) the code:
(defface minibuffer-depth-indicator '((t (:inherit default)))
"Face used to indicate minibuffer depth."
:group 'convenience :group 'faces)
(defcustom minibuffer-depth-indicator-format "%d) "
"Format string for minibuffer depth indicator."
:type 'string :group 'convenience)
;; REPLACE original defined in `mb-depth.el'.
;; Use face `minibuffer-depth-indicator' and option
;; `minibuffer-depth-indicator-format'.
;;
;; This function goes on `minibuffer-setup-hook'.
;;
(defun minibuffer-depth-setup ()
"Set up a minibuffer for `minibuffer-depth-indicate-mode'.
The prompt should already have been inserted."
(when (> (minibuffer-depth) 1)
(setq minibuffer-depth-overlay
(make-overlay (point-min) (1+ (point-min))))
(overlay-put minibuffer-depth-overlay 'before-string
(if minibuffer-depth-indicator-function
(funcall minibuffer-depth-indicator-function
(minibuffer-depth))
(propertize
(format minibuffer-depth-indicator-format
(minibuffer-depth))
'face 'minibuffer-depth-indicator)))
(overlay-put minibuffer-depth-overlay 'evaporate t)))