From: Mark Oteiza Date: Thu, 5 Jan 2017 03:31:26 +0000 (-0500) Subject: Turn on lexical-binding in mb-depth.el X-Git-Tag: emacs-26.0.90~937 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0392f942c787f1a42b3e5d9516a447687ed3baef;p=emacs.git Turn on lexical-binding in mb-depth.el * lisp/mb-depth.el: Turn on lexical-binding. (minibuffer-depth-setup): Bind things used multiple times. --- 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 @@ -;;; 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. ;; @@ -45,13 +45,15 @@ and must return a string.") (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 "[%d]" (minibuffer-depth)) 'face 'highlight))) - (overlay-put minibuffer-depth-overlay 'evaporate t))) + (let ((depth (minibuffer-depth))) + (when (> depth 1) + (let ((pos (point-min))) + (setq minibuffer-depth-overlay (make-overlay pos (1+ pos)))) + (overlay-put minibuffer-depth-overlay 'before-string + (if minibuffer-depth-indicator-function + (funcall minibuffer-depth-indicator-function depth) + (propertize (format "[%d]" depth) 'face 'highlight))) + (overlay-put minibuffer-depth-overlay 'evaporate t)))) ;;;###autoload (define-minor-mode minibuffer-depth-indicate-mode