[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/emacs-23 r100314: * xdisp.c (Fformat_mode_l
From: |
Chong Yidong |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/emacs-23 r100314: * xdisp.c (Fformat_mode_line): Restrict the FACE argument to basic faces (Bug#7587). |
Date: |
Thu, 16 Dec 2010 10:13:28 +0800 |
User-agent: |
Bazaar (2.0.3) |
------------------------------------------------------------
revno: 100314
committer: Chong Yidong <address@hidden>
branch nick: emacs-23
timestamp: Thu 2010-12-16 10:13:28 +0800
message:
* xdisp.c (Fformat_mode_line): Restrict the FACE argument to basic faces
(Bug#7587).
modified:
src/ChangeLog
src/xdisp.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2010-12-13 16:13:29 +0000
+++ b/src/ChangeLog 2010-12-16 02:13:28 +0000
@@ -1,3 +1,8 @@
+2010-12-16 Chong Yidong <address@hidden>
+
+ * xdisp.c (Fformat_mode_line): Restrict the FACE argument to basic
+ faces (Bug#7587).
+
2010-12-13 Eli Zaretskii <address@hidden>
* fileio.c (Fexpand_file_name): One more doc fix.
=== modified file 'src/xdisp.c'
--- a/src/xdisp.c 2010-12-11 12:27:13 +0000
+++ b/src/xdisp.c 2010-12-16 02:13:28 +0000
@@ -229,7 +229,7 @@
extern int minibuffer_auto_raise;
extern Lisp_Object Vminibuffer_list;
-extern Lisp_Object Qface;
+extern Lisp_Object Qface, Qdefault;
extern Lisp_Object Qmode_line, Qmode_line_inactive, Qheader_line;
extern Lisp_Object Voverriding_local_map;
@@ -17883,12 +17883,13 @@
First arg FORMAT specifies the mode line format (see `mode-line-format'
for details) to use.
-Optional second arg FACE specifies the face property to put
-on all characters for which no face is specified.
-The value t means whatever face the window's mode line currently uses
-\(either `mode-line' or `mode-line-inactive', depending).
-A value of nil means the default is no face property.
-If FACE is an integer, the value string has no text properties.
+Optional second arg FACE specifies the face property to put on all
+characters for which no face is specified. The value nil means the
+default face. The value t means whatever face the window's mode line
+currently uses \(either `mode-line' or `mode-line-inactive',
+depending). An integer value means the value string has no text
+properties. Otherwise, the value should be one of `default',
+`mode-line', `mode-line-inactive', `header-line', or `tool-bar'.
Optional third and fourth args WINDOW and BUFFER specify the window
and buffer to use as the context for the formatting (defaults
@@ -17900,7 +17901,7 @@
int len;
struct window *w;
struct buffer *old_buffer = NULL;
- int face_id = -1;
+ int face_id;
int no_props = INTEGERP (face);
int count = SPECPDL_INDEX ();
Lisp_Object str;
@@ -17923,15 +17924,14 @@
if (no_props)
face = Qnil;
- if (!NILP (face))
- {
- if (EQ (face, Qt))
- face = (EQ (window, selected_window) ? Qmode_line :
Qmode_line_inactive);
- face_id = lookup_named_face (XFRAME (WINDOW_FRAME (w)), face, 0);
- }
-
- if (face_id < 0)
- face_id = DEFAULT_FACE_ID;
+ face_id = (NILP (face) || EQ (face, Qdefault)) ? DEFAULT_FACE_ID
+ : EQ (face, Qt) ? (EQ (window, selected_window)
+ ? MODE_LINE_FACE_ID : MODE_LINE_INACTIVE_FACE_ID)
+ : EQ (face, Qmode_line) ? MODE_LINE_FACE_ID
+ : EQ (face, Qmode_line_inactive) ? MODE_LINE_FACE_ID
+ : EQ (face, Qheader_line) ? HEADER_LINE_FACE_ID
+ : EQ (face, Qtool_bar) ? TOOL_BAR_FACE_ID
+ : DEFAULT_FACE_ID;
if (XBUFFER (buffer) != current_buffer)
old_buffer = current_buffer;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/emacs-23 r100314: * xdisp.c (Fformat_mode_line): Restrict the FACE argument to basic faces (Bug#7587).,
Chong Yidong <=