GNU bug report logs - #13536
24.2; Patterns in `diary-european-date-forms' NOT mutually exclusive -- incl. suggested Fix

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Andreas Merziger <andreas.merziger@HIDDEN>; dated Wed, 23 Jan 2013 21:19:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 23 Jan 2013 21:18:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 23 16:18:58 2013
Received: from localhost ([127.0.0.1]:46807 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Ty7ij-0000IF-Gv
	for submit <at> debbugs.gnu.org; Wed, 23 Jan 2013 16:18:58 -0500
Received: from eggs.gnu.org ([208.118.235.92]:50490)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <andreas.merziger@HIDDEN>) id 1Ty7ig-0000I7-OI
	for submit <at> debbugs.gnu.org; Wed, 23 Jan 2013 16:18:55 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <andreas.merziger@HIDDEN>) id 1Ty7hO-0006Np-KJ
	for submit <at> debbugs.gnu.org; Wed, 23 Jan 2013 16:17:37 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE
	autolearn=unavailable version=3.3.2
Received: from lists.gnu.org ([208.118.235.17]:52618)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <andreas.merziger@HIDDEN>) id 1Ty7hO-0006Nl-HG
	for submit <at> debbugs.gnu.org; Wed, 23 Jan 2013 16:17:34 -0500
Received: from eggs.gnu.org ([208.118.235.92]:33612)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <andreas.merziger@HIDDEN>) id 1Ty7hL-00039z-Pv
	for bug-gnu-emacs@HIDDEN; Wed, 23 Jan 2013 16:17:34 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <andreas.merziger@HIDDEN>) id 1Ty7hI-0006N5-DE
	for bug-gnu-emacs@HIDDEN; Wed, 23 Jan 2013 16:17:31 -0500
Received: from moutng.kundenserver.de ([212.227.126.187]:56430)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <andreas.merziger@HIDDEN>) id 1Ty7hI-0006Mr-3b
	for bug-gnu-emacs@HIDDEN; Wed, 23 Jan 2013 16:17:28 -0500
Received: from localhost (koln-4d0b5970.pool.mediaWays.net [77.11.89.112])
	by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis)
	id 0LjdQ8-1UZfRN3M5I-00bPdY; Wed, 23 Jan 2013 22:17:26 +0100
From: Andreas Merziger <andreas.merziger@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 24.2;
	Patterns in `diary-european-date-forms' NOT mutually exclusive --
	incl. suggested Fix 
Date: Wed, 23 Jan 2013 22:17:57 +0100
Message-ID: <874ni738fu.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Provags-ID: V02:K0:6o9AXX675oynoduRP8h6cC5pBDzwsxr0hJjMYcoBeP2
	vNhpF7TyIc5AIy5ha5l2JU6dcQ/k8ztz/TLeXsT22PT7gn9CQO
	NhWBGGMrBl9VLj8xmZEyJwC0v5/XZn5sqYG1CPCXQUPcQjV1IB
	0eZV6QNsFVqR6+ckUPD5lKImFeGUcMJ6MDahnQ1QxT9Trel3rq
	zm8nIHX9OGQ1HqCRN0BQtHHYrsT4hGGX81NtsjqRWRQMBlUE7K
	P2zXohHXdgd1f8y/FTDFMKbq7hAR0rHhSwT1lbymf9O3bqwyRT
	0ZzEsZzVWvsnnPQ2rZmPso+OdtWDWLIwtn69cvxCBINxRcn8ur
	eCD3+IPLmatQEQrI6MK8=
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 208.118.235.17
X-Spam-Score: -4.2 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -4.2 (----)

To reproduce the bug start with

emacs -Q

Contents of ~/diary are the following five lines:
23 Jan 10:00 Test-Entry 1
23 Jan 10pm Test-Entry 2
23 Jan 10am Test-Entry 3
23 Jan 10Pm Test-Entry 4
23 Jan 10Am Test-Entry 5

1.) Start the calendar:

M-x calendar

2.) Set calendar-date-style to 'european

M-x calendar-set-date-style

Choose 'european.

3.) In *Calendar* - buffer go to date:

 January, 23 of year 10

4.) Type key `d' to show the diary for that date

UNEXPECTEDLY, the buffer `Fancy Diary Entries' looks like this:

Saturday, 23 January 10
=======================
10:00 Test-Entry 1
10pm Test-Entry 2
10am Test-Entry 3
10Pm Test-Entry 4
10Am Test-Entry 5
00 Test-Entry 1
m Test-Entry 2
m Test-Entry 3
m Test-Entry 4
m Test-Entry 5


The first five line are the expected ones - the last five lines appear due to the
fact, that the elements of the list `diary-european-date-forms' are NOT
mutually exclusive, as they should as required by the documentation.

--- End of Bug description ---

SUGGESTED FIX:

In File PATH-TO-EMACS/lisp/calendar/calendar.el 
do the following:

(defcustom diary-european-date-forms
  '((day "/" month "[^/0-9]")
    (day "/" month "/" year "[^0-9]")
    (backup day " *" monthname"\\W+\\<\\([^*0-9]\\|\\([0-9]+[:aApP]\\)\\)")
;;--------------------------------------------------------------
;; (day " *" monthname " *" year "[^0-9]")  (not restrictive enough)
   (day " *" monthname " *" year "[^0-9:aApP]") ;; (suggested fix)
;;--------------------------------------^^^^^------------------- 
;; Include letters a,A,p,P and colon here
;;
    (dayname "\\W"))
  "List of pseudo-patterns describing the European style of dates.
The defaults are: DAY/MONTH; DAY/MONTH/YEAR; DAY MONTHNAME;
DAY MONTHNAME YEAR; DAYNAME.  Normally you should not customize this, but
`diary-date-forms' (which see)."
  :type '(repeat (choice (cons :tag "Backup"
                               :value (backup . nil)
                               (const backup)
                               (repeat (list :inline t :format "%v"
                                             (symbol :tag "Keyword")
                                             (choice symbol regexp))))
                         (repeat (list :inline t :format "%v"
                                       (symbol :tag "Keyword")
                                       (choice symbol regexp)))))
  :group 'diary)

After this change I could not observe this unexpected behaviour anymore.

COMMENT:
This misbehaviour is not just a matter of sophistry.
I'm trying to develop a contribution to emacs calendar/diary
which allows a form of natural (automated) archiving of outdatet diary entries, this
way trying to avoid that the diary file grows unnecessarily large over
time. (Any hints, ideas, minimal requirements on this welcome :-))

Matching of diary entries is much harder, if these date-forms are NOT
mutually exclusive.

So please consider fixing that the suggested (or any other) way.

Thanks in advance!







Acknowledgement sent to Andreas Merziger <andreas.merziger@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#13536; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 31 Oct 2014 17:00:04 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.