[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bug-reference auto-configuration
From: |
Tassilo Horn |
Subject: |
Bug-reference auto-configuration |
Date: |
Wed, 17 Jun 2020 22:34:17 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Hi all,
I've just pushed a feature for bug-reference.el. When
`bug-reference-mode' or `bug-reference-prog-mode' is activated and after
running its hook still no `bug-reference-url-format' is set, it'll try
to guess suitable values.
Currently, there are 2 such guessing function in place:
- `bug-reference-try-setup-from-vc' tries to guess the right values from
the URL of the file's version control repository.
- Savannah git projects get our GNU debbugs URL.
- GitHub and Gitlab get their issue trackers set with standard #18 bug
references (and !17 merge requests for Gitlab) and also
cross-project references such as namespace/project#19 are supported.
- It is easy to add new rules by adding entries to
`bug-reference-setup-from-vc-alist'.
- `bug-reference-try-setup-from-gnus' tries to guess the right values in
Gnus summary and article buffers by matching against the group name
and mail header values From, To, Cc, and List-ID.
- Currently, there's just one rule that should set the GNU debbugs URL
in any Emacs, Gnus, AUCTeX, or Tramp related group or article.
- Again, it's easy to add new rules by adding entries to
`bug-reference-setup-from-mail-alist'.
As the name suggests, that variable is not Gnus-related but I hope
someone volunteers to add similar setup functions for rmail and
other emacs mail clients which can use that variable, too.
Basically, the only MUA-specific thing that needs to be done is to
somehow get the mail-folder/newsgroup name and/or the interesting
mail header values From, To, Cc, and List-ID and call
`bug-reference--maybe-setup-from-mail'.
I'd welcome some more testing. You just have to enable
`bug-reference-mode' or `bug-reference-prog-mode' and cross fingers,
e.g.,
;; Enable in prog mode buffers.
(add-hook 'prog-mode-hook #'bug-reference-prog-mode)
and (for Gnus users)
;; Enable in Gnus summary and article buffers.
(add-hook 'gnus-summary-mode-hook #'bug-reference-mode)
(add-hook 'gnus-article-mode-hook #'bug-reference-mode)
Bye,
Tassilo
- Bug-reference auto-configuration,
Tassilo Horn <=