[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Call speed-commands with prefix-arg?

From: Aaron Ecay
Subject: Re: [O] Call speed-commands with prefix-arg?
Date: Tue, 23 Sep 2014 13:58:52 -0400
User-agent: Notmuch/0.18.1+51~gbbbdf04 (http://notmuchmail.org) Emacs/ (x86_64-unknown-linux-gnu)

Hi Thorsten,

2014ko irailak 18an, Thorsten Jolitz-ek idatzi zuen:
> Hi List, 
> 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’ll commit it to master in a
few days (along with an entry in ORG-NEWS), unless there is any

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’s more
>From f4abc5c57764fc36d7405be6b6c2f5cd63396d8d Mon Sep 17 00:00:00 2001
From: Aaron Ecay <address@hidden>
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 
   (org-check-before-invisible-edit 'insert)
    ((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))))))))
      ((commandp org-speed-command)
       (setq this-command org-speed-command)

Aaron Ecay

reply via email to

[Prev in Thread] Current Thread [Next in Thread]