(require 'nnheader)
(require 'gnus-util)
(require 'message)
+(require 'gnus-sum)
(defgroup article nil
"Article display."
(defcustom gnus-emphasis-alist
(let ((format
- "\\(\\s-\\|^\\|[\"\(]\\)\\(%s\\(\\w+\\(\\s-+\\w+\\)*\\)%s\\)\\(\\s-\\|[?!.,;:\"\)]\\)")
+ "\\(\\s-\\|^\\|[-\"\(]\\)\\(%s\\(\\w+\\(\\s-+\\w+\\)*\\)%s\\)\\(\\s-\\|[-?!.,;:\"\)]\\)")
(types
'(("_" "_" underline)
("/" "/" italic)
(defun article-delete-text-of-type (type)
"Delete text of TYPE in the current buffer."
(save-excursion
- (let ((b (point-min))
- (e (point-max)))
- (while (setq b (text-property-any b e 'article-type type))
+ (let ((b (point-min)))
+ (while (setq b (text-property-any b (point-max) 'article-type type))
+ (delete-region b (incf b))))))
+
+(defun article-delete-invisible-text ()
+ "Delete all invisible text in the current buffer."
+ (save-excursion
+ (let ((b (point-min)))
+ (while (setq b (text-property-any b (point-max) 'invisible t))
(delete-region b (incf b))))))
(defun article-text-type-exists-p (type)
(goto-char (point-min)) (point-max))
(subst-char-in-region (point-min) (point-max) ?_ ? )
(goto-char (point-max)))
- (when (looking-at "\\([ \t\n]+\\)=\\?")
- (replace-match "" t t nil 1))
(goto-char (point-min))))))
(defun article-de-quoted-unreadable (&optional force)
"Remove all blank lines from the beginning of the article."
(interactive)
(save-excursion
- (let (buffer-read-only)
+ (let ((inhibit-point-motion-hooks t)
+ buffer-read-only)
(goto-char (point-min))
(when (search-forward "\n\n" nil t)
(while (and (not (eobp))
If TYPE is `local', convert to local time; if it is `lapsed', output
how much time has lapsed since DATE."
(interactive (list 'ut t))
- (let* ((header (or header (message-fetch-field "date") ""))
+ (let* ((header (or header
+ (mail-header-date gnus-current-headers)
+ (message-fetch-field "date")
+ ""))
(date (if (vectorp header) (mail-header-date header)
header))
- (date-regexp "^Date: \\|^X-Sent: ")
+ (date-regexp "^Date:[ \t]\\|^X-Sent:[ \t]")
(inhibit-point-motion-hooks t)
bface eface)
(when (and date (not (string= date "")))
(match-beginning invisible) (match-end invisible) props)
(article-unhide-text-type
(match-beginning visible) (match-end visible) 'emphasis)
- (put-text-property
+ (gnus-put-text-property-excluding-newlines
(match-beginning visible) (match-end visible) 'face face)
(goto-char (match-end invisible)))))))))