#1125864 nano: /usr/share/nano/debian/debian.nanorc regex does not match deb822 (.sources) APT files

Package:
nano
Source:
nano
Description:
small, friendly text editor inspired by Pico
Submitter:
Jan Niggemann
Date:
2026-01-18 15:29:02 UTC
Severity:
normal
Tags:
#1125864#5
Date:
2026-01-18 13:16:55 UTC
From:
To:
Package: nano
Version: 8.4-1 until latest

With trixie, Debian has transitioned to deb822-style APT sources stored as
/etc/apt/sources.list.d/*.sources, but nano's debian.nanorc still only
matches sources.list and *.list files.

Current regex:
  syntax sources.list "sources\.list(\.d/.*\.list)?(~|\.old|\.save)?$"

This does not highlight deb822 files such as:
  /etc/apt/sources.list.d/debian.sources

Proposed regex:
  syntax sources.list "sources\.list(\.d/.*\.(list|sources))?(~|\.old|\.save)?$"

This keeps backward compatibility while supporting the modern deb822 format
used by Debian 12+ and default in Debian 13 (trixie).

Expected result:
APT source files using deb822 receive proper syntax highlighting in nano.

Jan

#1125864#10
Date:
2026-01-18 15:15:56 UTC
From:
To:
Op 18-01-2026 om 14:16 schreef Jan Niggemann:

This is not enough to colorize also the *.sources files in the
deb822 format, as those files have an entirely different syntax
and thus need their own rules.  Maybe something like these:

   color green "^(Types|URIs|Suites|Components|Enabled|Signed-By)"
   color yellow "\<(deb(-src)?)\>"
   color lightcyan "https://\S+"
   color lightred "non-free\S*"
   color lightmagenta "/usr/share/\S+"

(To be inserted before the "# Comments." line.  Tested on
an example deb822 file, but probably far from complete.)

Benno