aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2013-12-27 03:58:16 +0100
committerLars Ingebrigtsen2013-12-27 03:58:16 +0100
commit24a6b65e905fe25355fd65a1cf1fff501ba28352 (patch)
treeaf2255aaa46c613d907a17d9a49f51835dafc435
parentac5758d16288422dc7c91f152db612deb44ff3a7 (diff)
downloademacs-24a6b65e905fe25355fd65a1cf1fff501ba28352.tar.gz
emacs-24a6b65e905fe25355fd65a1cf1fff501ba28352.zip
Fix another shr infloop in the filling code
(shr-find-fill-point): Off by one error in comparison with the indentation.
-rw-r--r--lisp/ChangeLog2
-rw-r--r--lisp/net/shr.el9
2 files changed, 7 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c764f973389..379e49dc11d 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -5,6 +5,8 @@
5 infloop. 5 infloop.
6 (shr-insert): Fill repeatedly long texts, so that Japanese is 6 (shr-insert): Fill repeatedly long texts, so that Japanese is
7 formatted correctly (bug#16263). 7 formatted correctly (bug#16263).
8 (shr-find-fill-point): Off by one error in comparison with the
9 indentation.
8 10
92013-12-26 João Távora <joaotavora@gmail.com> 112013-12-26 João Távora <joaotavora@gmail.com>
10 12
diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index a4cfdfeb0c1..1a555100a21 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -478,7 +478,7 @@ size, and full-buffer size."
478 (backward-char 1)) 478 (backward-char 1))
479 (let ((bp (point)) 479 (let ((bp (point))
480 failed) 480 failed)
481 (while (not (or (setq failed (< (current-column) shr-indentation)) 481 (while (not (or (setq failed (<= (current-column) shr-indentation))
482 (eq (preceding-char) ? ) 482 (eq (preceding-char) ? )
483 (eq (following-char) ? ) 483 (eq (following-char) ? )
484 (shr-char-breakable-p (preceding-char)) 484 (shr-char-breakable-p (preceding-char))
@@ -486,7 +486,8 @@ size, and full-buffer size."
486 (and (shr-char-kinsoku-bol-p (preceding-char)) 486 (and (shr-char-kinsoku-bol-p (preceding-char))
487 (shr-char-breakable-p (following-char)) 487 (shr-char-breakable-p (following-char))
488 (not (shr-char-kinsoku-bol-p (following-char)))) 488 (not (shr-char-kinsoku-bol-p (following-char))))
489 (shr-char-kinsoku-eol-p (following-char)))) 489 (shr-char-kinsoku-eol-p (following-char))
490 (bolp)))
490 (backward-char 1)) 491 (backward-char 1))
491 (if failed 492 (if failed
492 ;; There's no breakable point, so we give it up. 493 ;; There's no breakable point, so we give it up.
@@ -508,7 +509,7 @@ size, and full-buffer size."
508 (while (and (not (memq (preceding-char) (list ?\C-@ ?\n ? ))) 509 (while (and (not (memq (preceding-char) (list ?\C-@ ?\n ? )))
509 (shr-char-kinsoku-eol-p (preceding-char))) 510 (shr-char-kinsoku-eol-p (preceding-char)))
510 (backward-char 1)) 511 (backward-char 1))
511 (when (setq failed (< (current-column) shr-indentation)) 512 (when (setq failed (<= (current-column) shr-indentation))
512 ;; There's no breakable point that doesn't violate kinsoku, 513 ;; There's no breakable point that doesn't violate kinsoku,
513 ;; so we look for the second best position. 514 ;; so we look for the second best position.
514 (while (and (progn 515 (while (and (progn
@@ -528,7 +529,7 @@ size, and full-buffer size."
528 (not (memq (preceding-char) (list ?\C-@ ?\n ? ))) 529 (not (memq (preceding-char) (list ?\C-@ ?\n ? )))
529 (or (shr-char-kinsoku-eol-p (preceding-char)) 530 (or (shr-char-kinsoku-eol-p (preceding-char))
530 (shr-char-kinsoku-bol-p (following-char))))))) 531 (shr-char-kinsoku-bol-p (following-char)))))))
531 (when (setq failed (< (current-column) shr-indentation)) 532 (when (setq failed (<= (current-column) shr-indentation))
532 ;; There's no breakable point that doesn't violate kinsoku, 533 ;; There's no breakable point that doesn't violate kinsoku,
533 ;; so we go to the second best position. 534 ;; so we go to the second best position.
534 (if (looking-at "\\(\\c<+\\)\\c<") 535 (if (looking-at "\\(\\c<+\\)\\c<")