unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Miles Bader <miles.bader@necel.com>
Cc: emacs-devel@gnu.org, drew.adams@oracle.com,
	"Kim F. Storm" <storm@cua.dk>
Subject: Re: feature request: indicator of minibuffer-recursion depth
Date: Mon, 20 Mar 2006 11:39:46 +0900	[thread overview]
Message-ID: <buou09tg7pp.fsf@dhapc248.dev.necel.com> (raw)
In-Reply-To: <E1FKX2b-0003qo-Qh@fencepost.gnu.org> (Richard Stallman's message of "Sat, 18 Mar 2006 03:44:05 -0500")

Richard Stallman <rms@gnu.org> writes:
> If this uses a variable to specify the string, it does not need
> to be a mode that you can enable or disable.  You could just set
> the variable to the empty string.
>
> That makes it so simple that it ought to be installed at the C level
> and this avoid needing to use a hook.

How about this:


orig = miles@gnu.org--2006/emacs--miles--0--patch-12

M  src/minibuf.c

* modified files

--- orig/src/minibuf.c
+++ mod/src/minibuf.c
@@ -123,6 +123,13 @@
 
 int minibuffer_auto_raise;
 
+/* A string used to indicate minibuffer depths greater than one.
+   It is passed to Fformat, along with the minibuffer depth, and the
+   resulting string added before the minibuffer prompt.  If it is not a
+   string, or its length is zero, then it is ignored.  */
+
+Lisp_Object Vminibuffer_depth_indicator;
+
 /* If last completion attempt reported "Complete but not unique"
    then this is the string completed then; otherwise this is nil.  */
 
@@ -141,6 +148,9 @@
 extern Lisp_Object Qmouse_face;
 
 extern Lisp_Object Qfield;
+
+extern Lisp_Object Qbefore_string;
+
 \f
 /* Put minibuf on currently selected frame's minibuffer.
    We do this whenever the user starts a new minibuffer
@@ -717,6 +727,24 @@
       && !NILP (Vrun_hooks))
     call1 (Vrun_hooks, Qminibuffer_setup_hook);
 
+  if (minibuf_level > 1
+      && STRINGP (Vminibuffer_depth_indicator)
+      && SCHARS (Vminibuffer_depth_indicator) > 0
+      && ZV > BEGV)
+    {
+      Lisp_Object args[4];
+      Lisp_Object ov;
+
+      ov = Fmake_overlay (make_number (BEGV), make_number (BEGV + 1),
+			  Qnil, Qnil, Qnil);
+
+      Foverlay_put (ov, Qevaporate, Qt);
+
+      args[0] = Vminibuffer_depth_indicator;
+      args[1] = make_number (minibuf_level);
+      Foverlay_put (ov, Qbefore_string, Fformat (2, args));
+    }
+
   /* Don't allow the user to undo past this point.  */
   current_buffer->undo_list = Qnil;
 
@@ -2902,6 +2930,13 @@
   Vminibuffer_prompt_properties
     = Fcons (intern ("read-only"), Fcons (Qt, Qnil));
 
+  DEFVAR_LISP ("minibuffer-depth-indicator", &Vminibuffer_depth_indicator,
+	       doc: /* 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.  If it is not a
+string, or its length is zero, then it is ignored.  */);
+    Vminibuffer_depth_indicator = Qnil;
+
   defsubr (&Sset_minibuffer_window);
   defsubr (&Sread_from_minibuffer);
   defsubr (&Seval_minibuffer);





-- 
"1971 pickup truck; will trade for guns"

  reply	other threads:[~2006-03-20  2:39 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-14 17:57 feature request: indicator of minibuffer-recursion depth Drew Adams
2006-03-14 18:13 ` Masatake YAMATO
2006-03-14 18:19   ` Drew Adams
2006-03-14 21:59     ` David Kastrup
2006-03-15  9:28       ` Miles Bader
2006-03-15  9:38         ` David Kastrup
2006-03-15 10:15           ` Miles Bader
2006-03-16  2:46             ` Miles Bader
2006-03-16 16:51               ` Drew Adams
2006-03-17  2:29                 ` Miles Bader
2006-03-16 18:44               ` Edward O'Connor
2006-03-16 21:35               ` Kim F. Storm
2006-03-16 23:16                 ` Drew Adams
2006-03-16 23:39                   ` Kim F. Storm
2006-03-16 23:56                     ` Drew Adams
2006-03-17  2:37                 ` Miles Bader
2006-03-18  8:44                 ` Richard Stallman
2006-03-20  2:39                   ` Miles Bader [this message]
2006-03-21  1:01                     ` Richard Stallman
2007-06-06 11:29                     ` Juanma Barranquero
2007-06-15 14:37                       ` Kim F. Storm
2007-06-15 15:52                         ` Juanma Barranquero
2007-06-15 16:27                           ` Juri Linkov
2007-06-15 17:41                             ` Juanma Barranquero
2007-06-15 18:39                               ` Stefan Monnier
2007-06-15 18:48                                 ` Juanma Barranquero
2007-06-16 17:08                                 ` Andreas Röhler
2007-06-15 19:41                             ` Drew Adams
2007-06-15 19:47                               ` Juanma Barranquero
2007-06-15 20:42                                 ` Drew Adams
2007-06-15 23:20                                   ` Juanma Barranquero
2007-06-16  1:17                                     ` Drew Adams
2007-06-16  1:30                                       ` Juanma Barranquero
2007-06-16  5:40                                         ` Drew Adams
2007-06-16 11:32                                           ` Juanma Barranquero
2007-06-16 12:47                                             ` Juri Linkov
2007-06-16 14:36                                             ` Drew Adams
2007-06-15 22:45                             ` Richard Stallman
2007-06-15 23:10                               ` Juri Linkov
2007-06-15 23:19                                 ` Juanma Barranquero
2007-06-15 23:34                                   ` Juri Linkov
2007-06-15 23:47                                     ` Juanma Barranquero
2007-06-15 23:57                                       ` Juri Linkov
2007-06-16  0:24                                         ` Juanma Barranquero
2007-06-16 18:50                                 ` Richard Stallman
2006-07-15 23:41                 ` Drew Adams
2006-07-17  1:41                   ` Richard Stallman
2006-07-17  8:33                     ` Kim F. Storm
2006-07-17 10:01                       ` Mathias Dahl
2006-11-19  1:25                       ` Drew Adams
2006-11-19  1:52                         ` Juanma Barranquero
2006-11-19 15:48                           ` Drew Adams
2006-11-19 16:19                             ` Juanma Barranquero
2006-11-19 20:19                               ` Drew Adams
2006-11-19 22:02                                 ` Juanma Barranquero
2006-11-20  2:22                                   ` Drew Adams
2006-08-05 22:04                   ` Drew Adams
2006-03-15  9:44         ` David Kastrup
2006-03-16 10:32           ` Richard Stallman
2006-03-15 15:59         ` Drew Adams
2006-03-15 18:30           ` Stefan Monnier
2006-03-15 19:18         ` David Reitter
2006-03-15 19:52           ` Drew Adams
2006-03-17 16:32           ` Richard Stallman
2006-03-17 17:17             ` David Kastrup
2006-03-17 22:02               ` Kim F. Storm
2006-03-18 18:29               ` Richard Stallman
2006-03-17 18:06             ` Drew Adams
2006-03-18 18:30               ` Richard Stallman
2006-03-15 15:59       ` Drew Adams
2006-03-15 16:19     ` Stefan Monnier
2006-03-15 17:01       ` Drew Adams
2006-03-15 20:20 ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=buou09tg7pp.fsf@dhapc248.dev.necel.com \
    --to=miles.bader@necel.com \
    --cc=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=miles@gnu.org \
    --cc=storm@cua.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).