emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: John Kitchin <jkitchin@andrew.cmu.edu>
To: Kyle Meyer <kyle@kyleam.com>
Cc: Org-mode <emacs-orgmode@gnu.org>, Jacob Gerlach <jacobgerlach@gmail.com>
Subject: Re: [RFC] Repeat Heading movement commands
Date: Sun, 29 Mar 2015 16:09:30 -0400	[thread overview]
Message-ID: <CAJ51EToBa8MOt612Xj5NO3f0PHwHebmVzq-ohjOP5DVz8xJ_2Q@mail.gmail.com> (raw)
In-Reply-To: <87mw2vfu23.fsf@kmlap.domain.org>

[-- Attachment #1: Type: text/plain, Size: 1332 bytes --]

This kind of repeated command seems to be a good application for hydra.

On Sunday, March 29, 2015, Kyle Meyer <kyle@kyleam.com> wrote:

> Jacob Gerlach <jacobgerlach@gmail.com <javascript:;>> wrote:
> > Hi List,
> >
> > I often find myself wanting to move up by several headings:
> >
> > C-c C-p, C-c C-p, C-c C-p...
> > (I don't usually know ahead of time how many I want to move, so I
> > can't use a numeric prefix arg)
> >
> > I like how `set-mark-command' works with non-nil `set-mark-repeat-pop'
> > to avoid the need to repeat a prefix key and wanted to try something
> > similar for C-p. I came up with the following:
> >
> > (define-key org-mode-map
> >  (kbd "C-p")
> >  (lambda (arg)
> >    (interactive "p")
> >    (if (not (eq last-command 'org-previous-visible-heading))
> >        (previous-line arg)
> >      (org-previous-visible-heading arg)
> >      (setq this-command 'org-previous-visible-heading))))
> >
> > So now I can do:
> > C-c C-p, C-p, C-p...
> > And repeatedly move by headlines.
>
> With org-use-speed-commands set to t, this could be "C-c C-p p p".
>
> --
> Kyle
>
>

-- 
John

-----------------------------------
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu

[-- Attachment #2: Type: text/html, Size: 2024 bytes --]

  reply	other threads:[~2015-03-29 20:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-29 19:11 [RFC] Repeat Heading movement commands Jacob Gerlach
2015-03-29 20:05 ` Kyle Meyer
2015-03-29 20:09   ` John Kitchin [this message]
2015-03-29 20:35     ` Kyle Meyer
2015-03-29 21:43     ` Xavier Maillard
2015-03-29 22:10       ` Suvayu Ali
2015-03-30  0:33         ` Jacob Gerlach
2015-03-29 22:15       ` Kyle Meyer

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=CAJ51EToBa8MOt612Xj5NO3f0PHwHebmVzq-ohjOP5DVz8xJ_2Q@mail.gmail.com \
    --to=jkitchin@andrew.cmu.edu \
    --cc=emacs-orgmode@gnu.org \
    --cc=jacobgerlach@gmail.com \
    --cc=kyle@kyleam.com \
    /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).