+2013-12-27 Lars Ingebrigtsen <larsi@gnus.org>
+
+ * 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 (bug#16263).
+
2013-12-26 João Távora <joaotavora@gmail.com>
* electric.el (electric-pair-mode): More flexible engine for skip-
(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")
(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))
(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)
(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
(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<")