From: Giacomo M <jackjackk@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Get to next NEXT headline with one key
Date: Fri, 7 Mar 2014 15:28:51 +0100 [thread overview]
Message-ID: <CA+GKSr4t3aSHwA47QUWKz3t_pzEcQCVgQ75bxskHDuFfge7tkA@mail.gmail.com> (raw)
In-Reply-To: <87k3c6glmr.fsf@fastmail.fm>
[-- Attachment #1: Type: text/plain, Size: 1717 bytes --]
Thank you very much Matt, it was exactly what I was looking for! And thanks
to Matt for his prompt reply.
Just wondering, so there is (no way of | no point in) trying to execute the
org-match-sparse-tree programmatically, right?
This community rocks
On Fri, Mar 7, 2014 at 2:54 PM, Matt Lundin <mdl@imapmail.org> wrote:
> > 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:
>
> > 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
>
[-- Attachment #2: Type: text/html, Size: 2443 bytes --]
next prev parent reply other threads:[~2014-03-07 14:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-07 12:13 Get to next NEXT headline with one key Giacomo M
2014-03-07 12:37 ` John Kitchin
2014-03-07 12:44 ` Giacomo M
2014-03-07 13:54 ` Matt Lundin
2014-03-07 14:28 ` Giacomo M [this message]
2014-03-07 14:44 ` Oleh
2014-03-07 16:23 ` Giacomo M
2014-03-09 12:39 ` Oleh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CA+GKSr4t3aSHwA47QUWKz3t_pzEcQCVgQ75bxskHDuFfge7tkA@mail.gmail.com \
--to=jackjackk@gmail.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).