mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-12-03 08:30:09 +00:00
Turn on lexical-binding in mb-depth.el
* lisp/mb-depth.el: Turn on lexical-binding. (minibuffer-depth-setup): Bind things used multiple times.
This commit is contained in:
parent
308d596223
commit
0392f942c7
@ -1,4 +1,4 @@
|
|||||||
;;; mb-depth.el --- Indicate minibuffer-depth in prompt
|
;;; mb-depth.el --- Indicate minibuffer-depth in prompt -*- lexical-binding: t -*-
|
||||||
;;
|
;;
|
||||||
;; Copyright (C) 2006-2017 Free Software Foundation, Inc.
|
;; Copyright (C) 2006-2017 Free Software Foundation, Inc.
|
||||||
;;
|
;;
|
||||||
@ -45,13 +45,15 @@ and must return a string.")
|
|||||||
(defun minibuffer-depth-setup ()
|
(defun minibuffer-depth-setup ()
|
||||||
"Set up a minibuffer for `minibuffer-depth-indicate-mode'.
|
"Set up a minibuffer for `minibuffer-depth-indicate-mode'.
|
||||||
The prompt should already have been inserted."
|
The prompt should already have been inserted."
|
||||||
(when (> (minibuffer-depth) 1)
|
(let ((depth (minibuffer-depth)))
|
||||||
(setq minibuffer-depth-overlay (make-overlay (point-min) (1+ (point-min))))
|
(when (> depth 1)
|
||||||
(overlay-put minibuffer-depth-overlay 'before-string
|
(let ((pos (point-min)))
|
||||||
(if minibuffer-depth-indicator-function
|
(setq minibuffer-depth-overlay (make-overlay pos (1+ pos))))
|
||||||
(funcall minibuffer-depth-indicator-function (minibuffer-depth))
|
(overlay-put minibuffer-depth-overlay 'before-string
|
||||||
(propertize (format "[%d]" (minibuffer-depth)) 'face 'highlight)))
|
(if minibuffer-depth-indicator-function
|
||||||
(overlay-put minibuffer-depth-overlay 'evaporate t)))
|
(funcall minibuffer-depth-indicator-function depth)
|
||||||
|
(propertize (format "[%d]" depth) 'face 'highlight)))
|
||||||
|
(overlay-put minibuffer-depth-overlay 'evaporate t))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(define-minor-mode minibuffer-depth-indicate-mode
|
(define-minor-mode minibuffer-depth-indicate-mode
|
||||||
|
Loading…
Reference in New Issue
Block a user