emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r115877: Make shr do line filling better when encoun


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] trunk r115877: Make shr do line filling better when encountering very long words
Date: Sun, 05 Jan 2014 10:23:38 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 115877
revision-id: address@hidden
parent: address@hidden
committer: Lars Magne Ingebrigtsen <address@hidden>
branch nick: trunk
timestamp: Sun 2014-01-05 11:23:35 +0100
message:
  Make shr do line filling better when encountering very long words
  
  (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.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/net/shr.el                shr.el-20101002102929-yfzewk55rsg0mn93-1
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-01-05 09:45:45 +0000
+++ b/lisp/ChangeLog    2014-01-05 10:23:35 +0000
@@ -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  <address@hidden>
 

=== modified file 'lisp/net/shr.el'
--- a/lisp/net/shr.el   2014-01-05 09:45:45 +0000
+++ b/lisp/net/shr.el   2014-01-05 10:23:35 +0000
@@ -475,7 +475,13 @@
          (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)))))
 


reply via email to

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