From ae5cf0e1110241426e49f573219e9740c25bf8ea Mon Sep 17 00:00:00 2001 From: Matt Lundin Date: Thu, 7 May 2020 19:06:08 -0500 Subject: [PATCH 1/1] Fix bug that placed cursor incorrectly when setting tags * lisp/org.el: (org-set-tags-command) Only fix cursor position in very specific circumstances (i.e., when cursor is on an empty headline). --- lisp/org.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index dd017e662..0e4fd7be1 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -11846,8 +11846,9 @@ in Lisp code use `org-set-tags' instead." (org-set-tags tags))))) ;; `save-excursion' may not replace the point at the right ;; position. - (when (save-excursion (skip-chars-backward "*") (bolp)) - (forward-char)))) + (and (looking-at " ") + (string-match "\\*+" (buffer-substring (point-at-bol) (point))) + (forward-char)))) (defun org-align-tags (&optional all) "Align tags in current entry. -- 2.26.2