GNU bug report logs -
#65883
[PATCH] .dir-locals.el: Update bug-reference configuration and document it.
Previous Next
Full log
View this message in rfc822 format
Maxim Cournoyer <maxim.cournoyer <at> gmail.com> writes:
> +;;; This extends the default expression (the first complicated blob) to also
> +;;; match URLs such as <https://issues.guix.gnu.org/58697> or
> +;;; <https://bugs.gnu.org/58697>. It is also extended to detect "Fixes:
> +;;; #NNNNN" git trailers.
> +(setq bug-reference-bug-regexp
> + (concat
> + "\\("
> + "\\(?:\\b\\(?:[Bb]ug ?#?\\|[Pp]atch ?#\\|[Ff]ixes:? ?#\\|\
> +RFE ?#\\|PR [a-z+-]+/\\)\\([0-9]+\\(?:#[0-9]+\\)?\\)\\)"
> + "\\|"
> + "\\(?:<https://bugs\\.gnu\\.org/\\(?2:[0-9]+\\)>\\)"
> + "\\)"))
Is there any reason not to use ‘rx’, rather than, as you say,
“complicated blobs’? Particularly with Emacs' requirement for ‘\\’
everywhere, regexps become even more like line noise.
If I'm reading this regexp right, for example, it could be:
--8<---------------cut here---------------start------------->8---
(setq bug-reference-bug-regexp2
(rx (group (or (seq word-boundary
(or (seq (char "Bb") "ug"
(zero-or-one " ")
(zero-or-one "#"))
(seq (char "Pp") "atch"
(zero-or-one " ")
"#")
(seq (char "Ff") "ixes"
(zero-or-one ":")
(zero-or-one " ") "#")
(seq "RFE"
(zero-or-one " ") "#")
(seq "PR "
(one-or-more (char "a-z+-")) "/"))
(group (one-or-more (char "0-9"))
(zero-or-one
(seq "#" (one-or-more
(char "0-9"))))))
(seq "<https://bugs.gnu.org/"
(group-n 2 (one-or-more (char "0-9")))
">")))))
--8<---------------cut here---------------end--------------->8---
-bjc
This bug report was last modified 1 year and 243 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.