aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChong Yidong2010-12-16 10:13:28 +0800
committerChong Yidong2010-12-16 10:13:28 +0800
commit4bf3e46ed9236e0a8cfc538583c981468255357a (patch)
tree72042a04eda1210a8c7b5a54b1c9d51a50e84e06 /src
parentc1cf05f4bb18bf2ded3d1cc5991f15c2dd6ead81 (diff)
downloademacs-4bf3e46ed9236e0a8cfc538583c981468255357a.tar.gz
emacs-4bf3e46ed9236e0a8cfc538583c981468255357a.zip
* xdisp.c (Fformat_mode_line): Restrict the FACE argument to basic faces (Bug#7587).
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/xdisp.c34
2 files changed, 22 insertions, 17 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 4d1225a112e..4e56c1da05d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12010-12-16 Chong Yidong <cyd@stupidchicken.com>
2
3 * xdisp.c (Fformat_mode_line): Restrict the FACE argument to basic
4 faces (Bug#7587).
5
12010-12-13 Eli Zaretskii <eliz@gnu.org> 62010-12-13 Eli Zaretskii <eliz@gnu.org>
2 7
3 * fileio.c (Fexpand_file_name): One more doc fix. 8 * fileio.c (Fexpand_file_name): One more doc fix.
diff --git a/src/xdisp.c b/src/xdisp.c
index d3afac26a68..29a1f346b88 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -229,7 +229,7 @@ extern Lisp_Object do_mouse_tracking;
229extern int minibuffer_auto_raise; 229extern int minibuffer_auto_raise;
230extern Lisp_Object Vminibuffer_list; 230extern Lisp_Object Vminibuffer_list;
231 231
232extern Lisp_Object Qface; 232extern Lisp_Object Qface, Qdefault;
233extern Lisp_Object Qmode_line, Qmode_line_inactive, Qheader_line; 233extern Lisp_Object Qmode_line, Qmode_line_inactive, Qheader_line;
234 234
235extern Lisp_Object Voverriding_local_map; 235extern Lisp_Object Voverriding_local_map;
@@ -17883,12 +17883,13 @@ DEFUN ("format-mode-line", Fformat_mode_line, Sformat_mode_line,
17883First arg FORMAT specifies the mode line format (see `mode-line-format' 17883First arg FORMAT specifies the mode line format (see `mode-line-format'
17884for details) to use. 17884for details) to use.
17885 17885
17886Optional second arg FACE specifies the face property to put 17886Optional second arg FACE specifies the face property to put on all
17887on all characters for which no face is specified. 17887characters for which no face is specified. The value nil means the
17888The value t means whatever face the window's mode line currently uses 17888default face. The value t means whatever face the window's mode line
17889\(either `mode-line' or `mode-line-inactive', depending). 17889currently uses \(either `mode-line' or `mode-line-inactive',
17890A value of nil means the default is no face property. 17890depending). An integer value means the value string has no text
17891If FACE is an integer, the value string has no text properties. 17891properties. Otherwise, the value should be one of `default',
17892`mode-line', `mode-line-inactive', `header-line', or `tool-bar'.
17892 17893
17893Optional third and fourth args WINDOW and BUFFER specify the window 17894Optional third and fourth args WINDOW and BUFFER specify the window
17894and buffer to use as the context for the formatting (defaults 17895and buffer to use as the context for the formatting (defaults
@@ -17900,7 +17901,7 @@ are the selected window and the window's buffer). */)
17900 int len; 17901 int len;
17901 struct window *w; 17902 struct window *w;
17902 struct buffer *old_buffer = NULL; 17903 struct buffer *old_buffer = NULL;
17903 int face_id = -1; 17904 int face_id;
17904 int no_props = INTEGERP (face); 17905 int no_props = INTEGERP (face);
17905 int count = SPECPDL_INDEX (); 17906 int count = SPECPDL_INDEX ();
17906 Lisp_Object str; 17907 Lisp_Object str;
@@ -17923,15 +17924,14 @@ are the selected window and the window's buffer). */)
17923 if (no_props) 17924 if (no_props)
17924 face = Qnil; 17925 face = Qnil;
17925 17926
17926 if (!NILP (face)) 17927 face_id = (NILP (face) || EQ (face, Qdefault)) ? DEFAULT_FACE_ID
17927 { 17928 : EQ (face, Qt) ? (EQ (window, selected_window)
17928 if (EQ (face, Qt)) 17929 ? MODE_LINE_FACE_ID : MODE_LINE_INACTIVE_FACE_ID)
17929 face = (EQ (window, selected_window) ? Qmode_line : Qmode_line_inactive); 17930 : EQ (face, Qmode_line) ? MODE_LINE_FACE_ID
17930 face_id = lookup_named_face (XFRAME (WINDOW_FRAME (w)), face, 0); 17931 : EQ (face, Qmode_line_inactive) ? MODE_LINE_FACE_ID
17931 } 17932 : EQ (face, Qheader_line) ? HEADER_LINE_FACE_ID
17932 17933 : EQ (face, Qtool_bar) ? TOOL_BAR_FACE_ID
17933 if (face_id < 0) 17934 : DEFAULT_FACE_ID;
17934 face_id = DEFAULT_FACE_ID;
17935 17935
17936 if (XBUFFER (buffer) != current_buffer) 17936 if (XBUFFER (buffer) != current_buffer)
17937 old_buffer = current_buffer; 17937 old_buffer = current_buffer;