/[emacs]/emacs/src/xdisp.c
ViewVC logotype

Diff of /emacs/src/xdisp.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.960 by kfstorm, Mon Jan 10 13:34:53 2005 UTC revision 1.961 by rms, Wed Jan 12 05:06:46 2005 UTC
# Line 15978  store_mode_line_string (string, lisp_str Line 15978  store_mode_line_string (string, lisp_str
15978    
15979    
15980  DEFUN ("format-mode-line", Fformat_mode_line, Sformat_mode_line,  DEFUN ("format-mode-line", Fformat_mode_line, Sformat_mode_line,
15981         1, 4, 0,         1, 5, 0,
15982         doc: /* Return the mode-line of selected window as a string.         doc: /* Return the mode-line of selected window as a string.
15983  First arg FORMAT specifies the mode line format (see `mode-line-format' for  First arg FORMAT specifies the mode line format (see `mode-line-format' for
15984  details) to use.  Second optional arg WINDOW specifies a different window to  details) to use.  Second (optional) arg WINDOW specifies the window to
15985  use as the context for the formatting.  If third optional arg NO-PROPS is  use as the context for the formatting (default is the selected window).
15986  non-nil, string is not propertized.  Fourth optional arg BUFFER specifies  
15987  which buffer to use.  */)  If third (optional) arg NO-PROPS is non-nil, the value string has
15988    (format, window, no_props, buffer)  no text properties.  The fourth (optional) arg BUFFER specifies
15989       Lisp_Object format, window, no_props, buffer;  which buffer to use (default, the current buffer).
15990    
15991    Fifth (optional) arg FACE specifies the face property to put
15992    on all characters for which no face is specified.
15993    t means whatever face the window's mode line currently uses
15994    \(either `mode-line' or `mode-line-inactive', depending).
15995    nil means the default is no face property.  */)
15996      (format, window, no_props, buffer, face)
15997         Lisp_Object format, window, no_props, buffer, face;
15998  {  {
15999    struct it it;    struct it it;
16000    int len;    int len;
16001    struct window *w;    struct window *w;
16002    struct buffer *old_buffer = NULL;    struct buffer *old_buffer = NULL;
16003    enum face_id face_id = DEFAULT_FACE_ID;    enum face_id face_id;
16004    
16005    if (NILP (window))    if (NILP (window))
16006      window = selected_window;      window = selected_window;
16007    CHECK_WINDOW (window);    CHECK_WINDOW (window);
16008    w = XWINDOW (window);    w = XWINDOW (window);
16009    
16010      if (EQ (face, Qt))
16011        face = (EQ (window, selected_window) ? Qmode_line : Qmode_line_inactive);
16012    
16013      if (!NILP (face))
16014        {
16015          Lisp_Object tem = Fget (face, Qface);
16016          if (INTEGERP (tem))
16017            face_id = XINT (tem);
16018          else
16019            {
16020              face = Qnil;
16021              face_id = DEFAULT_FACE_ID;
16022            }
16023        }
16024    
16025    if (NILP (buffer))    if (NILP (buffer))
16026      buffer = w->buffer;      buffer = w->buffer;
16027    
# Line 16010  which buffer to use.  */) Line 16033  which buffer to use.  */)
16033        set_buffer_internal_1 (XBUFFER (buffer));        set_buffer_internal_1 (XBUFFER (buffer));
16034      }      }
16035    
16036      if (NILP (format) || EQ (format, Qt))
16037        face_id = (NILP (format)
16038                   ? CURRENT_MODE_LINE_FACE_ID (w)
16039                   : HEADER_LINE_FACE_ID);
16040    
16041    init_iterator (&it, w, -1, -1, NULL, face_id);    init_iterator (&it, w, -1, -1, NULL, face_id);
16042    
16043    if (NILP (no_props))    if (NILP (no_props))
16044      {      {
16045        mode_line_string_face        mode_line_string_face = face;
         = (face_id == MODE_LINE_FACE_ID ? Qmode_line  
            : face_id == MODE_LINE_INACTIVE_FACE_ID ? Qmode_line_inactive  
            : face_id == HEADER_LINE_FACE_ID ? Qheader_line : Qnil);  
16046    
16047        mode_line_string_face_prop        mode_line_string_face_prop
16048          = (NILP (mode_line_string_face) ? Qnil          = (NILP (mode_line_string_face) ? Qnil

Legend:
Removed from v.1.960  
changed lines
  Added in v.1.961

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26