Browse Source

Fix `org-toggle-tag

* lisp/org.el (org-toggle-tag): Fix
  d777d5e0b7d288aff8b461e16f86c7590dc0b86d.

Reported-by: Josh Moller-Mara <jmm@cns.nyu.edu>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-08/msg00278.html>
Galen Menzel 8 years ago
parent
commit
10b1cfb031
1 changed files with 6 additions and 2 deletions
  1. 6 2
      lisp/org.el

+ 6 - 2
lisp/org.el

@@ -14747,8 +14747,12 @@ If ONOFF is `on' or `off', don't toggle but set to this state."
     (let ((current
 	   (when (re-search-forward "[ \t]:\\([[:alnum:]_@#%:]+\\):[ \t]*$"
 				    (line-end-position) t)
-	     (prog1 (nreverse (org-split-string (match-string 1) ":"))
-	       (replace-match ""))))
+	     (let ((tags (match-string 1)))
+	       ;; Clear current tags.
+	       (replace-match "")
+	       ;; Reverse the tags list so any new tag is appended to
+	       ;; the current list of tags.
+	       (nreverse (org-split-string tags ":")))))
 	  res)
       (pcase onoff
 	(`off (setq current (delete tag current)))