aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Oteiza2017-01-04 22:31:26 -0500
committerMark Oteiza2017-01-04 22:31:26 -0500
commit0392f942c787f1a42b3e5d9516a447687ed3baef (patch)
tree38da2b260cd94cc57d5099dacf7dd90e40820dc1
parent308d5962236448a84795f49d775601599688d78d (diff)
downloademacs-0392f942c787f1a42b3e5d9516a447687ed3baef.tar.gz
emacs-0392f942c787f1a42b3e5d9516a447687ed3baef.zip
Turn on lexical-binding in mb-depth.el
* lisp/mb-depth.el: Turn on lexical-binding. (minibuffer-depth-setup): Bind things used multiple times.
-rw-r--r--lisp/mb-depth.el18
1 files changed, 10 insertions, 8 deletions
diff --git a/lisp/mb-depth.el b/lisp/mb-depth.el
index a16557b0630..57fe7abde51 100644
--- a/lisp/mb-depth.el
+++ b/lisp/mb-depth.el
@@ -1,4 +1,4 @@
1;;; mb-depth.el --- Indicate minibuffer-depth in prompt 1;;; mb-depth.el --- Indicate minibuffer-depth in prompt -*- lexical-binding: t -*-
2;; 2;;
3;; Copyright (C) 2006-2017 Free Software Foundation, Inc. 3;; Copyright (C) 2006-2017 Free Software Foundation, Inc.
4;; 4;;
@@ -45,13 +45,15 @@ and must return a string.")
45(defun minibuffer-depth-setup () 45(defun minibuffer-depth-setup ()
46 "Set up a minibuffer for `minibuffer-depth-indicate-mode'. 46 "Set up a minibuffer for `minibuffer-depth-indicate-mode'.
47The prompt should already have been inserted." 47The prompt should already have been inserted."
48 (when (> (minibuffer-depth) 1) 48 (let ((depth (minibuffer-depth)))
49 (setq minibuffer-depth-overlay (make-overlay (point-min) (1+ (point-min)))) 49 (when (> depth 1)
50 (overlay-put minibuffer-depth-overlay 'before-string 50 (let ((pos (point-min)))
51 (if minibuffer-depth-indicator-function 51 (setq minibuffer-depth-overlay (make-overlay pos (1+ pos))))
52 (funcall minibuffer-depth-indicator-function (minibuffer-depth)) 52 (overlay-put minibuffer-depth-overlay 'before-string
53 (propertize (format "[%d]" (minibuffer-depth)) 'face 'highlight))) 53 (if minibuffer-depth-indicator-function
54 (overlay-put minibuffer-depth-overlay 'evaporate t))) 54 (funcall minibuffer-depth-indicator-function depth)
55 (propertize (format "[%d]" depth) 'face 'highlight)))
56 (overlay-put minibuffer-depth-overlay 'evaporate t))))
55 57
56;;;###autoload 58;;;###autoload
57(define-minor-mode minibuffer-depth-indicate-mode 59(define-minor-mode minibuffer-depth-indicate-mode