:link '(custom-manual "(gnus)Article Date")
:group 'gnus-article-washing)
-(eval-and-compile
- (autoload 'mail-extract-address-components "mail-extr"))
-
(defcustom gnus-save-all-headers t
"*If non-nil, don't remove any headers before saving."
:group 'gnus-article-saving
(interactive (list t))
(article-date-ut 'iso8601 highlight))
-(defun gnus-article-date-value ()
- "Return the value of the date header.
-The buffer is expected to be narrowed to just the header of the article."
- (goto-char (point-min))
- (let* ((case-fold-search t)
- (start (when (and (re-search-forward "^date:[\t\n ]+" nil t)
- (not (bolp)))
- (match-end 0))))
- (when (and start
- (re-search-forward "[\t ]*\n\\(?:[^\t ]\\|\\'\\)" nil t))
- (buffer-substring-no-properties start (match-beginning 0)))))
-
(defmacro gnus-article-save-original-date (&rest forms)
- "Save the original date as a text property."
- `(let ((date (,(symbol-function 'gnus-article-date-value))))
+ "Save the original date as a text property and evaluate FORMS."
+ `(let* ((case-fold-search t)
+ (start (progn
+ (goto-char (point-min))
+ (when (and (re-search-forward "^date:[\t\n ]+" nil t)
+ (not (bolp)))
+ (match-end 0))))
+ (date (when (and start
+ (re-search-forward "[\t ]*\n\\(?:[^\t ]\\|\\'\\)"
+ nil t))
+ (buffer-substring-no-properties start
+ (match-beginning 0)))))
(goto-char (point-max))
(skip-chars-backward "\n")
(put-text-property (point-min) (point) 'original-date date)
(setq buffer-read-only t
show-trailing-whitespace nil)
(set-syntax-table gnus-article-mode-syntax-table)
- (gnus-run-hooks 'gnus-article-mode-hook))
+ (gnus-run-mode-hooks 'gnus-article-mode-hook))
(defun gnus-article-setup-buffer ()
"Initialize the article buffer."
and `gnus-mime-delete-part', and not provided at run-time normally."
(gnus-article-edit-article
`(lambda ()
+ (buffer-disable-undo)
(erase-buffer)
(let ((mail-parse-charset (or gnus-article-charset
',gnus-newsgroup-charset))
(set-window-point window point)))
(let ((handles ihandles)
(inhibit-read-only t)
- handle date)
+ handle)
(cond (handles)
((setq handles (mm-dissect-buffer nil gnus-article-loose-mime))
(when gnus-article-emulate-mime