]> git.eshelyaron.com Git - emacs.git/commitdiff
Delete old Date header in a simple way
authorKatsumi Yamaoka <yamaoka@jpl.org>
Tue, 20 Jun 2017 09:11:07 +0000 (09:11 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Tue, 20 Jun 2017 09:11:07 +0000 (09:11 +0000)
* lisp/gnus/gnus-art.el (article-date-ut): Don't rely on text prop
when searching the old Date header boundary in order to delete it.

lisp/gnus/gnus-art.el

index 66c9fbea871602643c4e617c8c2cc25d7d47eedd..602f627d5eace74ddc4c13257903e58ac9802c77 100644 (file)
@@ -3455,9 +3455,14 @@ possible values."
              (when (looking-at "[^:]+:[\t ]*")
                (setq bface (get-text-property (match-beginning 0) 'face)
                      eface (get-text-property (match-end 0) 'face)))
-             (delete-region pos (or (text-property-any pos (point-max)
-                                                       'gnus-date-type nil)
-                                    (point-max))))
+             ;; Note: a feature like `gnus-treat-unfold-headers' breaks
+             ;; the continuity of text props of a multi-line Date header,
+             ;; that a user-defined date format might create, by adding
+             ;; spaces.  So, don't rely on gnus-date-type or original-date
+             ;; text prop in case of searching the header boundary.
+             (delete-region pos (progn
+                                  (gnus-article-forward-header)
+                                  (point))))
            (unless date ;; the 1st time
              (goto-char (point-min))
              (while (re-search-forward "^Date:[\t ]*" nil t)