From 84e2e1e752692c17c4b7bfb669ab181d431170e0 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Fri, 24 Apr 2015 14:28:17 +0200 Subject: [PATCH] org-element: Keep ARCHIVE tag in headline tags * lisp/org-element.el (org-element-headline-parser): Do not remove ARCHIVE tag. (org-element-headline-interpreter): Apply change. * testing/lisp/test-org-element.el (test-org-element/headline-archive-tag): Update tests. --- lisp/org-element.el | 7 +------ testing/lisp/test-org-element.el | 8 ++------ 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/lisp/org-element.el b/lisp/org-element.el index 519fedf73..0ce202c32 100644 --- a/lisp/org-element.el +++ b/lisp/org-element.el @@ -942,8 +942,6 @@ Assume point is at beginning of the headline." (skip-chars-backward " \r\t\n") (forward-line) (point))))) - ;; Clean TAGS from archive tag, if any. - (when archivedp (setq tags (delete org-archive-tag tags))) (let ((headline (list 'headline (nconc @@ -992,10 +990,7 @@ CONTENTS is the contents of the element." (priority (org-element-property :priority headline)) (title (org-element-interpret-data (org-element-property :title headline))) - (tags (let ((tag-list (if (org-element-property :archivedp headline) - (cons org-archive-tag - (org-element-property :tags headline)) - (org-element-property :tags headline)))) + (tags (let ((tag-list (org-element-property :tags headline))) (and tag-list (format ":%s:" (mapconcat #'identity tag-list ":"))))) (commentedp (org-element-property :commentedp headline)) diff --git a/testing/lisp/test-org-element.el b/testing/lisp/test-org-element.el index d68d69754..278038eb8 100644 --- a/testing/lisp/test-org-element.el +++ b/testing/lisp/test-org-element.el @@ -1020,16 +1020,12 @@ Some other text (org-test-with-temp-text "* Headline :ARCHIVE:" (let ((org-archive-tag "ARCHIVE")) (let ((headline (org-element-at-point))) - (should (org-element-property :archivedp headline)) - ;; Test tag removal. - (should-not (org-element-property :tags headline))))) + (should (org-element-property :archivedp headline))))) ;; Multiple tags. (org-test-with-temp-text "* Headline :test:ARCHIVE:" (let ((org-archive-tag "ARCHIVE")) (let ((headline (org-element-at-point))) - (should (org-element-property :archivedp headline)) - ;; Test tag removal. - (should (equal (org-element-property :tags headline) '("test")))))) + (should (org-element-property :archivedp headline))))) ;; Tag is case-sensitive. (should-not (org-test-with-temp-text "* Headline :ARCHIVE:" -- 2.11.4.GIT