> On Fri, Mar 7, 2014 at 7:13 AM, Giacomo M <jackjackk@gmail.com>
> wrote:
>
> Dear all,
> I would like, by pressing the speed command N, to be brought to
> the next NEXT headline. I can see that somehow the functions
> involved could be org-match-sparse-tree and next-error, but I
> don't know how to code a programmatic execution of the two
> (unfortunately I don't speak elisp very well) into a function
> that can then be specified in the org-speed-commands-user
> customization.
>
> Is there anybody so kind to guide me to the (probably trivial)
> solution?
>
Giacomo M <jackjackk@gmail.com> writes:Here's a very quick hack/proof of concept. There's very likely a better
> Sorry for having been ambiguous, I meant the next headline with a
> "NEXT" todo keyword.
> Thanks
way to do it. This is simply to illustrate the general idea.
--8<---------------cut here---------------start------------->8---
(defun my-org-next-next ()
(interactive)
(forward-word)
(when (re-search-forward "\\*+\\s-+NEXT" nil t)
(org-reveal t))
(org-back-to-heading))
(add-to-list 'org-speed-commands-user '("N" . (org-speed-move-safe 'my-org-next-next)))
--8<---------------cut here---------------end--------------->8---
Best,
Matt