summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2015-08-07 16:42:24 +0300
committerEli Zaretskii <eliz@gnu.org>2015-08-07 16:42:24 +0300
commit701484d524835e3461f521138399893366229ae5 (patch)
tree6852c68d7aa2cf10db2a930a0995502e11dd7b94 /test
parent0aec2aaccd8b745fa7214f3edd453c04a04bfba4 (diff)
downloademacs-701484d524835e3461f521138399893366229ae5.tar.gz
Avoid infinite loop in display of invisible text in strings
* src/xdisp.c (handle_invisible_prop): If the next change of invisibility spec does not mean the beginning of a visible text, update the string position from which to start the search for the next invisibility change. This avoids an infinite loop when we have more than one invisibility spec that are made inactive by buffer-invisibility-spec. Simplify code. (Bug#21200) * test/redisplay-testsuite.el (test-redisplay-4): Add a test case for the situation that caused bug #21200.
Diffstat (limited to 'test')
-rw-r--r--test/redisplay-testsuite.el13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/redisplay-testsuite.el b/test/redisplay-testsuite.el
index 357ab08bf84..40a21b7fea4 100644
--- a/test/redisplay-testsuite.el
+++ b/test/redisplay-testsuite.el
@@ -251,6 +251,18 @@ static unsigned char x_bits[] = {0xff, 0x81, 0xbd, 0xa5, 0xa5, 0xbd, 0x81, 0xff
(str "ABC"))
(put-text-property 1 2 'invisible 'test-redisplay--ellipsis-invis str)
(overlay-put ov 'display str)))
+ ;; Overlay string with 2 adjacent and different invisible
+ ;; properties. This caused an infloop before Emacs 25.
+ (insert "\n Expected: ABC")
+ (insert "\n Result: ")
+ (let ((opoint (point)))
+ (insert "ABC\n")
+ (let ((ov (make-overlay (1+ opoint) (+ 2 opoint)))
+ (str (concat (propertize "X"
+ 'invisible 'test-redisplay--simple-invis)
+ (propertize "Y"
+ 'invisible 'test-redisplay--simple-invis2))))
+ (overlay-put ov 'after-string str)))
(insert "\n"))
@@ -264,6 +276,7 @@ static unsigned char x_bits[] = {0xff, 0x81, 0xbd, 0xa5, 0xa5, 0xbd, 0x81, 0xff
(erase-buffer)
(setq buffer-invisibility-spec
'(test-redisplay--simple-invis
+ test-redisplay--simple-invis2
(test-redisplay--ellipsis-invis . t)))
(test-redisplay-1)
(test-redisplay-2)