emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master efa2b08: Delete old Date header in a simple way


From: Katsumi Yamaoka
Subject: [Emacs-diffs] master efa2b08: Delete old Date header in a simple way
Date: Tue, 20 Jun 2017 05:11:27 -0400 (EDT)

branch: master
commit efa2b08dcbf0177ef5bc21216ddd3876a9fc79e3
Author: Katsumi Yamaoka <address@hidden>
Commit: Katsumi Yamaoka <address@hidden>

    Delete old Date header in a simple way
    
    * 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 | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 66c9fbe..602f627 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]