diff --git a/lisp/org.el b/lisp/org.el index dcea52625..32fe7418f 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -11664,8 +11664,10 @@ in Lisp code use `org-set-tags' instead." nil nil (org-make-tag-string current-tags) 'org-tags-history))))))) (org-set-tags tags))))) - ;; `save-excursion' may not replace the point at the right position: - (when (looking-back "^\*+") (forward-char)))) + ;; `save-excursion' may not replace the point at the right + ;; position. + (when (save-excursion (skip-chars-backward "*") (bolp)) + (forward-char)))) (defun org-align-tags (&optional all) "Align tags in current entry.