Ingo Lohmar <address@hidden> writes:

> I tried to use `org-agenda-set-tags'.  The source buffer (where the
> change should be applied) is visible at the same time as the agenda is.
> Also, fast tag selection with a single key is enabled.
>
> Under these circumstances, the tag text is appended to the line (not
> even necessarily a heading!) where point is in the source buffer visible
> next to the agenda, instead of the correct heading that I acted upon.
>
> I tracked this done to a missing `save-excursion' wrapped around the
> `save-window-excursion' in `org-fast-tag-selection' (org.el line 14567
> in my version).  This would be analogous to what is done in
> `org-fast-todo-selection' and fixes my issue.


I am experiencing the same issue. Based on Ingo's analysis I made the following change which resolved the problem for me.

Thanks,
-Damian


diff --git a/lisp/org.el b/lisp/org.el
index 94713a7e5..3f2bd5758 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -12484,6 +12484,7 @@ Returns the new tags string, or nil to not change the current settings."
                   " "
                 (make-string (- org-tags-column (current-column)) ?\ ))))))
     (move-overlay org-tags-overlay ov-start ov-end)
+    (save-excursion
     (save-window-excursion
       (if expert
          (set-buffer (get-buffer-create " *Org tags*"))
@@ -12645,7 +12646,7 @@ Returns the new tags string, or nil to not change the current settings."
       (delete-overlay org-tags-overlay)
       (if rtn
          (mapconcat 'identity current ":")
-   nil))))
+        nil)))))

 (defun org-make-tag-string (tags)
   "Return string associated to TAGS.


Reply via email to