emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Bug: missing `save-excursion' in `org-fast-tag-selection' [9.2.3


From: Damian
Subject: Re: [O] Bug: missing `save-excursion' in `org-fast-tag-selection' [9.2.3 (9.2.3-9-g0803e2-elpa @ /home/il/.emacs.d/elpa/org-20190422/)]
Date: Wed, 1 May 2019 09:03:37 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

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

[Prev in Thread] Current Thread [Next in Thread]