From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Iterate over list with `org-next-item' Date: Tue, 07 Sep 2010 22:14:50 +0200 Message-ID: <87zkvtjop1.wl%n.goaziou@gmail.com> References: <9637.1283480887@gamaville.dokosmarshall.org> <871v95l55o.wl%n.goaziou@gmail.com> <10431.1283889511@alphaville.usa.hp.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: Received: from [140.186.70.92] (port=49991 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ot4ZR-0001d7-TT for emacs-orgmode@gnu.org; Tue, 07 Sep 2010 16:15:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ot4ZQ-0007jF-Q8 for emacs-orgmode@gnu.org; Tue, 07 Sep 2010 16:15:09 -0400 Received: from mail-ww0-f49.google.com ([74.125.82.49]:33174) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ot4ZQ-0007jA-Ks for emacs-orgmode@gnu.org; Tue, 07 Sep 2010 16:15:08 -0400 Received: by wwb24 with SMTP id 24so7400518wwb.30 for ; Tue, 07 Sep 2010 13:15:07 -0700 (PDT) In-Reply-To: <10431.1283889511@alphaville.usa.hp.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: nicholas.dokos@hp.com Cc: emacs-orgmode@gnu.org >>>>> Nick Dokos writes: > 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. You are right: this should be done. Speed issues may happen otherwise. I'll look into it on Sunday. As an example, --8<---------------cut here---------------start------------->8--- (defun org-skip-over-state-notes () "Skip past the list of State notes in an entry." (if (looking-at "\n[ \t]*- State") (forward-char 1)) (while (looking-at "[ \t]*- State") (condition-case nil (org-next-item) (error (org-end-of-item))))) --8<---------------cut here---------------end--------------->8--- would become --8<---------------cut here---------------start------------->8--- (defun org-skip-over-state-notes () "Skip past the list of State notes in an entry." (if (looking-at "\n[ \t]*- State") (forward-char 1)) (if (looking-at "[ \t]*- State") (goto-char (org-list-bottom-point)))) --8<---------------cut here---------------end--------------->8---