Kyle Meyer 4 роки тому
батько
коміт
25777d6e2c
2 змінених файлів з 8 додано та 4 видалено
  1. 2 3
      lisp/org.el
  2. 6 1
      testing/lisp/test-org.el

+ 2 - 3
lisp/org.el

@@ -20316,10 +20316,9 @@ This function also checks ancestors of the current headline,
 unless optional argument NO-INHERITANCE is non-nil."
   (cond
    ((org-before-first-heading-p) nil)
-   ((let ((tags (nth 5 (org-heading-components))))
+   ((let ((tags (org-get-tags nil 'local)))
       (and tags
-	   (let ((case-fold-search nil))
-	     (string-match-p org-archive-tag tags)))))
+	   (cl-some (apply-partially #'string= org-archive-tag) tags))))
    (no-inheritance nil)
    (t
     (save-excursion (and (org-up-heading-safe) (org-in-archived-heading-p))))))

+ 6 - 1
testing/lisp/test-org.el

@@ -2103,7 +2103,12 @@
   (should-not
    (org-test-with-temp-text "* Headline :ARCHIVE:\n** Level 2\nBody"
      (goto-char (point-max))
-     (org-in-archived-heading-p t))))
+     (org-in-archived-heading-p t)))
+   ;; Archive tag containing ARCHIVE as substring
+   (should-not
+    (org-test-with-temp-text "* Headline :NOARCHIVE:\n** Level 2\nBody"
+     (goto-char (point-max))
+     (org-in-archived-heading-p))))
 
 (ert-deftest test-org/entry-blocked-p ()
   ;; Check other dependencies.