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: Michael Heerdegen
Subject: bug#53764: 27.1; shouldn't ~/diary be in diary-mode?
Date: Mon, 07 Feb 2022 01:39:37 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Lars Ingebrigtsen <larsi@gnus.org> writes:

> 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.
>
> We could move diary-file out of calendar.el and put it in...
> bindings.el or something, though?

I'm not sure anymore if this is a good idea anyway, because (doc of
`diary-file'): "Diary files can contain directives to include the
contents of other files; for details, see the documentation for the
variable `diary-list-entries-hook'".

No magic is able to ensure that all of these files are always opened
with the right mode.

Dunno.  When the diary-file is opened with `diary-show-all-entries', the
mode is already changed to diary-mode.  We could automatically add a
file local variable when Emacs creates the (main) diary file for the
user.

An alternative approach: we change the name of the diary-file to .diary
and associate the suffix ".diary" with diary-mode.  When the user then
names his/her included diary files like "holidays.diary" and
"work.diary", the mode would be enabled for these files, too.

Michael.





reply via email to

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