*** empty log message ***
[gnus] / lisp / article.el
index 0950d93..805f5ab 100644 (file)
@@ -29,6 +29,7 @@
 (require 'nnheader)
 (require 'gnus-util)
 (require 'message)
+(require 'gnus-sum)
 
 (defgroup article nil
   "Article display."
@@ -120,7 +121,7 @@ asynchronously.      The compressed face will be piped to this command."
 
 (defcustom gnus-emphasis-alist
   (let ((format
-        "\\(\\s-\\|^\\|[\"\(]\\)\\(%s\\(\\w+\\(\\s-+\\w+\\)*\\)%s\\)\\(\\s-\\|[?!.,;:\"\)]\\)")
+        "\\(\\s-\\|^\\|[-\"\(]\\)\\(%s\\(\\w+\\(\\s-+\\w+\\)*\\)%s\\)\\(\\s-\\|[-?!.,;:\"\)]\\)")
        (types
         '(("_" "_" underline)
           ("/" "/" italic)
@@ -232,9 +233,15 @@ is the face used for highlighting."
 (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)
@@ -526,8 +533,6 @@ always hide."
           (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)
@@ -648,7 +653,8 @@ always hide."
   "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))
@@ -791,10 +797,13 @@ If HIDE, hide the text instead."
 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 "")))
@@ -946,7 +955,7 @@ function and want to see what the date was before converting."
               (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)))))))))