Subject: bug#74946: closed (Re: bug#74946: [PATCH] * lisp/files.el (auto-mode-alist): Include gdbinit too)

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 22 Dec 2024 02:10:02 +0000

Your bug report

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

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
74946: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=74946
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#74946: [PATCH] * lisp/files.el (auto-mode-alist): Include gdbinit too
From: Stefan Kangas <[email-masked]>
To: Eli Zaretskii <[email-masked]>
Cc: [email-masked], [email-masked], [email-masked]
Date: Sun, 22 Dec 2024 02:08:05 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Version: 31.1

Eli Zaretskii <[email-masked]> writes:

>> From: Stefan Kangas <[email-masked]>
>> Date: Thu, 19 Dec 2024 17:55:22 -0500
>> Cc: [email-masked], [email-masked], [email-masked]
>>
>> >   .gdbinit.in
>> >   .gdbinit
>> >   _gdbinit (for MS-DOS)
>> >   gdb.ini (likewise)
>> >   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?
>>
>> Maybe something like the below patch?
>
> Maybe.  Try it against any similar name you have on your system.  I
> used "locate -b gdbinit" to find matching files on mine.

Everything makes sense to me, so I pushed the change to master.
I'm closing this bug report with this message.

Please report back if you notice any problems.

Thanks!

Subject: [PATCH] * lisp/files.el (auto-mode-alist): Include gdbinit too
From: Björn Bidar <[email-masked]>
To: [email-masked]
Date: Wed, 18 Dec 2024 16:19:59 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Tags: patch

Include gdbinit inside auto-mode-alist.
Since gdb 11.1 it's the preferred  name of gdbinit.

Please also include into Emacs 30 if possible.

In GNU Emacs 31.0.50 (build 1, x86_64-suse-linux-gnu, GTK+ Version
3.24.43, cairo version 1.18.2)
Repository revision: eaf5bf736e1dd5eb977a16a3f1b3dfd3da3c4612
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101014
System Description: openSUSE Tumbleweed

Configured using:
 'configure --disable-build-details --without-pop --with-mailutils
 --without-hesiod --with-gameuser=:games --with-kerberos
 --with-kerberos5 --with-file-notification=inotify --with-modules
 --enable-autodepend --enable-link-time-optimization --prefix=/usr
 --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share
 --localstatedir=/var --sharedstatedir=/var/lib
 --libexecdir=/usr/libexec --with-file-notification=yes
 --libdir=/usr/lib64 --with-native-compilation=aot
 --enable-locallisppath=/usr/share/emacs/31.0.50/site-lisp:/usr/share/emacs/site-lisp
 --with-x --with-xim --with-sound --with-xpm --with-jpeg --with-tiff
 --with-gif --with-png --with-rsvg --with-dbus --with-xft --without-gpm
 --with-tree-sitter --with-x-toolkit=gtk --without-pgtk
 --with-toolkit-scroll-bars --x-includes=/usr/include
 --x-libraries=/usr/lib64 --with-libotf --with-m17n-flt --with-cairo
 --build=x86_64-suse-linux --with-dumping=pdumper
 build_alias=x86_64-suse-linux 'CC=sccache cc' 'CFLAGS=-O2 -Wall
 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong
 -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection
 -Werror=return-type -flto=auto -march=znver3 -mmmx -mpopcnt -msse
 -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -mavx -mavx2 -msse4a -mno-fma4
 -mno-xop -mfma -mbmi -mbmi2 -maes -mpclmul -mno-gfni -mvpclmulqdq
 -mno-3dnow -madx -mabm -mno-cldemote -mclflushopt -mclwb -mclzero
 -mcx16 -mno-enqcmd -mf16c -mfsgsbase -mfxsr -mno-hle -msahf -mno-lwp
 -mlzcnt -mmovbe -mno-movdir64b -mno-movdiri -mmwaitx -mno-pconfig -mpku
 -mprfchw -mno-ptwrite -mrdpid -mrdrnd -mrdseed -mno-rtm -mno-serialize
 -mno-sgx -msha -mshstk -mno-tbm -mno-tsxldtrk -mvaes -mno-waitpkg
 -mwbnoinvd -mxsave -mxsavec -mxsaveopt -mxsaves -mno-amx-tile
 -mno-amx-int8 -mno-amx-bf16 -mno-uintr -mno-hreset -mno-kl -mno-widekl
 -mno-avxvnni -mno-avxifma -mno-avxvnniint8 -mno-avxneconvert
 -mno-cmpccxadd -mno-amx-fp16 -mno-prefetchi -mno-raoint
 -mno-amx-complex --param l1-cache-size=32 --param l1-cache-line-size=64
 --param l2-cache-size=512 -mtune=znver3 -fno-optimize-sibling-calls -O2
 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong
 -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection
 -Werror=return-type -flto=auto -g -D_GNU_SOURCE
 -DGDK_DISABLE_DEPRECATION_WARNINGS -DGLIB_DISABLE_DEPRECATION_WARNINGS
 -pipe -Wno-pointer-sign -Wno-unused-variable -Wno-unused-label
 -DPDMP_BASE='\''"emacs-gtk"'\''' LDFLAGS=-Wl,-O2 'CXX=sccache c++'
 PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'

>From 1ba2ce9320513efa0fb4b2d6a5022bb9d635af68 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Bidar?= <[email-masked]>
Date: Wed, 18 Dec 2024 16:07:34 +0200
Subject: [PATCH] * lisp/files.el (auto-mode-alist): Include gdbinit too

Since gdb 11.1 .gdbinit can be also called gdbinit saved inside
$XDG_CONFIG_HOME or $HOME/Library/Preferences/gdb on Apple Hosts.

https://lists.gnu.org/archive/html/info-gnu/2021-09/msg00007.html
---
 lisp/files.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/files.el b/lisp/files.el
index 9f13804540b..6fe037f30e7 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -3001,11 +3001,12 @@ auto-mode-alist
      ("\\.css\\'" . css-mode)
      ("\\.mixal\\'" . mixal-mode)
      ("\\.gcov\\'" . compilation-mode)
-     ;; Besides .gdbinit, gdb documents other names to be usable for init
+     ;; gdbinit can be gdbinit or .gdbinit the exact prefix does not matter.
+     ;; Besides gdbinit, gdb documents other names to be usable for init
      ;; files, cross-debuggers can use something like
      ;; .PROCESSORNAME-gdbinit so that the host and target gdbinit files
      ;; don't interfere with each other.
-     ("/\\.[a-z0-9-]*gdbinit" . gdb-script-mode)
+     ("/[.a-z0-9-]*gdbinit" . gdb-script-mode)
      ;; GDB 7.5 introduced OBJFILE-gdb.gdb script files; e.g. a file
      ;; named 'emacs-gdb.gdb', if it exists, will be automatically
      ;; loaded when GDB reads an objfile called 'emacs'.
-- 
2.47.1