all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [RFC] Repeat Heading movement commands
@ 2015-03-29 19:11 Jacob Gerlach
  2015-03-29 20:05 ` Kyle Meyer
  0 siblings, 1 reply; 8+ messages in thread
From: Jacob Gerlach @ 2015-03-29 19:11 UTC (permalink / raw)
  To: Org-mode

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.

This (with a similar definition for C-n) is working well for me. If I
fleshed this out into a patch with a defcustom to control the
behavior, might it be applied? Or is this too far in the weeds of
individual user preference to warrant modifying org.el?

Thanks for any comments.

Regards,
Jake

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-03-30  0:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.