]> git.eshelyaron.com Git - emacs.git/commitdiff
Make shr do line filling better when encountering very long words
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Sun, 5 Jan 2014 10:23:35 +0000 (11:23 +0100)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Sun, 5 Jan 2014 10:23:35 +0000 (11:23 +0100)
(shr-insert): If we have a word that's longer than `shr-width',
break after it anyway.  Otherwise we'll do no breaking once we get
such a long word.

lisp/ChangeLog
lisp/net/shr.el

index 86064cecf98ebc2e53e21b00a9c704e6cdce6a65..3b1e0451d4ed844fc44cb398f3c3264516610fce 100644 (file)
@@ -2,6 +2,9 @@
 
        * net/shr.el (shr-descend): Don't bug out if the anchor is empty
        (bug#16285).
+       (shr-insert): If we have a word that's longer than `shr-width',
+       break after it anyway.  Otherwise we'll do no breaking once we get
+       such a long word.
 
 2014-01-05  Kenjiro NAKAYAMA  <nakayamakenjiro@gmail.com>
 
index 77ebf474bc11a39568468e8d340b253bd3951d09..32715b18397e9bfd187dd5d003b853eb3fb2b70f 100644 (file)
@@ -475,7 +475,13 @@ size, and full-buffer size."
          (when (> shr-indentation 0)
            (shr-indent))
          (end-of-line))
-       (insert " ")))
+       (if (<= (current-column) shr-width)
+           (insert " ")
+         ;; In case we couldn't get a valid break point (because of a
+         ;; word that's longer than `shr-width'), just break anyway.
+         (insert "\n")
+         (when (> shr-indentation 0)
+           (shr-indent)))))
     (unless (string-match "[ \t\r\n ]\\'" text)
       (delete-char -1)))))