Commit 0392f942 authored by Mark Oteiza's avatar Mark Oteiza

Turn on lexical-binding in mb-depth.el

* lisp/mb-depth.el: Turn on lexical-binding.
(minibuffer-depth-setup): Bind things used multiple times.
parent 308d5962
;;; 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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment