Browse Source

org-choose.el: Fix bug with checking siblings

Org-choose.el would check not only siblings but also any children of
them.

Patch by Tom Breton
Carsten Dominik 16 years ago
parent
commit
8f819da4d5
2 changed files with 12 additions and 2 deletions
  1. 5 0
      contrib/ChangeLog
  2. 7 2
      contrib/lisp/org-choose.el

+ 5 - 0
contrib/ChangeLog

@@ -1,3 +1,8 @@
+2009-02-24  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* lisp/org-choose.el (org-choose-get-fn-map-group): Only check
+	true siblings.
+
 2009-02-18  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* lisp/org-R.el: New file.

+ 7 - 2
contrib/lisp/org-choose.el

@@ -389,8 +389,13 @@ setting was changed."
 	(save-excursion
 	  (unless (org-up-heading-safe)
 	    (error "Chosing is only supported between siblings in a tree, not on top level"))
-	  (save-restriction
-	    (org-map-entries fn nil 'tree)))))
+	  (let
+ 	      ((level (org-reduced-level (org-outline-level))))
+	    (save-restriction
+	      (org-map-entries 
+	       fn
+	       (format "LEVEL=%d" level)
+	       'tree))))))
 
 ;;;_  . org-choose-get-highest-mark-index