unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#1662: 23.0.60; Interactive not using minibuffer prompt face
@ 2008-12-21 21:43 Geoff Gole
  2008-12-23  7:59 ` martin rudalics
  0 siblings, 1 reply; 7+ messages in thread
From: Geoff Gole @ 2008-12-21 21:43 UTC (permalink / raw)
  To: emacs-pretest-bug

[-- Attachment #1: Type: text/plain, Size: 1380 bytes --]

The minibuffer prompt displayed by functions that use (interactive) is
usually
highlighted with the face `minibuffer-prompt'. However, interactive specs
"c",
"k" and "K" don't do this.

To reproduce:

  emacs -Q
  M-z

Running this function shows the difference more clearly:

  (defun example-prompt (&rest args)
    (interactive "sXXXX: \ncXXXX: \nkXXXX: \nKXXXX: ")
    (ignore args))

In GNU Emacs 23.0.60.1 (i486-pc-linux-gnu, GTK+ Version 2.12.11)
 of 2008-11-22 on elegiac, modified by Debian
 (emacs-snapshot package, version 1:20081121-1)
Windowing system distributor `The X.Org Foundation', version 11.0.10402000
configured using `configure  '--build' 'i486-linux-gnu' '--host'
'i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib'
'--libexecdir=/usr/lib' '--localstatedir=/var' '--infodir=/usr/share/info'
'--mandir=/usr/share/man' '--with-pop=yes'
'--enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/23.0.60/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.0.60/site-lisp:/usr/share/emacs/site-lisp'
'--with-x=yes' '--with-x-toolkit=gtk' 'build_alias=i486-linux-gnu'
'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000
-g -O2' 'LDFLAGS=-g -Wl,--as-needed' 'CPPFLAGS=''

Also observed in GNU Emacs 22.2.1 (i486-pc-linux-gnu, X toolkit, Xaw3d
scroll bars) of 2008-11-10 on raven, modified by Debian

[-- Attachment #2: Type: text/html, Size: 1723 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#1662: 23.0.60; Interactive not using minibuffer prompt face
  2008-12-21 21:43 Geoff Gole
@ 2008-12-23  7:59 ` martin rudalics
  2008-12-23 20:45   ` Stefan Monnier
  0 siblings, 1 reply; 7+ messages in thread
From: martin rudalics @ 2008-12-23  7:59 UTC (permalink / raw)
  To: 1662

 > The minibuffer prompt displayed by functions that use (interactive) is
 > usually
 > highlighted with the face `minibuffer-prompt'. However, interactive specs
 > "c",
 > "k" and "K" don't do this.

Strictly spoken, this is not a bug.  "c" uses `read-char', "k" and "K"
use `read-key-sequence' and, by specification, neither of these use the
minibuffer.  So `minibuffer-prompt' doesn't apply here.

martin







^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#1662: 23.0.60; Interactive not using minibuffer prompt face
  2008-12-23  7:59 ` martin rudalics
@ 2008-12-23 20:45   ` Stefan Monnier
  0 siblings, 0 replies; 7+ messages in thread
From: Stefan Monnier @ 2008-12-23 20:45 UTC (permalink / raw)
  To: martin rudalics; +Cc: 1662

>> The minibuffer prompt displayed by functions that use (interactive)
>> is usually highlighted with the face `minibuffer-prompt'. However,
>> interactive specs "c", "k" and "K" don't do this.

> Strictly spoken, this is not a bug.  "c" uses `read-char', "k" and "K"
> use `read-key-sequence' and, by specification, neither of these use the
> minibuffer.  So `minibuffer-prompt' doesn't apply here.

Yes, strictly speaking, this is true, but this is taking too literal
a point of view.  I agree with the OP that we should make those
operations try to behave similarly to minibuffer ones, wrt to
prompt faces.


        Stefan









^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#1662: 23.0.60; Interactive not using minibuffer prompt face
@ 2008-12-24  5:55 Geoff Gole
  2008-12-24 10:16 ` Lennart Borgman
  2008-12-24 10:22 ` martin rudalics
  0 siblings, 2 replies; 7+ messages in thread
From: Geoff Gole @ 2008-12-24  5:55 UTC (permalink / raw)
  To: martin rudalics, monnier, 1662

> Strictly spoken, this is not a bug.  "c" uses `read-char', "k" and "K"
> use `read-key-sequence' and, by specification, neither of these use the
> minibuffer.  So `minibuffer-prompt' doesn't apply here.

That makes sense. However, I do think that highlighting prompts in the
minibuffer is a good idea even in situations where the minibuffer is
not used directly.

Isearch in emacs 23 seems to do that, so there is some precedent.






^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#1662: 23.0.60; Interactive not using minibuffer prompt face
  2008-12-24  5:55 bug#1662: 23.0.60; Interactive not using minibuffer prompt face Geoff Gole
@ 2008-12-24 10:16 ` Lennart Borgman
  2008-12-24 10:22 ` martin rudalics
  1 sibling, 0 replies; 7+ messages in thread
From: Lennart Borgman @ 2008-12-24 10:16 UTC (permalink / raw)
  To: Geoff Gole, 1662

On Wed, Dec 24, 2008 at 6:55 AM, Geoff Gole <geoffgole@gmail.com> wrote:
>> Strictly spoken, this is not a bug.  "c" uses `read-char', "k" and "K"
>> use `read-key-sequence' and, by specification, neither of these use the
>> minibuffer.  So `minibuffer-prompt' doesn't apply here.
>
> That makes sense. However, I do think that highlighting prompts in the
> minibuffer is a good idea even in situations where the minibuffer is
> not used directly.
>
> Isearch in emacs 23 seems to do that, so there is some precedent.

Yes, the purpose of the special minibuffer-prompt is to make the user
aware that input will be treated specially at the moment.






^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#1662: 23.0.60; Interactive not using minibuffer prompt face
  2008-12-24  5:55 bug#1662: 23.0.60; Interactive not using minibuffer prompt face Geoff Gole
  2008-12-24 10:16 ` Lennart Borgman
@ 2008-12-24 10:22 ` martin rudalics
  1 sibling, 0 replies; 7+ messages in thread
From: martin rudalics @ 2008-12-24 10:22 UTC (permalink / raw)
  To: Geoff Gole; +Cc: 1662

[-- Attachment #1: Type: text/plain, Size: 202 bytes --]

 > However, I do think that highlighting prompts in the
 > minibuffer is a good idea even in situations where the minibuffer is
 > not used directly.

Could you try the attached patch?

Thanks, martin.

[-- Attachment #2: prompt.diff --]
[-- Type: text/plain, Size: 2399 bytes --]

*** callint.c.~1.167.~	2008-05-14 09:49:11.000000000 +0200
--- callint.c	2008-12-24 11:09:49.859375000 +0100
***************
*** 45,50 ****
--- 45,51 ----
  
  Lisp_Object Vcommand_debug_status, Qcommand_debug_status;
  Lisp_Object Qenable_recursive_minibuffers;
+ extern Lisp_Object Qface, Qminibuffer_prompt;
  
  /* Non-nil means treat the mark as active
     even if mark_active is 0.  */
***************
*** 541,546 ****
--- 542,550 ----
  	  break;
  
          case 'c':		/* Character */
+ 	  Fput_text_property (make_number (0),
+ 			      make_number (SCHARS (callint_message)),
+ 			      Qface, Qminibuffer_prompt, callint_message);
  	  args[i] = Fread_char (callint_message, Qnil, Qnil);
  	  message1_nolog ((char *) 0);
  	  /* Passing args[i] directly stimulates compiler bug */
***************
*** 594,599 ****
--- 598,606 ----
  	  {
  	    int speccount1 = SPECPDL_INDEX ();
  	    specbind (Qcursor_in_echo_area, Qt);
+ 	    Fput_text_property (make_number (0),
+ 				make_number (SCHARS (callint_message)),
+ 				Qface, Qminibuffer_prompt, callint_message);
  	    args[i] = Fread_key_sequence (callint_message,
  					  Qnil, Qnil, Qnil, Qnil);
  	    unbind_to (speccount1, Qnil);
***************
*** 622,627 ****
--- 629,637 ----
  	  {
  	    int speccount1 = SPECPDL_INDEX ();
  	    specbind (Qcursor_in_echo_area, Qt);
+ 	    Fput_text_property (make_number (0),
+ 				make_number (SCHARS (callint_message)),
+ 				Qface, Qminibuffer_prompt, callint_message);
  	    args[i] = Fread_key_sequence (callint_message,
  					  Qnil, Qt, Qnil, Qnil);
  	    teml = args[i];

*** textprop.c.~1.163.~	2008-11-03 18:21:08.015625000 +0100
--- textprop.c	2008-12-24 11:17:14.859375000 +0100
***************
*** 57,62 ****
--- 57,63 ----
  /* Visual properties text (including strings) may have.  */
  Lisp_Object Qforeground, Qbackground, Qfont, Qunderline, Qstipple;
  Lisp_Object Qinvisible, Qread_only, Qintangible, Qmouse_face;
+ Lisp_Object Qminibuffer_prompt;
  
  /* Sticky properties */
  Lisp_Object Qfront_sticky, Qrear_nonsticky;
***************
*** 2334,2339 ****
--- 2335,2342 ----
    Qrear_nonsticky = intern ("rear-nonsticky");
    staticpro (&Qmouse_face);
    Qmouse_face = intern ("mouse-face");
+   staticpro (&Qminibuffer_prompt);
+   Qminibuffer_prompt = intern ("minibuffer-prompt");
  
    /* Properties that text might use to specify certain actions */
  

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#1662: 23.0.60; Interactive not using minibuffer prompt face
@ 2008-12-24 14:27 Geoff Gole
  0 siblings, 0 replies; 7+ messages in thread
From: Geoff Gole @ 2008-12-24 14:27 UTC (permalink / raw)
  To: martin rudalics, monnier, 1662

> Could you try the attached patch?

Thanks, that seems to fix it nicely.






^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-12-24 14:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-24  5:55 bug#1662: 23.0.60; Interactive not using minibuffer prompt face Geoff Gole
2008-12-24 10:16 ` Lennart Borgman
2008-12-24 10:22 ` martin rudalics
  -- strict thread matches above, loose matches on Subject: below --
2008-12-24 14:27 Geoff Gole
2008-12-21 21:43 Geoff Gole
2008-12-23  7:59 ` martin rudalics
2008-12-23 20:45   ` Stefan Monnier

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).