John Kitchin <jkitc...@andrew.cmu.edu> writes: > 1. the point moves in org-map-entries, and I thought it would not since > the documentation says the function is wrapped in save-excursion. This > lead to the results going in the wrong place. >
I can duplicate this, but I'm not sure whether it's a bug or not. The doc says that org-map-entries calls FUNC within a save-excursion, not that org-map-entries itself is wrapped. The code does (cond ((eq scope 'tree) (org-back-to-heading t) (org-narrow-to-subtree) (setq scope nil)) ...) and org-back-to-heading moves point. You can certainly wrap the calls to org-map-entries within save-excursion and that would work around the problem. Whether org-map-entries should do that internally, I don't know. The fact that 7.9.3f does not move point might indicate that this is indeed a bug. [Later...] OK, I played the git blame game and found commit 3ec38f5c: ,---- | commit 3ec38f5c064c3270f54876ba33c5ca1097b46853 | Author: Bastien Guerry <b...@altern.org> | Date: Thu Mar 14 14:40:00 2013 +0100 | | org.el (org-map-entries): Use `save-window-excursion' | | * org.el (org-map-entries): Use `save-window-excursion'. | | diff --git a/lisp/org.el b/lisp/org.el | index 66c79f5..52ae163 100644 | --- a/lisp/org.el | +++ b/lisp/org.el | @@ -14638,7 +14638,7 @@ a *different* entry, you cannot use these techniques." | ((eq match nil) (setq matcher t)) | (t (setq matcher (if match (cdr (org-make-tags-matcher match)) t)))) | | - (save-excursion | + (save-window-excursion | (save-restriction | (cond ((eq scope 'tree) | (org-back-to-heading t) `---- If I change the save-window-excursion back to a save-excursion, org-map-entries doe not move point. So I guess the ball is in Bastien's court: why was the save-excursion changed to a save-window-excursion? Should the whole thing be wrapped in a save-excursion as well? > 2. In using a PROPERTY search, headings that did not have the property > got "mapped". I can duplicate this too but haven't dug any further. -- Nick