emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: feature request: indicator of minibuffer-recursion depth


From: Juanma Barranquero
Subject: Re: feature request: indicator of minibuffer-recursion depth
Date: Fri, 15 Jun 2007 21:47:16 +0200

On 6/15/07, Drew Adams <address@hidden> wrote:

I would also ask that the face used for the overlay be customizable - that
is, use a face variable that defaults to `highlight', or add a new face for
this.

Something like the following patch?

I'd like to make `minibuffer-depth-indicator' a defcustom, but I don't
see a way to allow propertizing it (other than adding a second
variable, ugh).

            Juanma



Index: lisp/mb-depth.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/mb-depth.el,v
retrieving revision 1.1
diff -u -2 -r1.1 mb-depth.el
--- lisp/mb-depth.el    15 Jun 2007 14:36:17 -0000      1.1
+++ lisp/mb-depth.el    15 Jun 2007 19:38:36 -0000
@@ -39,4 +39,9 @@
(make-variable-buffer-local 'minibuf-depth-overlay)

+(defvar minibuffer-depth-indicator (propertize "[%d]" 'face 'highlight)
+  "A string used to indicate minibuffer depths greater than one.
+It is passed to `format', along with the minibuffer depth, and the
+resulting string added before the minibuffer prompt.")
+
;; This function goes on minibuffer-setup-hook
(defun minibuf-depth-setup-minibuffer ()
@@ -46,6 +51,5 @@
    (setq minibuf-depth-overlay (make-overlay (point-min) (1+ (point-min))))
    (overlay-put minibuf-depth-overlay 'before-string
-                (propertize (format "[%d]" (minibuffer-depth))
-                            'face 'highlight))
+                (format minibuffer-depth-indicator (minibuffer-depth)))
    (overlay-put minibuf-depth-overlay 'evaporate t)))

@@ -53,7 +57,8 @@
(define-minor-mode minibuffer-indicate-depth-mode
  "Toggle Minibuffer Indicate Depth mode.
-When active, any recursive use of the minibuffer will show
-the recursion depth in the minibuffer prompt.  This is only
-useful if `enable-recursive-minibuffers' is non-nil.
+When active, any recursive use of the minibuffer will show the
+recursion depth in the minibuffer prompt by means of
+`minibuffer-depth-indicator' (which see).
+This is only useful if `enable-recursive-minibuffers' is non-nil.

With prefix argument ARG, turn on if positive, otherwise off.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]