emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Re: org-choose bugfix - whoops
@ 2009-04-09  0:05 Tom Breton (Tehom)
  2009-04-09 10:33 ` Carsten Dominik
  0 siblings, 1 reply; 2+ messages in thread
From: Tom Breton (Tehom) @ 2009-04-09  0:05 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 692 bytes --]

My previous fix was mistaken.  Not sure why it passed tests; I
have two theories.  Regardless, it was wrong.  Current
`(org-outline-level)' seems the correct "LEVEL=" matcher argument to
make `org-map-entries' find only an item's immediate children.  (Operated
on by `org-reduced-level' of course)  I don't quite understand why.

Second, I may have solved the mystery of how the bug got by me before.
`org-map-entries' used to place point at the beginning of an item, a
fact which I used to recognize visiting the same item.  That seems to
have changed between org versions.

Third, I have fixed the real bug - properly now, I hope! - and
attached a patch.

Tom Breton (Tehom)

[-- Attachment #2: org-choose.el.diff --]
[-- Type: application/octet-stream, Size: 2320 bytes --]

cd /home/tehom/emacs-site-lisp/built/org-6.25d/contrib/lisp/
diff -c /home/tehom/emacs-site-lisp/built/org-6.24c/contrib/lisp/org-choose.el /home/tehom/emacs-site-lisp/built/org-6.25d/contrib/lisp/org-choose.el
*** /home/tehom/emacs-site-lisp/built/org-6.24c/contrib/lisp/org-choose.el	2009-04-06 16:11:42.000000000 -0400
--- /home/tehom/emacs-site-lisp/built/org-6.25d/contrib/lisp/org-choose.el	2009-04-08 20:02:37.000000000 -0400
***************
*** 235,244 ****
     
     (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)
        (let
  	 ((ix
  	     (org-choose-get-entry-index keywords)))
--- 235,248 ----
     
     (unless
        ;;Skip the entry that triggered this by skipping any entry with
!       ;;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,262 ****
  
     (unless
        ;;Skip the entry that triggered this.
!       (= (point) entry-pos)
        (let
  	 ((ix
  	     (org-choose-get-entry-index keywords)))
--- 260,270 ----
  
     (unless
        ;;Skip the entry that triggered this.
!       (= 
! 	 (save-excursion
! 	    (org-back-to-heading)
! 	    (point))
! 	 entry-pos)
        (let
  	 ((ix
  	     (org-choose-get-entry-index keywords)))
***************
*** 390,396 ****
  	  (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)))))
  	    (save-restriction
  	      (org-map-entries 
  	       fn
--- 398,404 ----
  	  (unless (org-up-heading-safe)
  	    (error "Choosing is only supported between siblings in a tree, not on top level"))
  	  (let
!  	      ((level (org-reduced-level (org-outline-level))))
  	    (save-restriction
  	      (org-map-entries 
  	       fn

Diff finished at Wed Apr  8 20:02:54

[-- Attachment #3: Type: text/plain, Size: 204 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-04-09 10:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-09  0:05 org-choose bugfix - whoops Tom Breton (Tehom)
2009-04-09 10:33 ` Carsten Dominik

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).