help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: help create function alias


From: Adam
Subject: Re: help create function alias
Date: Wed, 08 Dec 2010 15:28:59 -0000
User-agent: KNode/0.9.2

Marc Mientki wrote:

> Am 20.09.2010 12:43, schrieb Adam:
>> (defun id ()
>>     "insert date"
>>     (interactive "P")
>>     (insert-date t))
>>
> 
> There two errors:
> 
> 1. You say (interactive "P") but not provide argument to id.
> When you use "P", then you must write:
> (defun if (arg) ...
> 
> or
> 
> (defun if (&optional arg) ...
> 
> But actualy you don't need "P" in your example. So you can write:
> 
> (defun id ()
>     "insert date"
>     (interactive)
>     (insert-date t))
> 
> 2. Function insert-date is not defined, at least not in my emacs.
> 
> HTH
> Marc

Thanks. It does help. 

In my .emacs I walked right past an (insert-date) function which 
I picked up from somewhere. It uses an ISO date format, includes 
the "P" for alternate formatting from the argument. 

Thanks.  










reply via email to

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