From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: Re: Get to next NEXT headline with one key Date: Fri, 07 Mar 2014 07:54:04 -0600 Message-ID: <87k3c6glmr.fsf@fastmail.fm> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58383) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLvE8-0001CV-Q7 for emacs-orgmode@gnu.org; Fri, 07 Mar 2014 08:54:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WLvE3-0001FN-0r for emacs-orgmode@gnu.org; Fri, 07 Mar 2014 08:54:16 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:35679) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLvE2-0001Ex-Kw for emacs-orgmode@gnu.org; Fri, 07 Mar 2014 08:54:10 -0500 Received: from compute1.internal (compute1.nyi.mail.srv.osa [10.202.2.41]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id F280020E59 for ; Fri, 7 Mar 2014 08:54:05 -0500 (EST) In-Reply-To: (Giacomo M.'s message of "Fri, 7 Mar 2014 13:44:37 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Giacomo M Cc: emacs-orgmode@gnu.org, John Kitchin > On Fri, Mar 7, 2014 at 7:13 AM, Giacomo M > wrote: >=20=20=20=20 > 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=C2=A0org-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=C2=A0org-speed-commands-user > customization. >=20=20=20=20=20=20=20=20 > Is there anybody so kind to guide me to the (probably trivial) > solution? >=20=20=20=20=20=20=20=20 Giacomo M 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)) =20=20=20=20 (add-to-list 'org-speed-commands-user '("N" . (org-speed-move-safe 'my-org-= next-next))) --8<---------------cut here---------------end--------------->8--- Best, Matt