comparison src/xdisp.c @ 89971:cce1c0ee76ee

Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-36 Merge from emacs--cvs-trunk--0, emacs--gnus--5.10, gnus--rel--5.10 Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523 Merge from emacs--gnus--5.10, gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-524 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-534 Update from CVS * miles@gnu.org--gnu-2004/emacs--gnus--5.10--base-0 tag of miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-464 * miles@gnu.org--gnu-2004/emacs--gnus--5.10--patch-1 Import from CVS branch gnus-5_10-branch * miles@gnu.org--gnu-2004/emacs--gnus--5.10--patch-2 Merge from lorentey@elte.hu--2004/emacs--multi-tty--0, emacs--cvs-trunk--0 * miles@gnu.org--gnu-2004/emacs--gnus--5.10--patch-3 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--gnus--5.10--patch-4 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-18 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-19 Remove autoconf-generated files from archive * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-20 Update from CVS
author Miles Bader <miles@gnu.org>
date Thu, 09 Sep 2004 09:36:36 +0000
parents 3219f94257bc 1e3f2e826c24
children 566253900690
comparison
equal deleted inserted replaced
89970:a849e5779b8c 89971:cce1c0ee76ee
10757 int last_pos = MATRIX_ROW_START_CHARPOS (row) + delta; 10757 int last_pos = MATRIX_ROW_START_CHARPOS (row) + delta;
10758 /* The last known character position before string_start. */ 10758 /* The last known character position before string_start. */
10759 int string_before_pos; 10759 int string_before_pos;
10760 int x = row->x; 10760 int x = row->x;
10761 int cursor_x = x; 10761 int cursor_x = x;
10762 int cursor_from_overlay_pos = 0;
10762 int pt_old = PT - delta; 10763 int pt_old = PT - delta;
10763 10764
10764 /* Skip over glyphs not having an object at the start of the row. 10765 /* Skip over glyphs not having an object at the start of the row.
10765 These are special glyphs like truncation marks on terminal 10766 These are special glyphs like truncation marks on terminal
10766 frames. */ 10767 frames. */
10782 if (! STRINGP (glyph->object)) 10783 if (! STRINGP (glyph->object))
10783 { 10784 {
10784 string_start = NULL; 10785 string_start = NULL;
10785 x += glyph->pixel_width; 10786 x += glyph->pixel_width;
10786 ++glyph; 10787 ++glyph;
10788 if (cursor_from_overlay_pos
10789 && last_pos > cursor_from_overlay_pos)
10790 {
10791 cursor_from_overlay_pos = 0;
10792 cursor = 0;
10793 }
10787 } 10794 }
10788 else 10795 else
10789 { 10796 {
10790 string_before_pos = last_pos; 10797 string_before_pos = last_pos;
10791 string_start = glyph; 10798 string_start = glyph;
10792 string_start_x = x; 10799 string_start_x = x;
10793 /* Skip all glyphs from string. */ 10800 /* Skip all glyphs from string. */
10794 do 10801 do
10795 { 10802 {
10803 int pos;
10796 if ((cursor == NULL || glyph > cursor) 10804 if ((cursor == NULL || glyph > cursor)
10797 && !NILP (Fget_char_property (make_number ((glyph)->charpos), 10805 && !NILP (Fget_char_property (make_number ((glyph)->charpos),
10798 Qcursor, (glyph)->object))) 10806 Qcursor, (glyph)->object))
10807 && (pos = string_buffer_position (w, glyph->object,
10808 string_before_pos),
10809 (pos == 0 /* From overlay */
10810 || pos == pt_old)))
10799 { 10811 {
10812 /* Estimate overlay buffer position from the buffer
10813 positions of the glyphs before and after the overlay.
10814 Add 1 to last_pos so that if point corresponds to the
10815 glyph right after the overlay, we still use a 'cursor'
10816 property found in that overlay. */
10817 cursor_from_overlay_pos = pos == 0 ? last_pos+1 : 0;
10800 cursor = glyph; 10818 cursor = glyph;
10801 cursor_x = x; 10819 cursor_x = x;
10802 } 10820 }
10803 x += glyph->pixel_width; 10821 x += glyph->pixel_width;
10804 ++glyph; 10822 ++glyph;
15874 return n; 15892 return n;
15875 } 15893 }
15876 15894
15877 15895
15878 DEFUN ("format-mode-line", Fformat_mode_line, Sformat_mode_line, 15896 DEFUN ("format-mode-line", Fformat_mode_line, Sformat_mode_line,
15879 0, 3, 0, 15897 0, 4, 0,
15880 doc: /* Return the mode-line of selected window as a string. 15898 doc: /* Return the mode-line of selected window as a string.
15881 First optional arg FORMAT specifies a different format string (see 15899 First optional arg FORMAT specifies a different format string (see
15882 `mode-line-format' for details) to use. If FORMAT is t, return 15900 `mode-line-format' for details) to use. If FORMAT is t, return
15883 the buffer's header-line. Second optional arg WINDOW specifies a 15901 the buffer's header-line. Second optional arg WINDOW specifies a
15884 different window to use as the context for the formatting. 15902 different window to use as the context for the formatting.
15885 If third optional arg NO-PROPS is non-nil, string is not propertized. */) 15903 If third optional arg NO-PROPS is non-nil, string is not propertized.
15886 (format, window, no_props) 15904 Fourth optional arg BUFFER specifies which buffer to use. */)
15887 Lisp_Object format, window, no_props; 15905 (format, window, no_props, buffer)
15906 Lisp_Object format, window, no_props, buffer;
15888 { 15907 {
15889 struct it it; 15908 struct it it;
15890 int len; 15909 int len;
15891 struct window *w; 15910 struct window *w;
15892 struct buffer *old_buffer = NULL; 15911 struct buffer *old_buffer = NULL;
15894 15913
15895 if (NILP (window)) 15914 if (NILP (window))
15896 window = selected_window; 15915 window = selected_window;
15897 CHECK_WINDOW (window); 15916 CHECK_WINDOW (window);
15898 w = XWINDOW (window); 15917 w = XWINDOW (window);
15899 CHECK_BUFFER (w->buffer); 15918
15900 15919 if (NILP (buffer))
15901 if (XBUFFER (w->buffer) != current_buffer) 15920 buffer = w->buffer;
15921
15922 CHECK_BUFFER (buffer);
15923
15924 if (XBUFFER (buffer) != current_buffer)
15902 { 15925 {
15903 old_buffer = current_buffer; 15926 old_buffer = current_buffer;
15904 set_buffer_internal_1 (XBUFFER (w->buffer)); 15927 set_buffer_internal_1 (XBUFFER (buffer));
15905 } 15928 }
15906 15929
15907 if (NILP (format) || EQ (format, Qt)) 15930 if (NILP (format) || EQ (format, Qt))
15908 { 15931 {
15909 face_id = (NILP (format) 15932 face_id = (NILP (format)