From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oleh Subject: Re: Get to next NEXT headline with one key Date: Sun, 9 Mar 2014 13:39:44 +0100 Message-ID: References: <5319F270.10605@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49034) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WMd19-0008OC-9G for emacs-orgmode@gnu.org; Sun, 09 Mar 2014 08:39:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WMd18-0006K7-7O for emacs-orgmode@gnu.org; Sun, 09 Mar 2014 08:39:47 -0400 Received: from mail-wg0-x234.google.com ([2a00:1450:400c:c00::234]:54295) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WMd18-0006K2-0S for emacs-orgmode@gnu.org; Sun, 09 Mar 2014 08:39:46 -0400 Received: by mail-wg0-f52.google.com with SMTP id k14so7307360wgh.23 for ; Sun, 09 Mar 2014 05:39:44 -0700 (PDT) In-Reply-To: <5319F270.10605@gmail.com> 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 >> And commands work from start of #+... as well. > > > Like this one. Note that you have to use "f" to get to the first #+ that belongs to a heading. >> Here's how I've implemented the functionality that you want: >> >> "j"/"k" are bound move down/up just like in vim, but they move by >> headings or #+ markers. >> But "K" can change their behavior temporarily: it will prompt you for >> a char that corresponds to a keyword: >> t - TODO >> d - DONE >> n - NEXT >> c - CANCELLED >> >> After a keyword is set, "j"/"k" will move by this keyword instead, >> until any command other than "j"/"k" is issued (for instance "m", >> which reveals heading). After that "j"/"k" will return to their >> regular behavior. >> > > Question: is there a particular reason for restricting keyword j/k movement > only to > - headlines at lower/equal levels (I get stuck in the subtree with the first > NEXT)? > - visible headlines (I miss folded NEXT entries)? Restriction lifted. > Still eventually I would like to pack those "Knjm" keys into just one key to > replicate what is done by Matt my-org-next-next() function. Doable by defining these functions on your own: (defun set-keyword-next () (interactive) (worf-keyword "NEXT")) (defun set-keyword-done () (interactive) (worf-keyword "DONE")) After a call to `set-keyword-next`, "j"/"k" will move by "NEXT" keyword until any other command is called. > Do you think that the selection procedure of *helm* could be compatible with > sth like ace-jump-line-mode? The problem then will be to find a good keyword > also for activating the ace commands. I think I see what you mean, but `helm` is already good enough in my opinion. I have mixed opinion of `ace-jump-mode`: on one hand it's fast, on the other - it always requires you to focus and read: it can never become muscle memory. `helm`, on the other hand, is very nice in this respect: if you want to go to a heading related to "ice cream", you just 1. Press "g" for go. 2. Type "ice". This will usually give you just one candidate to you can "C-m" right away. If you're an ice enthusiast and there are many matches (from 2 to 10), use "C-n"/"C-p" to select. If you're obsessed with ice and there are more than 10 matches, press space to narrow the candidates and type in something else: "ice age" will match not only the movie, but "Aged rice" as well. This should bring you to less than 10 matches. This also works nicely with org mode: "todo coffee :office" will match a TODO related to coffee with tag :OFFICE:. > I think this is a good step towards the ultimate keystroke-minimizing > editing environment... it's just a thousand key-bindings-to-memorize away, > but I can see it! Hopefully it's not a thousand. Actually the whole "Knj" thing was my attempt at minimizing the amount that you have to remember. I don't know much about vim, but I've glimpsed its notion of verb-modifier-object, at least the modifier-verb part: "Kn" is the modifier (keyword-next) and "j" is the verb (down). Or "4" is the modifier (4 times) and "j" is the verb etc. You don't have to remember each combination together, you just have to remember the components and combine them as you like. So my suggestion for you is consider not defining `set-keyword-next` and binding it to some random free key binding, but using "Kn" for a while, maybe it'll grow on you. I can think of one more use for "Kn": "Kn+" could add a heading with keyword "NEXT" ("+" is the verb to add an empty heading). regards, Oleh