emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [Orgmode] Iterate over list with `org-next-item'


From: Nick Dokos
Subject: Re: [Orgmode] Iterate over list with `org-next-item'
Date: Tue, 07 Sep 2010 15:58:31 -0400

Nicolas Goaziou <address@hidden> wrote:

> > * org.el:
> >   ... 
> 
> > * org-mouse.el:
> 
> >   ...
> 
> 
> > As you can see, the second almost matches what you came up with, but
> > the condition is simpler: the code *uses* the error raised to get
> > out of the (otherwise infinite) loop, so there is no need to check
> > what org-next-item returns.
> 
> I strongly advise against using `org-next-item' in a defun. It is, in
> its actual form, meant for interactive use only.
> 
> You should have a look at `org-get-next-item' and
> `org-get-previous-item' instead. I left a note about it at line 874 in
> org-list.el (yes, I know...).
> 
> There is also `org-apply-on-list' that might be of some help.
> 

OK, thanks for the pointer: makes sense. I hadn't pulled your
reimplementation till just now. Of course, these functions didn't exist
before, so there was no choice - but maybe the few places where
org-next-item is used need to be examined and brought up to snuff, using
your new functions? Even if not strictly necessary, then at least as
examples of good practice for others to follow.

Thanks,
Nick



reply via email to

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