summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <carsten.dominik@gmail.com>2009-04-09 09:41:05 +0200
committerCarsten Dominik <carsten.dominik@gmail.com>2009-04-09 09:41:05 +0200
commit552b53dcd6c8ea0e1e54614bea3591b4b96725e4 (patch)
tree0e40db81378861b350da076dfa3bd8c4dbeb5105
parentadcf87073cd3de055f53a19cf724f720da19c13c (diff)
downloadorg-mode-552b53dcd6c8ea0e1e54614bea3591b4b96725e4.tar.gz
org-choose.el: Revert previous change and implement a better fix
-rw-r--r--contrib/lisp/org-choose.el20
1 files changed, 14 insertions, 6 deletions
diff --git a/contrib/lisp/org-choose.el b/contrib/lisp/org-choose.el
index ca745b9..6f7f120 100644
--- a/contrib/lisp/org-choose.el
+++ b/contrib/lisp/org-choose.el
@@ -235,10 +235,14 @@ interpretation."
(unless
;;Skip the entry that triggered this by skipping any entry with
- ;;the same starting position. Both map and plist use the start
- ;;of the header line as the position, so we can just compare
- ;;them with `='
- (= (point) entry-pos)
+ ;;the same starting position. plist uses the start of the
+ ;;header line as the position, but map no longer does, so we
+ ;;have to go back to the heading.
+ (=
+ (save-excursion
+ (org-back-to-heading)
+ (point))
+ entry-pos)
(let
((ix
(org-choose-get-entry-index keywords)))
@@ -256,7 +260,11 @@ interpretation."
(unless
;;Skip the entry that triggered this.
- (= (point) entry-pos)
+ (=
+ (save-excursion
+ (org-back-to-heading)
+ (point))
+ entry-pos)
(let
((ix
(org-choose-get-entry-index keywords)))
@@ -390,7 +398,7 @@ setting was changed."
(unless (org-up-heading-safe)
(error "Choosing is only supported between siblings in a tree, not on top level"))
(let
- ((level (1+ (org-reduced-level (org-outline-level)))))
+ ((level (org-reduced-level (org-outline-level))))
(save-restriction
(org-map-entries
fn