From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jacob Gerlach Subject: [RFC] Repeat Heading movement commands Date: Sun, 29 Mar 2015 15:11:50 -0400 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37760) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YcIch-0007oN-TW for emacs-orgmode@gnu.org; Sun, 29 Mar 2015 15:11:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YcIch-0001w6-0V for emacs-orgmode@gnu.org; Sun, 29 Mar 2015 15:11:51 -0400 Received: from mail-qg0-x234.google.com ([2607:f8b0:400d:c04::234]:34049) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YcIcg-0001vj-TM for emacs-orgmode@gnu.org; Sun, 29 Mar 2015 15:11:50 -0400 Received: by qgep97 with SMTP id p97so171693332qge.1 for ; Sun, 29 Mar 2015 12:11:50 -0700 (PDT) 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: 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