[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r115761: shr didn't fill Japanese text correctly any
From: |
Lars Ingebrigtsen |
Subject: |
[Emacs-diffs] trunk r115761: shr didn't fill Japanese text correctly any more |
Date: |
Fri, 27 Dec 2013 02:27:02 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 115761
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/16263
committer: Lars Ingebrigtsen <address@hidden>
branch nick: trunk
timestamp: Fri 2013-12-27 03:21:02 +0100
message:
shr didn't fill Japanese text correctly any more
* net/shr.el (shr-find-fill-point): Don't try to fill if the
indentation level is larger than the width, because that will
infloop.
(shr-insert): Fill repeatedly long texts, so that Japanese is
formatted correctly.
modified:
lisp/net/shr.el shr.el-20101002102929-yfzewk55rsg0mn93-1
=== modified file 'lisp/net/shr.el'
--- a/lisp/net/shr.el 2013-12-25 22:52:15 +0000
+++ b/lisp/net/shr.el 2013-12-27 02:21:02 +0000
@@ -455,10 +455,10 @@
(insert elem)
(setq shr-state nil)
(let (found)
- (when (and (> (current-column) shr-width)
- (progn
- (setq found (shr-find-fill-point))
- (not (eolp))))
+ (while (and (> (current-column) shr-width)
+ (progn
+ (setq found (shr-find-fill-point))
+ (not (eolp))))
(when (eq (preceding-char) ? )
(delete-char -1))
(insert "\n")
@@ -478,7 +478,7 @@
(backward-char 1))
(let ((bp (point))
failed)
- (while (not (or (setq failed (= (current-column) shr-indentation))
+ (while (not (or (setq failed (< (current-column) shr-indentation))
(eq (preceding-char) ? )
(eq (following-char) ? )
(shr-char-breakable-p (preceding-char))
@@ -496,7 +496,8 @@
(while (setq found (re-search-forward
"\\(\\c>\\)\\| \\|\\c<\\|\\c|"
(line-end-position) 'move)))
- (if (and found (not (match-beginning 1)))
+ (if (and found
+ (not (match-beginning 1)))
(goto-char (match-beginning 0)))))
(or
(eolp)
@@ -507,7 +508,7 @@
(while (and (not (memq (preceding-char) (list ?\C-@ ?\n ? )))
(shr-char-kinsoku-eol-p (preceding-char)))
(backward-char 1))
- (when (setq failed (= (current-column) shr-indentation))
+ (when (setq failed (< (current-column) shr-indentation))
;; There's no breakable point that doesn't violate kinsoku,
;; so we look for the second best position.
(while (and (progn
@@ -527,7 +528,7 @@
(not (memq (preceding-char) (list ?\C-@ ?\n ? )))
(or (shr-char-kinsoku-eol-p (preceding-char))
(shr-char-kinsoku-bol-p (following-char)))))))
- (when (setq failed (= (current-column) shr-indentation))
+ (when (setq failed (< (current-column) shr-indentation))
;; There's no breakable point that doesn't violate kinsoku,
;; so we go to the second best position.
(if (looking-at "\\(\\c<+\\)\\c<")
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r115761: shr didn't fill Japanese text correctly any more,
Lars Ingebrigtsen <=