From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Ecay Subject: Re: Call speed-commands with prefix-arg? Date: Tue, 23 Sep 2014 13:58:52 -0400 Message-ID: <87sijinrqb.fsf@gmail.com> References: <87y4thtece.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47880) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWUMq-0006lm-2G for emacs-orgmode@gnu.org; Tue, 23 Sep 2014 13:59:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XWUMe-0000EX-I1 for emacs-orgmode@gnu.org; Tue, 23 Sep 2014 13:59:12 -0400 Received: from mail-qc0-x229.google.com ([2607:f8b0:400d:c01::229]:48277) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWUMe-0000D6-Cz for emacs-orgmode@gnu.org; Tue, 23 Sep 2014 13:59:00 -0400 Received: by mail-qc0-f169.google.com with SMTP id r5so985970qcx.14 for ; Tue, 23 Sep 2014 10:58:54 -0700 (PDT) In-Reply-To: <87y4thtece.fsf@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: Thorsten Jolitz , emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Thorsten, 2014ko irailak 18an, Thorsten Jolitz-ek idatzi zuen: >=20 > Hi List,=20 >=20 > is there a way to call Org speed-commands [fn:1] with a prefix-arg? > Does not work for me ... The attached patch should allow this. You can use C-u N X or C-N X (where N is some digits and X a speed command key). I=E2=80=99ll commit it to mas= ter in a few days (along with an entry in ORG-NEWS), unless there is any feedback. It might be cool to also allow digits 0-9 and hyphen (for minus) to work as prefix args when in speed command position. But that=E2=80=99s more complicated. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-allow-speed-commands-to-have-prefix-args.patch >From f4abc5c57764fc36d7405be6b6c2f5cd63396d8d Mon Sep 17 00:00:00 2001 From: Aaron Ecay Date: Tue, 23 Sep 2014 13:54:47 -0400 Subject: [PATCH] allow speed commands to have prefix args * lisp/org.el (org-self-insert-command): Allow speed commands to be invoked with prefix args. --- lisp/org.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index b09e72d..9815eb4 100755 --- a/lisp/org.el +++ b/lisp/org.el @@ -19693,9 +19693,11 @@ overwritten, and the table is not marked as requiring realignment." (org-check-before-invisible-edit 'insert) (cond ((and org-use-speed-commands - (setq org-speed-command - (run-hook-with-args-until-success - 'org-speed-command-hook (this-command-keys)))) + (let ((kv (this-command-keys-vector))) + (setq org-speed-command + (run-hook-with-args-until-success + 'org-speed-command-hook + (make-string 1 (aref kv (1- (length kv)))))))) (cond ((commandp org-speed-command) (setq this-command org-speed-command) -- 2.1.0 --=-=-= Content-Type: text/plain -- Aaron Ecay --=-=-=--