emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] shr-fontified 8180e53 7/9: (shr-fold-line): Keep breaking


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] shr-fontified 8180e53 7/9: (shr-fold-line): Keep breaking unbreakable text.
Date: Mon, 09 Feb 2015 10:39:10 +0000

branch: shr-fontified
commit 8180e5355ff387e2ad7366d91c2e3003faa713ff
Author: Lars Magne Ingebrigtsen <address@hidden>
Commit: Lars Magne Ingebrigtsen <address@hidden>

    (shr-fold-line): Keep breaking unbreakable text.
---
 lisp/ChangeLog  |    1 +
 lisp/net/shr.el |   14 +++++++-------
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index cec4409..fb00cd6 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -7,6 +7,7 @@
        folded.
        (shr-insert-table): Get colspan pro-rating right by distributing
        the zero-length columns in the right place.
+       (shr-fold-line): Keep breaking unbreakable text.
 
 2015-02-08  Lars Ingebrigtsen  <address@hidden>
 
diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index 3db79f0..7a0c420 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -560,16 +560,16 @@ size, and full-buffer size."
     (while (not (eolp))
       ;; We have to do some folding.  First find the first
       ;; previous point suitable for folding.
-      (shr-find-fill-point (line-beginning-position))
-      (when (= (preceding-char) ?\s)
-       (delete-char -1))
-      (if (or (bolp)
-             (= (- (point) (line-beginning-position)) 1))
-         ;; We had unbreakable text, so just give up and stop folding.
+      (if (not (shr-find-fill-point (line-beginning-position)))
+         ;; We had unbreakable text (for this width), so just go to
+         ;; the first space and carry on.
          (progn
+           (beginning-of-line)
            (shr-indent)
-           (end-of-line))
+           (search-forward " " (line-end-position) t))
        ;; Success; continue.
+       (when (= (preceding-char) ?\s)
+         (delete-char -1))
        (insert "\n")
        (shr-indent)
        (shr-vertical-motion shr-internal-width)



reply via email to

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