emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/xdisp.c [lexbind]


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/src/xdisp.c [lexbind]
Date: Wed, 15 Sep 2004 20:33:15 -0400

Index: emacs/src/xdisp.c
diff -c emacs/src/xdisp.c:1.754.2.29 emacs/src/xdisp.c:1.754.2.30
*** emacs/src/xdisp.c:1.754.2.29        Sat Sep  4 09:28:15 2004
--- emacs/src/xdisp.c   Thu Sep 16 00:12:26 2004
***************
*** 10659,10664 ****
--- 10659,10665 ----
    int string_before_pos;
    int x = row->x;
    int cursor_x = x;
+   int cursor_from_overlay_pos = 0;
    int pt_old = PT - delta;
  
    /* Skip over glyphs not having an object at the start of the row.
***************
*** 10684,10689 ****
--- 10685,10696 ----
          string_start = NULL;
          x += glyph->pixel_width;
          ++glyph;
+         if (cursor_from_overlay_pos
+             && last_pos > cursor_from_overlay_pos)
+           {
+             cursor_from_overlay_pos = 0;
+             cursor = 0;
+           }
        }
        else
        {
***************
*** 10693,10702 ****
          /* Skip all glyphs from string.  */
          do
            {
              if ((cursor == NULL || glyph > cursor)
                  && !NILP (Fget_char_property (make_number ((glyph)->charpos),
!                                               Qcursor, (glyph)->object)))
                {
                  cursor = glyph;
                  cursor_x = x;
                }
--- 10700,10720 ----
          /* Skip all glyphs from string.  */
          do
            {
+             int pos;
              if ((cursor == NULL || glyph > cursor)
                  && !NILP (Fget_char_property (make_number ((glyph)->charpos),
!                                               Qcursor, (glyph)->object))
!                 && (pos = string_buffer_position (w, glyph->object,
!                                                   string_before_pos),
!                     (pos == 0   /* From overlay */
!                      || pos == pt_old)))
                {
+                 /* Estimate overlay buffer position from the buffer
+                    positions of the glyphs before and after the overlay.
+                    Add 1 to last_pos so that if point corresponds to the
+                    glyph right after the overlay, we still use a 'cursor'
+                    property found in that overlay.  */
+                 cursor_from_overlay_pos = pos == 0 ? last_pos+1 : 0;
                  cursor = glyph;
                  cursor_x = x;
                }
***************
*** 15776,15790 ****
  
  
  DEFUN ("format-mode-line", Fformat_mode_line, Sformat_mode_line,
!        0, 3, 0,
         doc: /* Return the mode-line of selected window as a string.
  First optional arg FORMAT specifies a different format string (see
  `mode-line-format' for details) to use.  If FORMAT is t, return
  the buffer's header-line.  Second optional arg WINDOW specifies a
  different window to use as the context for the formatting.
! If third optional arg NO-PROPS is non-nil, string is not propertized.  */)
!      (format, window, no_props)
!      Lisp_Object format, window, no_props;
  {
    struct it it;
    int len;
--- 15794,15809 ----
  
  
  DEFUN ("format-mode-line", Fformat_mode_line, Sformat_mode_line,
!        0, 4, 0,
         doc: /* Return the mode-line of selected window as a string.
  First optional arg FORMAT specifies a different format string (see
  `mode-line-format' for details) to use.  If FORMAT is t, return
  the buffer's header-line.  Second optional arg WINDOW specifies a
  different window to use as the context for the formatting.
! If third optional arg NO-PROPS is non-nil, string is not propertized.
! Fourth optional arg BUFFER specifies which buffer to use.  */)
!   (format, window, no_props, buffer)
!      Lisp_Object format, window, no_props, buffer;
  {
    struct it it;
    int len;
***************
*** 15796,15807 ****
      window = selected_window;
    CHECK_WINDOW (window);
    w = XWINDOW (window);
-   CHECK_BUFFER (w->buffer);
  
!   if (XBUFFER (w->buffer) != current_buffer)
      {
        old_buffer = current_buffer;
!       set_buffer_internal_1 (XBUFFER (w->buffer));
      }
  
    if (NILP (format) || EQ (format, Qt))
--- 15815,15830 ----
      window = selected_window;
    CHECK_WINDOW (window);
    w = XWINDOW (window);
  
!   if (NILP (buffer))
!     buffer = w->buffer;
! 
!   CHECK_BUFFER (buffer);
! 
!   if (XBUFFER (buffer) != current_buffer)
      {
        old_buffer = current_buffer;
!       set_buffer_internal_1 (XBUFFER (buffer));
      }
  
    if (NILP (format) || EQ (format, Qt))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]