From mboxrd@z Thu Jan 1 00:00:00 1970 From: Giacomo M Subject: Re: Key-binding to a command with prefix argument Date: Tue, 24 Feb 2015 17:24:49 -0800 Message-ID: References: <87egpehmmv.fsf@wmi.amu.edu.pl> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c3c178615a8f050fdf80a6 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59947) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQQiZ-00032L-RS for emacs-orgmode@gnu.org; Tue, 24 Feb 2015 20:24:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YQQiY-0001LH-JK for emacs-orgmode@gnu.org; Tue, 24 Feb 2015 20:24:51 -0500 Received: from mail-la0-x235.google.com ([2a00:1450:4010:c03::235]:45874) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQQiY-0001L5-8I for emacs-orgmode@gnu.org; Tue, 24 Feb 2015 20:24:50 -0500 Received: by labge10 with SMTP id ge10so653340lab.12 for ; Tue, 24 Feb 2015 17:24:49 -0800 (PST) In-Reply-To: <87egpehmmv.fsf@wmi.amu.edu.pl> 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: Marcin Borkowski Cc: emacs-orgmode@gnu.org --001a11c3c178615a8f050fdf80a6 Content-Type: text/plain; charset=UTF-8 On Tue, Feb 24, 2015 at 4:15 PM, Marcin Borkowski wrote: > > On 2015-02-25, at 00:24, Giacomo M wrote: > > > Dear all, > > I started using more frequently "C-u C-c C-x ", > > which offers a list of recently clocked tasks to clock into. I already > > assigned "" to org-clock-in, but how can I assign (let say) > "C-" > > to org-clock-in with a prefix argument? > > What about > > (defun org-clock-in-recent () > "Clock in a recently clocked task." > (interactive) > (org-clock-in '(4))) > > (global-set-key (kbd "C-") #'org-clock-in-recent) > > ? > Thanks Marcin, indeed it worked as expected. > > BTW, I seldom use C-c C-x - I prefer C-c C-x C-i. > Do "C-c C-x " and "C-c C-x C-i" call the same command? My system doesn't seem to distinguish the two. How could I distinguish them and why should I prefer one instead of the other? > > Also, you might want to read this: > http://mbork.pl/2013-05-25_Clocking_in_from_anywhere_%28en%29 > Thanks, interesting. Apparently org-clock-in-recent seems to work already from anywhere. Giacomo > Hth, > > -- > Marcin Borkowski > http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski > Faculty of Mathematics and Computer Science > Adam Mickiewicz University > > --001a11c3c178615a8f050fdf80a6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On T= ue, Feb 24, 2015 at 4:15 PM, Marcin Borkowski <mbork@wmi.amu.edu.pl= > wrote:

On 2015-02-25, at 00:24, Giacomo M <jackjackk@gmail.com> wrote:

> Dear all,
> I started using more frequently "C-u C-c C-x <tab>", > which offers a list of recently clocked tasks to clock into. I already=
> assigned "<f11>" to org-clock-in, but how can I assign= (let say) "C-<f11>"
> to org-clock-in with a prefix argument?

What about

(defun org-clock-in-recent ()
=C2=A0 "Clock in a recently clocked task."
=C2=A0 (interactive)
=C2=A0 (org-clock-in '(4)))

(global-set-key (kbd "C-<f11>") #'org-clock-in-recent)<= br>
?

Thanks Marcin, indeed it worked as ex= pected.
=C2=A0

BTW, I seldom use C-c C-x <tab> - I prefer C-c C-x C-i.

Do=C2=A0 "C-c C-x <tab>" and "C= -c C-x C-i" call the same command? My system doesn't seem to disti= nguish the two. How could I distinguish them and why should I prefer one in= stead of the other?
=C2=A0

Also, you might want to read this: http://mbork.pl/2013-05= -25_Clocking_in_from_anywhere_%28en%29

<= div>Thanks, interesting. Apparently org-clock-in-recent seems to work alrea= dy from anywhere.



Giacomo




Hth,

--
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University


--001a11c3c178615a8f050fdf80a6--