emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] shr-fontified b0e3d92 3/9: (shr-fold-line): Handle lines t


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] shr-fontified b0e3d92 3/9: (shr-fold-line): Handle lines that end with a space at the fill point.
Date: Mon, 09 Feb 2015 10:39:08 +0000

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

    (shr-fold-line): Handle lines that end with a space at the fill point.
---
 lisp/ChangeLog  |    1 +
 lisp/net/shr.el |    7 +++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a92f854..821a6e0 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,6 +1,7 @@
 2015-02-09  Lars Ingebrigtsen  <address@hidden>
 
        * net/shr.el (shr-fold-line): Indent <li> properly.
+       (shr-fold-line): Handle lines that end with a space at the fill point.
 
 2015-02-08  Lars Ingebrigtsen  <address@hidden>
 
diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index 9a7febb..beea267 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -512,7 +512,6 @@ size, and full-buffer size."
       (unless (= start (point))
        ;; Mark all lines that should possibly be folded afterwards.
        (when bolp
-         (shr-indent)
          (shr-mark-fill start))
        (when shr-use-fonts
          (add-face-text-property start (point)
@@ -549,6 +548,8 @@ size, and full-buffer size."
     (shr-indent)
     (setq shr-indentation (or continuation shr-indentation))
     (shr-vertical-motion shr-internal-width)
+    (when (looking-at " $")
+      (delete-region (point) (line-end-position)))
     (while (not (eolp))
       ;; We have to do some folding.  First find the first
       ;; previous point suitable for folding.
@@ -564,7 +565,9 @@ size, and full-buffer size."
        ;; Success; continue.
        (insert "\n")
        (shr-indent)
-       (shr-vertical-motion shr-internal-width)))))
+       (shr-vertical-motion shr-internal-width)
+       (when (looking-at " $")
+         (delete-region (point) (line-end-position)))))))
 
 (defun shr-find-fill-point (start)
   (let ((bp (point))



reply via email to

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