emacs-orgmode
[Top][All Lists]
Advanced

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

[Orgmode] Re: [OT] Passing universal argument to a function (was: Bind C


From: Markus Heller
Subject: [Orgmode] 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
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (windows-nt)

Memnon Anon <address@hidden> writes:

> Andreas Burtzlaff <address@hidden> 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 "<f12>") '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.
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode




reply via email to

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