emacs-devel
[Top][All Lists]
Advanced

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

Re: read-char, etc don't support 'face property?


From: Pavel Janík
Subject: Re: read-char, etc don't support 'face property?
Date: Sun, 20 Jan 2002 18:52:55 +0100
User-agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.2.50 (i386-suse-linux-gnu)

   From: address@hidden (Kevin A. Burton)
   Date: 19 Jan 2002 17:20:58 -0800

   > I have a function named irepeat-make-prompt that returns a string with face
   > properties.  When I insert this string in a regular buffer the colors come 
up
   > just fine.
   > 
   > (message (irepeat-make-prompt "prompt" "match"))
   > 
   > The string is displayed correctly with the correct face.
   > 
   > The only problem is that when I do:
   > 
   > (read-char (irepeat-make-prompt "prompt" "match"))
   > 
   > I don't get any faces/colors

Of course, because read-char does not use/allow text-properties in
prompt. If you change read-char into read-from-minibuffer, which uses
properties, you will see faces (well, but minibuffer-prompt-properties will
play the role here too because the whole prompt is propertized with it).

For details see lread.c:

DEFUN ("read-char", Fread_char, Sread_char, 0, 2, 0,
...
  if (! NILP (prompt))
    message_with_string ("%s", prompt, 0);
...
-- 
Pavel Janík

Each module should do one thing well.
                  --  The Elements of Programming Style (Kernighan & Plaugher)



reply via email to

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