GNU bug report logs - #74946
[PATCH] * lisp/files.el (auto-mode-alist): Include gdbinit too

Previous Next

Package: emacs;

Reported by: Björn Bidar <bjorn.bidar <at> thaodan.de>

Date: Wed, 18 Dec 2024 14:23:02 UTC

Severity: normal

Tags: patch

Fixed in version 31.1

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Björn Bidar <bjorn.bidar <at> thaodan.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: acorallo <at> gnu.org, stefankangas <at> gmail.com, 74946 <at> debbugs.gnu.org
Subject: bug#74946: [PATCH] * lisp/files.el (auto-mode-alist): Include gdbinit too
Date: Fri, 20 Dec 2024 10:07:17 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Björn Bidar <bjorn.bidar <at> thaodan.de>
>> Cc: Stefan Kangas <stefankangas <at> gmail.com>,  74946 <at> debbugs.gnu.org,
>>   acorallo <at> gnu.org
>> Date: Thu, 19 Dec 2024 23:29:00 +0200
>> 
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>> 
>> > It looks innocent enough, but at this point I'd like to limit changes
>> > on the release branch to only really urgent and important ones (or
>> > documentation).  We have lived with this outdated code for several
>> > years (GDB 11.1 was released in 2022), so this change doesn't look
>> > urgent to me.
>> 
>> Not really that urgent but to new users of Emacs it would be
>> beneficial if things would work out of the box. I thought at first Emacs
>> just didn't support the file.
>
> I understand, but my main worry is the potential unintended
> consequences.  Regexps are tricky, as we all know.

Yeah I get it np. Your call. The risks are low I'd say.

>> > Btw, if we want to fix this entry, we should perhaps do a more
>> > thorough job.  For example, on my system I have files with the
>> > following base names:
>> >
>> >   .gdbinit.in
>> >   .gdbinit
>> >   _gdbinit (for MS-DOS)
>> >   gdb.ini (likewise)
>> 
>> Is this a gdbinit file? The extension looks off.
>
> Yes, gdb.ini is a gdbinit file.  But if supporting it is problematic
> or causes too many complications, I'm okay with not supporting that
> particular file name.

I later got that too. The gdb manual states that gdb.ini is the official
name of gdb on DOS systems. I think it should be fine as the chance for
false-positives in low on this one.

>> >   gdbinit
>> >   gdbinit.in
>> >   SOMETHING-gdbinit
>> >   .gdbinit.loader
>> >   gdbinit-history.exp (not a GDB init file)
>> >   gdbinit.5 (likewise)
>> >   gdbinit.c (likewise)
>> >   .gdbinit.py.in (likewise)
>> >
>> > Should we improve the regexp to DTRT for those additional files, but
>> > without false positives?
>> 
>> With Stefan correction all these without extension match. What are the
>> official extensions? gdbinit.in sounds like a normal extension for
>> gdbinit template in the source but the others such as gdb.ini look off.
>
> So we should at least allow the ".in" extension?  Also, note that the
> current regexp doesn't end with a \\' so it could be a partial match
> with, say, /foo/bar/gdbinit-but-not-really.

I think so yes. In most instances the .in extension should also match
the preceding match it I think.




This bug report was last modified 243 days ago.

Previous Next


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