[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Get to next NEXT headline with one key
From: |
Matt Lundin |
Subject: |
Re: [O] Get to next NEXT headline with one key |
Date: |
Fri, 07 Mar 2014 07:54:04 -0600 |
User-agent: |
Gnus/5.13001 (Ma Gnus v0.10) Emacs/24.3 (gnu/linux) |
> On Fri, Mar 7, 2014 at 7:13 AM, Giacomo M <address@hidden>
> 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 <address@hidden> writes:
> Sorry for having been ambiguous, I meant the next headline with a
> "NEXT" todo keyword.
> Thanks
Here's a very quick hack/proof of concept. There's very likely a better
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