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

Previous Next

Package: emacs;

Reported by: Francesco Potortì <pot <at> gnu.org>

Date: Thu, 3 Feb 2022 22:13:01 UTC

Severity: wishlist

Found in version 27.1

Full log


Message #46 received at 53764 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Francesco Potortì <pot <at> gnu.org>
Cc: 53764 <at> debbugs.gnu.org
Subject: Re: bug#53764: 27.1; shouldn't ~/diary be in diary-mode?
Date: Mon, 07 Feb 2022 10:28:07 +0100
Francesco Potortì <pot <at> gnu.org> writes:

>>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))))

The user may have used a regexp like "diary$", "diary\\'", etc, so that
doesn't work.

>>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

As I said, that wouldn't help that much, because then you only get it
added to auto-mode-alist after loading calendar.el (since there's where
it's defined today).

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 3 years and 95 days ago.

Previous Next


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