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 #70 received at 53764 <at> debbugs.gnu.org (full text, mbox):

From: Francesco Potortì <pot <at> gnu.org>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 53764 <at> debbugs.gnu.org
Subject: Re: bug#53764: 27.1; shouldn't ~/diary be in diary-mode?
Date: Wed, 09 Feb 2022 22:52:48 +0100
>>>>>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.
>>
>> Sorry, I don't get it.  I am suggeting to add the name of the actual file (the one in diary-file) to the mode alist.  Looking for possible matches is a (small) optimisation. Why do we need a completely reliable matching code?
>
>If you put it at the end, it won't hide any preexisting match.

Little matter, in my opinion.  If the user haa set up anything, that will match.  It's okay.  We don't want to hide anything.  We just want to improve user experience in the common case when the user has not read the source code and does not know about diary-mode.




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

Previous Next


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