Browse Source

org-archive: Do not create multiple archive subtrees

* lisp/org-archive.el (org-archive-subtree): Fix regexp.

Reported-by: Bernt Hansen <bernt@norang.ca>
<http://lists.gnu.org/r/emacs-orgmode/2018-06/msg00056.html>
Nicolas Goaziou 2 years ago
parent
commit
075e79de4f
1 changed files with 2 additions and 1 deletions
  1. 2 1
      lisp/org-archive.el

+ 2 - 1
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