-;; debbugs-reference.el --- use debbugs-gnu browsing bug references
+;; debbugs-browse.el --- browse bug URLs with debbugs-gnu or debbugs-org
;; Copyright (C) 2015 Free Software Foundation, Inc.
;;; Commentary:
-;; This file provides minor modes for putting clickable overlays on
-;; references to bugs. It uses bug-reference.el, but changes
-;; buffer-local the browser to present the bugs to `debbugs-gnu-bugs'.
+;; This file provides a minor mode for browsing bug URLs with
+;; `debbugs-gnu-bugs' or `debbugs-org-bugs'.
;;; Code:
-;;;###autoload
+(defcustom debbugs-browse-function 'debbugs-gnu-bugs
+ "The debbugs function used for showing bugs.
+This can be either `debbugs-gnu-bugs' or `debbugs-org-bugs'."
+ :group 'debbugs-gnu
+ :type '(choice (const debbugs-gnu-bugs)
+ (const debbugs-org-bugs))
+ :version "25.1")
+
(defun debbugs-browse-url (url &optional _new-window)
(when (and (stringp url)
(string-match
(regexp-quote "http://debbugs.gnu.org/")
(regexp-quote "cgi/bugreport.cgi?bug="))
url))
- (debbugs-gnu-bugs (string-to-number (match-string 2 url)))
+ (funcall debbugs-browse-function (string-to-number (match-string 2 url)))
;; Return t for add-function mechanery.
t))
;;;###autoload
-(define-minor-mode debbugs-reference-mode
- "Toggle hyperlinking bug references in the buffer (Bug Reference mode).
-With a prefix argument ARG, enable Bug Reference mode if ARG is
+(define-minor-mode debbugs-browse-mode
+ "Browse GNU Debbugs bug URLs with debbugs-gnu or debbugs-org.
+With a prefix argument ARG, enable Debbugs Browse mode if ARG is
positive, and disable it otherwise. If called from Lisp, enable
-the mode if ARG is omitted or nil."
- nil
- ""
- nil
- (if debbugs-reference-mode
- (add-function
- :before-until (local 'browse-url-browser-function) 'debbugs-browse-url)
- (remove-function (local 'browse-url-browser-function) 'debbugs-browse-url)))
-
-;;;###autoload
-(define-minor-mode debbugs-reference-prog-mode
- "Like `debbugs-reference-mode', but only buttonize in comments and strings."
+the mode if ARG is omitted or nil.
+The customer option `debbugs-browse-function' controls, which of
+the two packages is used for showing bugs."
nil
""
nil
- (if debbugs-reference-prog-mode
+ (if debbugs-browse-mode
(add-function
:before-until (local 'browse-url-browser-function) 'debbugs-browse-url)
(remove-function (local 'browse-url-browser-function) 'debbugs-browse-url)))
-(provide 'debbugs-reference)
-;;; debbugs-reference.el ends here
+(provide 'debbugs-browse)
+;;; debbugs-browse.el ends here
-This is debbugs-ug.info, produced by makeinfo version 5.2 from
+This is debbugs-ug.info, produced by makeinfo version 5.0 from
debbugs-ug.texi.
Copyright (C) 2015 Free Software Foundation, Inc.
* Retrieving Bugs:: How to retrieve bugs.
* Searching Bugs:: How to search in the debbugs database.
-* Layout:: How to results are presented.
-* Minor Modes:: How to use 'debbugs' in files.
+* Layout:: How the results are presented.
+* Minor Mode:: How to use browse bug URLs.
* Command Index:: Debbugs commands.
* Variable Index:: User options and variables.
are not supported.
\1f
-File: debbugs-ug.info, Node: Layout, Next: Minor Modes, Prev: Searching Bugs, Up: Top
+File: debbugs-ug.info, Node: Layout, Next: Minor Mode, Prev: Searching Bugs, Up: Top
3 Layout
********
email address. The tag to be set is also read interactively.
\1f
-File: debbugs-ug.info, Node: Minor Modes, Next: Command Index, Prev: Layout, Up: Top
+File: debbugs-ug.info, Node: Minor Mode, Next: Command Index, Prev: Layout, Up: Top
-4 Minor Modes
-*************
+4 Minor Mode
+************
Emacs uses 'bug-reference.el' for adding hyperlinks to bugs in files
like 'ChangeLog', or in commentary sections of other files. The
-reference to such bugs have a specialized format, 'Bug#12345'. The
+reference to such bugs have a specialized format, <Bug#12345>. The
hyperlinks are implemented as minor modes 'bug-reference-mode' and
'bug-reference-prog-mode'.
- This package adds two other minor modes on top of them,
-'debbugs-reference-mode' and 'debbugs-reference-prog-mode'. They work
-like the 'bug-reference-*' modes, but instead of opening a browser for a
-given bug reference, they open a corresponding bug report buffer.
+ This package adds a new minor mode 'debbugs-browse-mode' on top of
+them. Instead of using the default built-in Emacs browser for a given
+bug reference, it opens a corresponding bug report buffer. The customer
+option 'debbugs-browse-function' controls, whether 'debbugs-gnu-bugs' or
+'debbugs-org-bugs' is called.
+
+ This minor mode is applicable for all URLs, not only bug references.
+Any URL with the format <http://debbugs.gnu.org/12345> will be shown in
+a bug report buffer, when 'debbugs-browse-mode' is enabled.
\1f
-File: debbugs-ug.info, Node: Command Index, Next: Variable Index, Prev: Minor Modes, Up: Top
+File: debbugs-ug.info, Node: Command Index, Next: Variable Index, Prev: Minor Mode, Up: Top
Command Index
*************
\0\b[index\0\b]
* Menu:
+* debbugs-browse-mode: Minor Mode. (line 12)
* debbugs-gnu: Retrieving Bugs. (line 14)
* debbugs-gnu-bugs: Retrieving Bugs. (line 68)
* debbugs-gnu-search: Searching Bugs. (line 10)
* debbugs-org: Retrieving Bugs. (line 16)
* debbugs-org-bugs: Retrieving Bugs. (line 69)
* debbugs-org-search: Searching Bugs. (line 11)
-* debbugs-reference-mode: Minor Modes. (line 12)
-* debbugs-reference-prog-mode: Minor Modes. (line 12)
\1f
File: debbugs-ug.info, Node: Variable Index, Next: Key Index, Prev: Command Index, Up: Top
\0\b[index\0\b]
* Menu:
+* debbugs-browse-function: Minor Mode. (line 12)
* debbugs-gnu-all-packages: Retrieving Bugs. (line 35)
* debbugs-gnu-all-severities: Retrieving Bugs. (line 26)
* debbugs-gnu-default-hits-per-page: Retrieving Bugs. (line 61)
\1f
Tag Table:
Node: Top\7f1087
-Node: Retrieving Bugs\7f2627
-Node: Searching Bugs\7f6149
-Ref: Searching Bugs-Footnote-1\7f10018
-Ref: Searching Bugs-Footnote-2\7f10106
-Node: Layout\7f10197
-Node: Tabulated Lists\7f10673
-Node: TODO Items\7f13107
-Node: Control Messages\7f14372
-Node: Minor Modes\7f16532
-Node: Command Index\7f17220
-Node: Variable Index\7f17955
-Node: Key Index\7f18471
+Node: Retrieving Bugs\7f2625
+Node: Searching Bugs\7f6147
+Ref: Searching Bugs-Footnote-1\7f10016
+Ref: Searching Bugs-Footnote-2\7f10104
+Node: Layout\7f10195
+Node: Tabulated Lists\7f10670
+Node: TODO Items\7f13104
+Node: Control Messages\7f14369
+Node: Minor Mode\7f16529
+Node: Command Index\7f17467
+Node: Variable Index\7f18128
+Node: Key Index\7f18717
\1f
End Tag Table
@menu
* Retrieving Bugs:: How to retrieve bugs.
* Searching Bugs:: How to search in the debbugs database.
-* Layout:: How to results are presented.
-* Minor Modes:: How to use @code{debbugs} in files.
+* Layout:: How the results are presented.
+* Minor Mode:: How to use browse bug URLs.
* Command Index:: Debbugs commands.
* Variable Index:: User options and variables.
@end table
-@node Minor Modes
-@chapter Minor Modes
+@node Minor Mode
+@chapter Minor Mode
Emacs uses @file{bug-reference.el} for adding hyperlinks to bugs in
files like @file{ChangeLog}, or in commentary sections of other files.
The reference to such bugs have a specialized format,
-@samp{Bug#12345}. The hyperlinks are implemented as minor modes
+@uref{Bug#12345}. The hyperlinks are implemented as minor modes
@code{bug-reference-mode} and @code{bug-reference-prog-mode}.
-@findex debbugs-reference-mode
-@findex debbugs-reference-prog-mode
-This package adds two other minor modes on top of them,
-@code{debbugs-reference-mode} and @code{debbugs-reference-prog-mode}.
-They work like the @code{bug-reference-*} modes, but instead of
-opening a browser for a given bug reference, they open a corresponding
-bug report buffer.
+@findex debbugs-browse-mode
+@vindex debbugs-browse-function
+This package adds a new minor mode @code{debbugs-browse-mode} on top
+of them. Instead of using the default built-in Emacs browser for a
+given bug reference, it opens a corresponding bug report buffer. The
+customer option @code{debbugs-browse-function} controls, whether
+@code{debbugs-gnu-bugs} or @code{debbugs-org-bugs} is called.
+
+This minor mode is applicable for all URLs, not only bug references.
+Any URL with the format @uref{http://debbugs.gnu.org/12345} will be
+shown in a bug report buffer, when @code{debbugs-browse-mode} is
+enabled.
@node Command Index
@printindex ky
@bye
+
+@c Local Variables:
+@c bug-reference-url-format: "http://debbugs.gnu.org/%s"
+@c eval: (bug-reference-mode)
+@c eval: (debbugs-browse-mode)
+@c End: