From mboxrd@z Thu Jan 1 00:00:00 1970 From: Markus Heller Subject: Re: [OT] Passing universal argument to a function (was: Bind C-u C-c C-x C-i to a key) Date: Fri, 13 Aug 2010 09:49:04 -0700 Message-ID: <0v62zezce7.fsf@gmail.com> References: <0vhbizzap7.fsf@gmail.com> <87ocd71jz6.fsf@gmx.net> <87bp978cz8.fsf@mean.albasani.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=33845 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OjxRS-0004m2-Oz for emacs-orgmode@gnu.org; Fri, 13 Aug 2010 12:49:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OjxRR-0007Pg-Hk for emacs-orgmode@gnu.org; Fri, 13 Aug 2010 12:49:14 -0400 Received: from lo.gmane.org ([80.91.229.12]:47054) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OjxRR-0007PR-6l for emacs-orgmode@gnu.org; Fri, 13 Aug 2010 12:49:13 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OjxRN-00030U-0T for emacs-orgmode@gnu.org; Fri, 13 Aug 2010 18:49:09 +0200 Received: from 142.103.191.98 ([142.103.191.98]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 13 Aug 2010 18:49:09 +0200 Received: from hellerm2 by 142.103.191.98 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 13 Aug 2010 18:49:09 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Memnon Anon writes: > Andreas Burtzlaff writes: > >> The C-u says that the function that is bound to the rest of the key >> combination is called with the first argument being `t'. >> >> To get information about the function bound to a key combination use: >> C-h k >> and then press the key combination (without the C-u prefix). >> In this case it is org-clock-in. >> >> This should bind org-clock-in with argument `t' to F12: >> >> (defun ab-org-clock-in-select () >> (interactive) >> (org-clock-in t)) >> >> (global-set-key (kbd "") 'ab-org-clock-in-select) > > Mhhh, this does not work for me. > > ,----[ (info "(eintr)Note for Novices") ] > | In addition to typing a lone keychord, you can prefix what you type > | with `C-u', which is called the `universal argument'. The `C-u' > | keychord passes an argument to the subsequent command. [...] > | (If you do not specify a number, Emacs either passes the number 4 to > | the command or otherwise runs the command differently than it would > | otherwise.) > `---- > > So, afaics C-u = Value of 4. > > Some googling seems to suggest that an argument of '(4) works, > and it does for me: > > (defun ab-org-clock-in-select () > (interactive) > (org-clock-in '(4))) > > or even shorter with a lambda > > (global-set-key (kbd "C-c C-g") (lambda () (interactive) (org-clock-in '(4)))) > > works here! Works here too! Thanks a lot! > However, this faq [ (info "(efaq)Replying to the sender of a message") ] > seems to suggest that your version is the way to go. I'm not quite sure I understand this ... But again, thanks anyway! Markus > ... > > I am confused. > > However, this is org OT, so I'll finish my musings here :) > Go with whatever works for you. > > Memnon > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode