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: Nicolas Goaziou
Subject: Re: [Orgmode] Iterate over list with `org-next-item'
Date: Tue, 07 Sep 2010 22:14:50 +0200
User-agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/23.2 Mule/6.0 (HANACHIRUSATO)

>>>>> 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---



reply via email to

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