From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.help Subject: Re: Diary insert date formatting Date: Mon, 10 Aug 2009 11:27:02 -0700 Organization: None Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1249929704 2112 80.91.229.12 (10 Aug 2009 18:41:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 10 Aug 2009 18:41:44 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Aug 10 20:41:37 2009 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.50) id 1MaZoO-000243-LB for geh-help-gnu-emacs@m.gmane.org; Mon, 10 Aug 2009 20:41:36 +0200 Original-Received: from localhost ([127.0.0.1]:59557 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MaZoN-0007FC-OB for geh-help-gnu-emacs@m.gmane.org; Mon, 10 Aug 2009 14:41:35 -0400 Original-Path: news.stanford.edu!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 40 Original-NNTP-Posting-Host: xoc2.stanford.edu Original-X-Trace: news.stanford.edu 1249928822 25169 171.64.109.31 (10 Aug 2009 18:27:02 GMT) Original-X-Complaints-To: news@news.stanford.edu X-Spook: undercover TNT mines sarin Semtex twin towers Aum Supreme X-Ran: MR-(XQ:t~$bMp>h\7@f.0XQ 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:67033 Archived-At: rpd wrote: > Currently when I insert a diary date it is entered in this format: > Jul 31, 2009 > > Can I change this to include the abbreviated day as well e.g: > Fri Jul 31, 2009 ? The problem with doing this is how to distinguish the latter from an entry you want to apply every Friday, rather than one specific Friday. The simplest method is to just remove support for such entries. If you want to keep those as well, you will need to use a more complex expression in the last element of diary-date-forms below. The following assumes Emacs 23, and is only lightly tested. (defun my-diary-insert-entry (arg &optional event) "See `diary-insert-entry'." (interactive (list current-prefix-arg last-nonmenu-event)) (let ((calendar-date-display-form '((if dayname (concat dayname " ")) monthname " " day ", " year))) (diary-make-entry (calendar-date-string (calendar-cursor-to-date t event) t) arg))) (add-hook 'calendar-load-hook (lambda () (define-key calendar-mode-map "id" 'my-diary-insert-entry))) (setq diary-date-forms '(("\\sw+ *" monthname " *" day ", *" year "[^0-9]") (month "/" day "[^/0-9]") (month "/" day "/" year "[^0-9]") (monthname " *" day "[^,0-9]") (monthname " *" day ", *" year "[^0-9]") ;; (dayname "\\W") ))