GNU bug report logs - #48037
28.0.50; add-change-log-entry does not detect name with digit

Previous Next

Package: emacs;

Reported by: Michael Albinus <michael.albinus <at> gmx.de>

Date: Mon, 26 Apr 2021 15:50:01 UTC

Severity: normal

Found in version 28.0.50

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 48037 <at> debbugs.gnu.org
Subject: bug#48037: 28.0.50; add-change-log-entry does not detect name with digit
Date: Tue, 27 Apr 2021 09:55:03 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

Hi Lars,

>
>>>>  (defcustom add-log-current-defun-header-regexp
>>>> -  "^\\([[:upper:]][[:upper:]_ ]*[[:upper:]_]\\|[-_[:alpha:]]+\\)[ \t]*[:=]"
>>>> +  "^\\([[:upper:]][[:upper:]_ ]*[[:upper:]_]\\|[-_[:alnum:]]+\\)[ \t]*[:=]"
>>>>    "Heuristic regexp used by `add-log-current-defun' for unknown major modes.
>
> [...]
>
>> Yes. However, the existing regexp hits also entries like
>>
>> -:
>>   stage: slow
>>
>> Looks also strange. So my proposal won't get worse. Remember,
>> add-log-current-defun-header-regexp is just a heuristic.
>
> Sure, but why not improve the regexp at the same time?  That is,
> require at least one [:alpha:] for an identifier -- I think that's
> pretty reasonable as heuristics go.

Wouldn't this be too complex for a simple heuristic? Something like

"^\\([[:upper:]][[:upper:]_ ]*[[:upper:]_]\\|[-_[:alnum:]]*[[:alpha:]][-_[:alnum:]]*\\)[ \t]*[:=]"

Note, that this regexp still doesn't fit all entries in gitlab-ci.yml,
for example entries with a dot, like '.job-template:'.

Best regards, Michael.




This bug report was last modified 4 years and 21 days ago.

Previous Next


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