unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Tassilo Horn <tsdh@gnu.org>
To: emacs-devel@gnu.org
Subject: Bug-reference auto-configuration
Date: Wed, 17 Jun 2020 22:34:17 +0200	[thread overview]
Message-ID: <87d05xxwhi.fsf@gnu.org> (raw)

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



             reply	other threads:[~2020-06-17 20:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-17 20:34 Tassilo Horn [this message]
2020-06-18 15:21 ` Bug-reference auto-configuration Ted Zlatanov
2020-06-18 19:26   ` Tassilo Horn

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://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87d05xxwhi.fsf@gnu.org \
    --to=tsdh@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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/emacs.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).