unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: brian via Guix-patches via <guix-patches@gnu.org>
To: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Cc: 65883@debbugs.gnu.org, ludo@gnu.org
Subject: [bug#65883] [PATCH] .dir-locals.el: Update bug-reference configuration and document it.
Date: Tue, 12 Sep 2023 10:20:10 -0400	[thread overview]
Message-ID: <87zg1rzd5x.fsf@spork.org> (raw)
In-Reply-To: <0f74c4468dae139ae2406b8200d0ba6bdc374455.1694490271.git.maxim.cournoyer@gmail.com> (Maxim Cournoyer's message of "Mon, 11 Sep 2023 23:44:31 -0400")

Maxim Cournoyer <maxim.cournoyer@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




  reply	other threads:[~2023-09-12 14:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-12  3:44 [bug#65883] [PATCH] .dir-locals.el: Update bug-reference configuration and document it Maxim Cournoyer
2023-09-12 14:20 ` brian via Guix-patches via [this message]
2023-09-12 14:34 ` brian via Guix-patches via
2023-09-17 20:45   ` bug#65883: " Maxim Cournoyer
2023-09-13 20:31 ` [bug#65883] " Ludovic Courtès
2023-09-14  3:20   ` Maxim Cournoyer
2023-09-19  8:08 ` Simon Tournier
2023-09-20 15:28   ` Maxim Cournoyer
2023-09-20 15:39     ` Simon Tournier
2023-09-25 16:13       ` Maxim Cournoyer
2023-09-25 16:24         ` Simon Tournier
2023-09-25 17:27           ` Maxim Cournoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zg1rzd5x.fsf@spork.org \
    --to=guix-patches@gnu.org \
    --cc=65883@debbugs.gnu.org \
    --cc=bjc@spork.org \
    --cc=ludo@gnu.org \
    --cc=maxim.cournoyer@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).