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

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

bug#53764: 27.1; shouldn't ~/diary be in diary-mode?


From: Francesco Potortì
Subject: bug#53764: 27.1; shouldn't ~/diary be in diary-mode?
Date: Mon, 07 Feb 2022 10:10:04 +0100

>Francesco Potortì <pot@gnu.org> writes:
>> If diary-file is already in the auto-mode-alist, we do nothing.  No override.
>
>Do we have a convenience function that says whether we have a match in
>auto-mode-alist?  `set-auto-mode--apply-alist' seems to be the closest I
>can find, and...  it's not that close.  :-/  But I guess it could be
>refactored out of there.

This one seems to do the job:
(add-to-list 'auto-mode-alist
             (cons diary-file 'diary-mode)
                   (lambda (a b) (equal (car a) (car b))))

>Michael Heerdegen <michael_heerdegen@web.de> writes:
>> I vote "do it".  People will rather change `diary-mode' than writing
>> something own from scratch.  The - not unuseful - mode is too hard to
>> discover currently.

That was my point, in fact.

>We have a chicken/egg problem, though.  Adding `diary-file' to
>`auto-mode-alist' would be fine, but we calculate that in calendar.el,
>so people not using the calendar won't get the mode.

That would not do a complete job.  I have used M-x diary for years before ever 
trying M-x calendar.  Occasionally I suse calendar today, but mst of the time I 
add entries to diary by hand.  I have (appt-activate t) in my .emacs.

>We could move diary-file out of calendar.el and put it in...
>bindings.el or something, though?

I would add it to the mode alist just after diary-file's defcustom





reply via email to

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