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

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

bug#13536: 24.2; Patterns in `diary-european-date-forms' NOT mutually ex


From: Andreas Merziger
Subject: bug#13536: 24.2; Patterns in `diary-european-date-forms' NOT mutually exclusive -- incl. suggested Fix
Date: Wed, 23 Jan 2013 22:17:57 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

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!








reply via email to

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