unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Bug-reference auto-configuration
@ 2020-06-17 20:34 Tassilo Horn
  2020-06-18 15:21 ` Ted Zlatanov
  0 siblings, 1 reply; 3+ messages in thread
From: Tassilo Horn @ 2020-06-17 20:34 UTC (permalink / raw)
  To: emacs-devel

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Bug-reference auto-configuration
  2020-06-17 20:34 Bug-reference auto-configuration Tassilo Horn
@ 2020-06-18 15:21 ` Ted Zlatanov
  2020-06-18 19:26   ` Tassilo Horn
  0 siblings, 1 reply; 3+ messages in thread
From: Ted Zlatanov @ 2020-06-18 15:21 UTC (permalink / raw)
  To: emacs-devel

On Wed, 17 Jun 2020 22:34:17 +0200 Tassilo Horn <tsdh@gnu.org> wrote: 

TH> I'd welcome some more testing.  You just have to enable
TH> `bug-reference-mode' or `bug-reference-prog-mode' and cross fingers,
TH> e.g.,

TH>   ;; Enable in prog mode buffers.
TH>   (add-hook 'prog-mode-hook #'bug-reference-prog-mode)

TH> and (for Gnus users)

TH>   ;; Enable in Gnus summary and article buffers.
TH>   (add-hook 'gnus-summary-mode-hook #'bug-reference-mode)
TH>   (add-hook 'gnus-article-mode-hook #'bug-reference-mode)

It looks good in my testing. Would this be the right use-package
invocation and hooks?

  (use-package bug-reference
    :hook
    (prog-mode . bug-reference-prog-mode)
    (gnus-mode . bug-reference-mode)
    (text-mode . bug-reference-mode))

Thanks
Ted



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Bug-reference auto-configuration
  2020-06-18 15:21 ` Ted Zlatanov
@ 2020-06-18 19:26   ` Tassilo Horn
  0 siblings, 0 replies; 3+ messages in thread
From: Tassilo Horn @ 2020-06-18 19:26 UTC (permalink / raw)
  To: emacs-devel

Ted Zlatanov <tzz@lifelogs.com> writes:

Hi Ted,

> TH> I'd welcome some more testing.  You just have to enable
> TH> `bug-reference-mode' or `bug-reference-prog-mode' and cross
> TH> fingers, e.g.,
>
> TH>   ;; Enable in prog mode buffers.
> TH>   (add-hook 'prog-mode-hook #'bug-reference-prog-mode)
>
> TH> and (for Gnus users)
>
> TH>   ;; Enable in Gnus summary and article buffers.
> TH>   (add-hook 'gnus-summary-mode-hook #'bug-reference-mode)
> TH>   (add-hook 'gnus-article-mode-hook #'bug-reference-mode)
>
> It looks good in my testing. Would this be the right use-package
> invocation and hooks?
>
>   (use-package bug-reference
>     :hook
>     (prog-mode . bug-reference-prog-mode)
>     (gnus-mode . bug-reference-mode)
>     (text-mode . bug-reference-mode))

Oh, I didn't know use-package's :hook functionality.  But anyway, that's
exactly what I do, too.

Bye,
Tassilo



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-06-18 19:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-17 20:34 Bug-reference auto-configuration Tassilo Horn
2020-06-18 15:21 ` Ted Zlatanov
2020-06-18 19:26   ` Tassilo Horn

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).