summaryrefslogtreecommitdiff
path: root/lisp/gnus/shr.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/gnus/shr.el')
-rw-r--r--lisp/gnus/shr.el21
1 files changed, 7 insertions, 14 deletions
diff --git a/lisp/gnus/shr.el b/lisp/gnus/shr.el
index 8a0e814bca3..119fd97edc0 100644
--- a/lisp/gnus/shr.el
+++ b/lisp/gnus/shr.el
@@ -219,8 +219,8 @@ redirects somewhere else."
(unless shr-start
(setq shr-start (point)))
(insert elem)
- (when (> (shr-current-column) shr-width)
- (if (not (search-backward " " (line-beginning-position) t))
+ (while (> (current-column) shr-width)
+ (if (not (shr-find-fill-point))
(insert "\n")
(delete-char 1)
(insert "\n")
@@ -235,23 +235,16 @@ redirects somewhere else."
(defun shr-find-fill-point ()
(let ((found nil))
(while (and (not found)
- (not (bolp)))
- (when (or (eq (preceding-char) ? )
- (aref fill-find-break-point-function-table (preceding-char)))
+ (> (current-column) shr-indentation))
+ (when (and (or (eq (preceding-char) ? )
+ (aref fill-find-break-point-function-table
+ (preceding-char)))
+ (<= (current-column) shr-width))
(setq found (point)))
(backward-char 1))
(or found
(end-of-line))))
-(defun shr-current-column ()
- (let ((column 0))
- (save-excursion
- (beginning-of-line)
- (while (not (eolp))
- (incf column (char-width (following-char)))
- (forward-char 1)))
- column))
-
(defun shr-ensure-newline ()
(unless (zerop (current-column))
(insert "\n")))