comparison src/xdisp.c @ 57028:1e3f2e826c24

(Fformat_mode_line): New arg BUFFER says which buffer to use.
author Richard M. Stallman <rms@gnu.org>
date Thu, 09 Sep 2004 01:30:27 +0000
parents 01ad85e53516
children 1e7c3f7f68db cce1c0ee76ee
comparison
equal deleted inserted replaced
57027:35ae3e1a2ffe 57028:1e3f2e826c24
15792 return n; 15792 return n;
15793 } 15793 }
15794 15794
15795 15795
15796 DEFUN ("format-mode-line", Fformat_mode_line, Sformat_mode_line, 15796 DEFUN ("format-mode-line", Fformat_mode_line, Sformat_mode_line,
15797 0, 3, 0, 15797 0, 4, 0,
15798 doc: /* Return the mode-line of selected window as a string. 15798 doc: /* Return the mode-line of selected window as a string.
15799 First optional arg FORMAT specifies a different format string (see 15799 First optional arg FORMAT specifies a different format string (see
15800 `mode-line-format' for details) to use. If FORMAT is t, return 15800 `mode-line-format' for details) to use. If FORMAT is t, return
15801 the buffer's header-line. Second optional arg WINDOW specifies a 15801 the buffer's header-line. Second optional arg WINDOW specifies a
15802 different window to use as the context for the formatting. 15802 different window to use as the context for the formatting.
15803 If third optional arg NO-PROPS is non-nil, string is not propertized. */) 15803 If third optional arg NO-PROPS is non-nil, string is not propertized.
15804 (format, window, no_props) 15804 Fourth optional arg BUFFER specifies which buffer to use. */)
15805 Lisp_Object format, window, no_props; 15805 (format, window, no_props, buffer)
15806 Lisp_Object format, window, no_props, buffer;
15806 { 15807 {
15807 struct it it; 15808 struct it it;
15808 int len; 15809 int len;
15809 struct window *w; 15810 struct window *w;
15810 struct buffer *old_buffer = NULL; 15811 struct buffer *old_buffer = NULL;
15812 15813
15813 if (NILP (window)) 15814 if (NILP (window))
15814 window = selected_window; 15815 window = selected_window;
15815 CHECK_WINDOW (window); 15816 CHECK_WINDOW (window);
15816 w = XWINDOW (window); 15817 w = XWINDOW (window);
15817 CHECK_BUFFER (w->buffer); 15818
15818 15819 if (NILP (buffer))
15819 if (XBUFFER (w->buffer) != current_buffer) 15820 buffer = w->buffer;
15821
15822 CHECK_BUFFER (buffer);
15823
15824 if (XBUFFER (buffer) != current_buffer)
15820 { 15825 {
15821 old_buffer = current_buffer; 15826 old_buffer = current_buffer;
15822 set_buffer_internal_1 (XBUFFER (w->buffer)); 15827 set_buffer_internal_1 (XBUFFER (buffer));
15823 } 15828 }
15824 15829
15825 if (NILP (format) || EQ (format, Qt)) 15830 if (NILP (format) || EQ (format, Qt))
15826 { 15831 {
15827 face_id = (NILP (format) 15832 face_id = (NILP (format)