emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/emacs-23 r100275: Fix crash with invisible


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-23 r100275: Fix crash with invisible text and overlays (Bug#7016).
Date: Mon, 06 Dec 2010 01:54:52 -0500
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 100275
committer: Chong Yidong <address@hidden>
branch nick: emacs-23
timestamp: Mon 2010-12-06 01:54:52 -0500
message:
  Fix crash with invisible text and overlays (Bug#7016).
  
  * src/dispextern.h (struct it): New member overlay_strings_charpos.
  
  * src/xdisp.c (next_overlay_string, load_overlay_strings): Record the
  charpos where we computed n_overlay_strings.
  (next_overlay_string): Load overlay strings at recorded position,
  which may not be the same as the iterator's charpos (Bug#7016).
modified:
  lisp/mail/rmail.el
  src/ChangeLog
  src/dispextern.h
  src/xdisp.c
=== modified file 'lisp/mail/rmail.el'
--- a/lisp/mail/rmail.el        2010-11-26 07:58:35 +0000
+++ b/lisp/mail/rmail.el        2010-12-06 06:54:52 +0000
@@ -4290,7 +4290,7 @@
 
 ;;;***
 
-;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" 
"4a7502b4aeb3bd5f2111b48cc6512924")
+;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" 
"222ca7c1e672a08e5799e5a72fb25049")
 ;;; Generated autoloads from rmailmm.el
 
 (autoload 'rmail-mime "rmailmm" "\
@@ -4381,7 +4381,7 @@
 
 ;;;### (autoloads (rmail-summary-by-senders rmail-summary-by-topic
 ;;;;;;  rmail-summary-by-regexp rmail-summary-by-recipients 
rmail-summary-by-labels
-;;;;;;  rmail-summary) "rmailsum" "rmailsum.el" 
"26b95919c7e1f8c5609ce7323aee77ae")
+;;;;;;  rmail-summary) "rmailsum" "rmailsum.el" 
"d855683972baef7111d4508dffbb54b6")
 ;;; Generated autoloads from rmailsum.el
 
 (autoload 'rmail-summary "rmailsum" "\

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2010-12-05 10:33:48 +0000
+++ b/src/ChangeLog     2010-12-06 06:54:52 +0000
@@ -1,3 +1,12 @@
+2010-12-06  Chong Yidong  <address@hidden>
+
+       * dispextern.h (struct it): New member overlay_strings_charpos.
+
+       * xdisp.c (next_overlay_string, load_overlay_strings): Record the
+       charpos where we computed n_overlay_strings.
+       (next_overlay_string): Load overlay strings at recorded position,
+       which may not be the same as the iterator's charpos (Bug#7016).
+
 2010-12-05  Jan Djärv  <address@hidden>
 
        * nsterm.m (ns_dumpglyphs_image): If drawing cursor, fill background

=== modified file 'src/dispextern.h'
--- a/src/dispextern.h  2010-11-04 19:35:32 +0000
+++ b/src/dispextern.h  2010-12-06 06:54:52 +0000
@@ -1989,6 +1989,12 @@
      OVERLAY_STRING_CHUNK_SIZE.  */
   int n_overlay_strings;
 
+  /* The charpos where n_overlay_strings was calculated.  This should
+     be set at the same time as n_overlay_strings.  It is needed
+     because we show before-strings at the start of invisible text;
+     see handle_invisible_prop in xdisp.c.  */
+  int overlay_strings_charpos;
+
   /* Vector of overlays to process.  Overlay strings are processed
      OVERLAY_STRING_CHUNK_SIZE at a time.  */
 #define OVERLAY_STRING_CHUNK_SIZE 16

=== modified file 'src/xdisp.c'
--- a/src/xdisp.c       2010-12-05 00:32:32 +0000
+++ b/src/xdisp.c       2010-12-06 06:54:52 +0000
@@ -4717,6 +4717,7 @@
                   && it->stop_charpos <= it->end_charpos));
       it->current.overlay_string_index = -1;
       it->n_overlay_strings = 0;
+      it->overlay_strings_charpos = -1;
 
       /* If we're at the end of the buffer, record that we have
         processed the overlay strings there already, so that
@@ -4729,11 +4730,13 @@
       /* There are more overlay strings to process.  If
         IT->current.overlay_string_index has advanced to a position
         where we must load IT->overlay_strings with more strings, do
-        it.  */
+        it.  We must load at the IT->overlay_strings_charpos where
+        IT->n_overlay_strings was originally computed; when invisible
+        text is present, this might not be IT_CHARPOS (Bug#7016).  */
       int i = it->current.overlay_string_index % OVERLAY_STRING_CHUNK_SIZE;
 
       if (it->current.overlay_string_index && i == 0)
-       load_overlay_strings (it, 0);
+       load_overlay_strings (it, it->overlay_strings_charpos);
 
       /* Initialize IT to deliver display elements from the overlay
          string.  */
@@ -4949,8 +4952,9 @@
   if (n > 1)
     qsort (entries, n, sizeof *entries, compare_overlay_entries);
 
-  /* Record the total number of strings to process.  */
+  /* Record number of overlay strings, and where we computed it.  */
   it->n_overlay_strings = n;
+  it->overlay_strings_charpos = charpos;
 
   /* IT->current.overlay_string_index is the number of overlay strings
      that have already been consumed by IT.  Copy some of the


reply via email to

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