emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] bugs in property searches?


From: Nick Dokos
Subject: Re: [O] bugs in property searches?
Date: Wed, 29 Jan 2014 00:05:45 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

John Kitchin <address@hidden> 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 <address@hidden>
| 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





reply via email to

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