emacs-devel
[Top][All Lists]
Advanced

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

Re: Feature request : Tab-completion for 'shell-comand'


From: Juri Linkov
Subject: Re: Feature request : Tab-completion for 'shell-comand'
Date: Fri, 07 Mar 2008 01:45:45 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-unknown-linux-gnu)

>> I think that when the minibuffer is active, we should still output
>> a message, only differently (as does minibuffer-message).  Maybe just
>> using minibuffer-message (and changing it so it uses plain "message"
>> when the minibuffer is not active) would do the trick.
>
> This will require changes in a lot of places to replace `message' with
> `minibuffer-message'.
>
> But maybe `message' should take care of the active minibuffer and
> display the message at the end of the minibiffer when it is active
> using `minibuffer-message'?

I tried to run Emacs with a small patch below that modifies `message' to
call `minibuffer-message' when the minibuffer is active, and so far I see
no problems.

When I run a timer (run-at-time t 3 'message "Hello") that displays
the message every 3 sec, and activate the minibuffer, then it correctly
displays its message in the minibuffer as:

Find file: ~/ [Hello]

It also plays nicely with the completion messages by appending the
message like (after typing TAB):

Find file: ~/.emacs [Complete, but not unique] [Hello]

Here is the patch if someone wants to try:

Index: src/editfns.c
===================================================================
RCS file: /sources/emacs/emacs/src/editfns.c,v
retrieving revision 1.456
diff -u -r1.456 editfns.c
--- src/editfns.c       26 Feb 2008 16:36:52 -0000      1.456
+++ src/editfns.c       6 Mar 2008 23:45:35 -0000
@@ -3365,8 +3365,21 @@
       message (0);
       return args[0];
     }
-  else
+  else if (WINDOWP (selected_window)
+          && MINI_WINDOW_P (XWINDOW (selected_window)))
     {
+      register Lisp_Object val1, val2;
+      Lisp_Object args2[2];
+
+      val1 = Fformat (nargs, args);
+      args2[0] = build_string (" [%s]");
+      args2[1] = val1;
+      val2 = Fformat (2, args2);
+
+      temp_echo_area_glyphs (val2);
+      return val1;
+    }
+  else     {
       register Lisp_Object val;
       val = Fformat (nargs, args);
       message3 (val, SBYTES (val), STRING_MULTIBYTE (val));

-- 
Juri Linkov
http://www.jurta.org/emacs/




reply via email to

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