From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kyle Meyer Subject: Re: [RFC] Repeat Heading movement commands Date: Sun, 29 Mar 2015 16:05:40 -0400 Message-ID: <87mw2vfu23.fsf@kmlap.domain.org> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45564) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YcJOL-0008Pt-0T for emacs-orgmode@gnu.org; Sun, 29 Mar 2015 16:01:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YcJOF-0007sQ-Sf for emacs-orgmode@gnu.org; Sun, 29 Mar 2015 16:01:04 -0400 Received: from mail-qg0-f51.google.com ([209.85.192.51]:33861) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YcJOF-0007sM-Pw for emacs-orgmode@gnu.org; Sun, 29 Mar 2015 16:00:59 -0400 Received: by qgep97 with SMTP id p97so172191449qge.1 for ; Sun, 29 Mar 2015 13:00:58 -0700 (PDT) In-Reply-To: (Jacob Gerlach's message of "Sun, 29 Mar 2015 15:11:50 -0400") 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: Jacob Gerlach Cc: Org-mode Jacob Gerlach 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