From 075e79de4fb372027137297ec0505c6b5caec011 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Tue, 19 Jun 2018 13:44:38 +0200 Subject: [PATCH] org-archive: Do not create multiple archive subtrees * lisp/org-archive.el (org-archive-subtree): Fix regexp. Reported-by: Bernt Hansen --- lisp/org-archive.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/org-archive.el b/lisp/org-archive.el index 94579f6bf..3214d0994 100644 --- a/lisp/org-archive.el +++ b/lisp/org-archive.el @@ -325,7 +325,8 @@ direct children of this heading." (if (and heading (not (and datetree-date (not datetree-subheading-p)))) (progn (if (re-search-forward - (concat "^" (regexp-quote heading) org-tag-group-re) + (concat "^" (regexp-quote heading) + "\\([ \t]+:\\(" org-tag-re ":\\)+\\)?[ \t]*$") nil t) (goto-char (match-end 0)) ;; Heading not found, just insert it at the end