(rfc2047-unfold-line): Ditto.
(rfc2047-fold-region): Don't fold just after the header name.
* mail-parse.el (mail-header-fold-line): New alias.
(mail-header-unfold-line): Ditto.
* gnus-art.el (gnus-body-boundary-face): Renamed.
(gnus-article-treat-body-boundary): Use it.
(gnus-article-treat-body-boundary): Use an invisible header and a
line of underline characters.
+2001-12-30 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * rfc2047.el (rfc2047-fold-line): New function.
+ (rfc2047-unfold-line): Ditto.
+ (rfc2047-fold-region): Don't fold just after the header name.
+
+ * mail-parse.el (mail-header-fold-line): New alias.
+ (mail-header-unfold-line): Ditto.
+
+ * gnus-art.el (gnus-body-boundary-face): Renamed.
+ (gnus-article-treat-body-boundary): Use it.
+ (gnus-article-treat-body-boundary): Use an invisible header and a
+ line of underline characters.
+
2001-12-30 ShengHuo ZHU <zsh@cs.rochester.edu>
* ietf-drums.el (ietf-drums-parse-addresses): Recover from errors.
"Face used for displaying highlighted words."
:group 'gnus-article-emphasis)
-(defface gnus-body-separator-face
+(defface gnus-body-boundary-face
'((((class color)
(background dark))
(:background "white")
(interactive)
(gnus-with-article-headers
(goto-char (point-max))
- (insert (make-string (1- (window-width)) ? )
+ (let ((start (point)))
+ (insert "X-Boundary: ")
+ (gnus-add-text-properties start (point) '(invisible t intangible t))
+ (insert (make-string (1- (window-width)) ?-)
"\n")
- (put-text-property (point) (progn (forward-line -1) (point))
- 'face 'gnus-body-separator-face)))
+ ;;(put-text-property (point) (progn (forward-line -1) (point))
+ ;; 'face 'gnus-body-bondary-face)
+ )))
(defun article-fill-long-lines ()
"Fill lines that are wider than the window width."
(defalias 'mail-narrow-to-head 'ietf-drums-narrow-to-header)
(defalias 'mail-quote-string 'ietf-drums-quote-string)
+(defalias 'mail-header-fold-field 'rfc2047-fold-field)
+(defalias 'mail-header-unfold-field 'rfc2047-unfold-field)
(defalias 'mail-header-narrow-to-field 'rfc2047-narrow-to-field)
+
(defalias 'mail-encode-encoded-word-region 'rfc2047-encode-region)
(defalias 'mail-encode-encoded-word-buffer 'rfc2047-encode-message-header)
(defalias 'mail-encode-encoded-word-string 'rfc2047-encode-string)
(insert "?=")
(forward-line 1)))))
+(defun rfc2047-fold-field ()
+ "Fold the current line."
+ (save-excursion
+ (save-restriction
+ (rfc2047-narrow-to-field)
+ (rfc2047-fold-region (point-min) (point-max)))))
+
(defun rfc2047-fold-region (b e)
"Fold long lines in region B to E."
(save-restriction
(goto-char (point-min))
(let ((break nil)
(qword-break nil)
+ (first t)
(bol (save-restriction
(widen)
(gnus-point-at-bol))))
(while (not (eobp))
- (when (and (or break qword-break) (> (- (point) bol) 76))
+ (when (and (or break qword-break)
+ (> (- (point) bol) 76))
(goto-char (or break qword-break))
(setq break nil
qword-break nil)
(setq bol (1- (point)))
;; Don't break before the first non-LWSP characters.
(skip-chars-forward " \t")
- (unless (eobp) (forward-char 1)))
+ (unless (eobp)
+ (forward-char 1)))
(cond
((eq (char-after) ?\n)
(forward-char 1)
(forward-char 1))
((memq (char-after) '(? ?\t))
(skip-chars-forward " \t")
- (setq break (1- (point))))
+ (if first
+ ;; Don't break just after the header name.
+ (setq first nil)
+ (setq break (1- (point)))))
((not break)
(if (not (looking-at "=\\?[^=]"))
(if (eq (char-after) ?=)
(skip-chars-forward "^ \t\n\r")))
(t
(skip-chars-forward "^ \t\n\r"))))
- (when (and (or break qword-break) (> (- (point) bol) 76))
+ (when (and (or break qword-break)
+ (> (- (point) bol) 76))
(goto-char (or break qword-break))
(setq break nil
qword-break nil)
(setq bol (1- (point)))
;; Don't break before the first non-LWSP characters.
(skip-chars-forward " \t")
- (unless (eobp) (forward-char 1))))))
+ (unless (eobp)
+ (forward-char 1))))))
+
+(defun rfc2047-unfold-field ()
+ "Fold the current line."
+ (save-excursion
+ (save-restriction
+ (rfc2047-narrow-to-field)
+ (rfc2047-unfold-region (point-min) (point-max)))))
(defun rfc2047-unfold-region (b e)
"Unfold lines in region B to E."