From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Adam Newsgroups: gmane.emacs.help Subject: Re: help create function alias Date: Mon, 20 Sep 2010 23:46:13 +1200 Organization: Ihug Ltd Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: dough.gmane.org 1291947793 15008 80.91.229.12 (10 Dec 2010 02:23:13 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 10 Dec 2010 02:23:13 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Dec 10 03:23:09 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PQsdY-0001cm-1T for geh-help-gnu-emacs@m.gmane.org; Fri, 10 Dec 2010 03:23:08 +0100 Original-Received: from localhost ([127.0.0.1]:50315 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQsdX-0006AW-5n for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 21:23:07 -0500 Original-Path: usenet.stanford.edu!news.glorb.com!news2.glorb.com!newsfeeds.ihug.co.nz!lust.ihug.co.nz!ihug.co.nz!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 46 Original-NNTP-Posting-Host: 203.173.200.133 Original-X-Trace: lust.ihug.co.nz 1284982466 13671 203.173.200.133 (20 Sep 2010 11:34:26 GMT) Original-X-Complaints-To: abuse@ihug.co.nz Original-NNTP-Posting-Date: Mon, 20 Sep 2010 11:34:26 +0000 (UTC) User-Agent: KNode/0.9.2 Original-Xref: usenet.stanford.edu gnu.emacs.help:181376 X-Mailman-Approved-At: Thu, 09 Dec 2010 20:09:00 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:77195 Archived-At: 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.