From: Katsumi Yamaoka Date: Thu, 11 Nov 2010 03:50:27 +0000 (+0000) Subject: shr.el (shr-insert): Don't break long line if it is because of kinsoku-bol characters... X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~45^2~298 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e7102c0aca8b0834931c8d7533ffa58654dd7655;p=emacs.git shr.el (shr-insert): Don't break long line if it is because of kinsoku-bol characters in the line end. --- diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index b1ef4be01a6..948a382bfb5 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,8 @@ +2010-11-11 Katsumi Yamaoka + + * shr.el (shr-insert): Don't break long line if it is because of + kinsoku-bol characters in the line end. + 2010-11-11 Andrew Cohen * nnir.el (nnir-request-move-article): Fix to provide original group diff --git a/lisp/gnus/shr.el b/lisp/gnus/shr.el index e0ea76c0930..88e078b066f 100644 --- a/lisp/gnus/shr.el +++ b/lisp/gnus/shr.el @@ -235,20 +235,24 @@ redirects somewhere else." (aref elem 0))))) (delete-char -1))) (insert elem) - (while (> (current-column) shr-width) - (unless (prog1 - (shr-find-fill-point) - (when (eq (preceding-char) ? ) - (delete-char -1)) - (insert "\n")) - (put-text-property (1- (point)) (point) 'shr-break t) - ;; No space is needed at the beginning of a line. - (when (eq (following-char) ? ) - (delete-char 1))) - (when (> shr-indentation 0) - (shr-indent)) - (end-of-line)) - (insert " ")) + (let (found) + (while (and (> (current-column) shr-width) + (progn + (setq found (shr-find-fill-point)) + (not (eolp)))) + (unless (prog1 + found + (when (eq (preceding-char) ? ) + (delete-char -1)) + (insert "\n")) + (put-text-property (1- (point)) (point) 'shr-break t) + ;; No space is needed at the beginning of a line. + (when (eq (following-char) ? ) + (delete-char 1))) + (when (> shr-indentation 0) + (shr-indent)) + (end-of-line)) + (insert " "))) (unless (string-match "[ \t\n]\\'" text) (delete-char -1)))))