| Server IP : 217.160.0.212 / Your IP : 216.73.216.15 Web Server : Apache System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64 User : sws1073854427 ( 1073854427) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /usr/share/emacs/28.2/lisp/progmodes/ |
Upload File : |
;ELC
;;; Compiled
;;; in Emacs version 28.2
;;; with all optimizations.
(custom-declare-group 'bug-reference nil "Hyperlinking references to bug reports." :group 'comm)
#@39 Keymap used by bug reference buttons.
(defvar bug-reference-map (byte-code "\300 \301\302\303#\210\301\304\303#\210\207" [make-sparse-keymap define-key [mouse-2] bug-reference-push-button "
"] 5) (#$ . 181))
#@686 Format used to turn a bug number into a URL.
The bug number is supplied as a string, so this should have a single %s.
This can also be a function designator; it is called without arguments
and should return a string.
It can use `match-string' to get parts matched against
`bug-reference-bug-regexp', specifically:
1. issue kind (bug, patch, rfe &c)
2. issue number.
There is no default setting for this, it must be set per file.
If you set it to a symbol in the file Local Variables section,
you need to add a `bug-reference-url-format' property to it:
(put \='my-bug-reference-url-format \='bug-reference-url-format t)
so that it is considered safe, see `enable-local-variables'.
(defvar bug-reference-url-format nil (#$ . 399))
(byte-code "\300\301\302\303#\210\304\305\306\307\310DD\311\312\313\314\315&\210\300\305\302\316#\207" [put bug-reference-url-format safe-local-variable #[257 "\211;\206
\2119\205
\211\300N\207" [bug-reference-url-format] 3 "\n\n(fn S)"] custom-declare-variable bug-reference-bug-regexp funcall function #[0 "\300\207" ["\\(\\b\\(?:[Bb]ug ?#?\\|[Pp]atch ?#\\|RFE ?#\\|PR [a-z+-]+/\\)\\([0-9]+\\(?:#[0-9]+\\)?\\)\\)"] 1 ""] "Regular expression matching bug references.\nThe first subexpression defines the region of the bug-reference\noverlay, i.e., the region being fontified and made clickable in\norder to browse the referenced bug in the corresponding project's\nissue tracker.\n\nIf `bug-reference-url-format' is set to a format string with\nsingle %s placeholder, the second subexpression must match\nthe (part of the) bug reference which needs to be injected in\nplace of the %s in order to form the bug's ticket URL.\n\nIf `bug-reference-url-format' is a function, the interpretation\nof the subexpressions larger than 1 is up to the function.\nHowever, it is checked that the bounds of all matching\nsubexpressions from 2 to 10 are within the bounds of the\nsubexpression 1 defining the overlay region. Larger\nsubexpressions may also be used by the function but may lay\noutside the bounds of subexpressions 1 and then don't contribute\nto the highlighted and clickable region." :type regexp :version "28.1" stringp] 8)
#@43 Set properties of bug reference overlays.
(defalias 'bug-reference-set-overlay-properties #[0 "\301\302\303\304#\210\301\302\305\306#\210\301\302\307\310#\210\301\302\311\312#\210\301\302\313#\210\301\302\314\304#\207" [bug-reference-map put bug-reference evaporate t face link mouse-face highlight help-echo "mouse-1, C-c RET: visit this bug" keymap follow-link] 4 (#$ . 2572)])
(bug-reference-set-overlay-properties)
#@84 Return bug reference overlays in the region between START and END.
(fn START END)
(defalias 'bug-reference--overlays-in #[514 "\300\301\"\211\203 \211@\302\303\"\304=\203 \211B\262A\266\202\202 \210\211\237\207" [nil overlays-in overlay-get category bug-reference] 8 (#$ . 2998)])
#@86 Remove bug reference overlays from the region between START and END.
(fn START END)
(defalias 'bug-reference-unfontify #[514 "\300\301\302\"\"\207" [mapc delete-overlay bug-reference--overlays-in] 7 (#$ . 3295)])
(defvar bug-reference--nonconforming-regexps nil)
(defalias 'bug-reference--overlay-bounds #[0 "\302\224\302\225\203A \211\203A \3032: \304\211\305X\2036 \211\224\203/ \211\224W\204* \211\225V\203/ \306\303\307\"\210\211T\262\202 \310\2620\203A B\207 \235\204U B\311\312\313\314\315 #\"\210\316\224\316\225B\207" [bug-reference-bug-regexp bug-reference--nonconforming-regexps 1 within-bounds 2 10 throw nil t display-warning bug-reference format-message "The value of `bug-reference-bug-regexp'\n\n %S\n\nin buffer %S doesn't conform to the contract specified by its\ndocstring. The subexpression 1 should define the region of the\nbug-reference overlay and cover all other subexpressions up to\nsubexpression 10." buffer-name 0] 8])
#@83 Apply bug reference overlays to the region between START and END.
(fn START END)
(defalias 'bug-reference-fontify #[514 "\212b\210\303 b\210\304 \305\"b\210`W\203u \306\307#\203u \203+ \310\311 8\203 \312 \211A\262\242\211\205@ \313@A#\210\211\262\206W \314@A\315\316\315%\317\320\321#\210\211\262\n\203p \317\322\n;\203l \323\n\324\325!\"\202n \n #\210\266\202 \211\211\205\207 \211@\326!\210A\266\202\202v \262\266\203)\207" [bug-reference-bug-regexp bug-reference-prog-mode bug-reference-url-format line-beginning-position line-end-position bug-reference--overlays-in re-search-forward move 8 syntax-ppss bug-reference--overlay-bounds move-overlay make-overlay nil t overlay-put category bug-reference bug-reference-url format match-string-no-properties 2 delete-overlay] 14 (#$ . 4266)])
#@90 Open URL corresponding to the bug reference at POS.
(fn &optional POS USE-MOUSE-ACTION)
(defalias 'bug-reference-push-button #[512 "\204 \301\302!\210\250\204( \303!\203( \304!r\305\211@\262!q\210\306\307!\310\")\207\311!\211\205E \211@\312\313\"\211\203= \314!\210\210A\266\202\202+ \207" [bug-reference-url-format user-error "You must customize some bug-reference variables; see Emacs info node Bug Reference" eventp event-start window-buffer bug-reference-push-button posn-point t overlays-at overlay-get bug-reference-url browse-url] 7 (#$ . 5091) (byte-code "\250\203 `\202\n C\207" [last-command-event] 1)])
#@38
(fn URL URL-RX BUG-RX BUG-URL-FMT)
(defalias 'bug-reference-maybe-setup-from-vc #[1028 "\302\"\2058 \303\300!\210\303\301!\210\304\305 G\306\245\307\211W\203. \310\"B\262\211T\262\202 \266\237!\262\211\207" [bug-reference-bug-regexp bug-reference-url-format string-match make-local-variable nil match-data 2 0 match-string] 10 (#$ . 5727)])
#@200 An alist for setting up `bug-reference-mode' based on VC URL.
This is like `bug-reference-setup-from-vc-alist' but generated
from a few default entries, and the value of
`bug-reference-forge-alist'.
(defvar bug-reference--setup-from-vc-alist nil (#$ . 6094))
#@432 An alist of forge instances.
Each entry has the form (HOST-DOMAIN FORGE-TYPE PROTOCOL).
HOST-DOMAIN is the host- and domain name, e.g., gitlab.com,
salsa.debian.org, or sr.ht.
FORGE-TYPE is the type of the forge, e.g., gitlab, gitea,
sourcehut, or github.
PROTOCOL is the protocol for accessing the forge's issue tracker,
usually "https" but for self-hosted forge instances not
accessible via the internet it might also be "http".
(defvar bug-reference-forge-alist '(("github.com" github "https") ("gitea.com" gitea "https") ("codeberg.org" gitea "https") ("gitlab.com" gitlab "https") ("framagit.org" gitlab "https") ("salsa.debian.org" gitlab "https") ("sr.ht" sourcehut "https")) (#$ . 6360))
(byte-code "\300\301\302\301\303\304#\305#\210\306\301\304\307\304\310%\210\306\301\304\311\304\312%\210\306\301\304\313\304\314%\210\306\301\304\315\304\316%\207" [defalias bug-reference--build-forge-setup-entry cl-generic-define (host-domain forge-type protocol) nil "Build an entry for `bug-reference--setup-from-vc-alist'.\nHOST-DOMAIN is the host- and domain name, e.g., gitlab.com, or\nsr.ht.\n\nFORGE-TYPE is the type of the forge, e.g., gitlab, gitea,\nsourcehut, or github.\n\nPROTOCOL is the protocol for accessing the forge's issue tracker,\nusually https but for self-hosted forge instances not accessible\nvia the internet it might also be http.\n\n(fn HOST-DOMAIN FORGE-TYPE PROTOCOL)" cl-generic-define-method (host-domain (_forge-type (eql github)) protocol) #[771 "\300\301!\302Q\303\304\305#E\207" ["[/@]" regexp-quote "[/:]\\([.A-Za-z0-9_/-]+\\)\\.git" "\\(\\([.A-Za-z0-9_/-]+\\)?\\(?:#\\)\\([0-9]+\\)\\)\\>" make-closure #[257 "\211A@\302\303\300\301$\207" [V0 V1 make-closure #[0 "\303\304\301\300\305\306!\206 \302\305\307!%\207" [V0 V1 V2 format "%s://%s/%s/issues/%s" match-string-no-properties 2 3] 7]] 7 "\n\n(fn GROUPS)"]] 9 "\n\n(fn HOST-DOMAIN FORGE-TYPE PROTOCOL)"] (host-domain (_forge-type (eql gitlab)) protocol) #[771 "\300\301!\302Q\303\304\305#E\207" ["[/@]" regexp-quote "[/:]\\([.A-Za-z0-9_/-]+\\)\\.git" "\\(\\([.A-Za-z0-9_/-]+\\)?\\([#!]\\)\\([0-9]+\\)\\)\\>" make-closure #[257 "\211A@\302\303\300\301$\207" [V0 V1 make-closure #[0 "\303\304\301\300\305\306!\206 \302\305\307!\310\230\203 \311\202 \312\305\313!&\207" [V0 V1 V2 format "%s://%s/%s/-/%s/%s" match-string-no-properties 2 3 "#" "issues/" "merge_requests/" 4] 8]] 7 "\n\n(fn GROUPS)"]] 9 "\n\n(fn HOST-DOMAIN FORGE-TYPE PROTOCOL)"] (host-domain (_forge-type (eql gitea)) protocol) #[771 "\300\301!\302Q\303\304\305#E\207" ["[/@]" regexp-quote "[/:]\\([.A-Za-z0-9_/-]+\\)\\.git" "\\(\\([.A-Za-z0-9_/-]+\\)?\\(?:#\\)\\([0-9]+\\)\\)\\>" make-closure #[257 "\211A@\302\303\300\301$\207" [V0 V1 make-closure #[0 "\303\304\301\300\305\306!\206 \302\305\307!%\207" [V0 V1 V2 format "%s://%s/%s/issues/%s" match-string-no-properties 2 3] 7]] 7 "\n\n(fn GROUPS)"]] 9 "\n\n(fn HOST-DOMAIN FORGE-TYPE PROTOCOL)"] (host-domain (_forge-type (eql sourcehut)) protocol) #[771 "\300\301!\302Q\303\304\305#E\207" ["[/@]\\(?:git\\|hg\\)." regexp-quote "[/:]\\(~[.A-Za-z0-9_/-]+\\)" "\\(\\(~[.A-Za-z0-9_/-]+\\)?\\(?:#\\)\\([0-9]+\\)\\)\\>" make-closure #[257 "\211A@\302\303\300\301$\207" [V0 V1 make-closure #[0 "\303\304\301\300\305\306!\206 \302\305\307!%\207" [V0 V1 V2 format "%s://todo.%s/%s/%s" match-string-no-properties 2 3] 7]] 7 "\n\n(fn GROUPS)"]] 9 "\n\n(fn HOST-DOMAIN FORGE-TYPE PROTOCOL)"]] 6)
#@255 Compute the `bug-reference--setup-from-vc-alist' value.
If REBUILD is non-nil, compute it again even if has been computed
already. The value contains a few default entries, and entries
generated from `bug-reference-forge-alist'.
(fn &optional REBUILD)
(defalias 'bug-reference--setup-from-vc-alist #[256 "\203\n \211\204\n \207\302\303\304E\305\306 \"B\211\207" [bug-reference--setup-from-vc-alist bug-reference-forge-alist "git\\.\\(?:sv\\|savannah\\)\\.gnu\\.org:" "\\(\\b\\(?:[Bb]ug ?#?\\)\\([0-9]+\\(?:#[0-9]+\\)?\\)\\)\\>" #[257 "\300\207" ["https://debbugs.gnu.org/%s"] 2 "https://debbugs.gnu.org/%s\n\n(fn _)"] mapcar #[257 "\300\301\"\207" [apply bug-reference--build-forge-setup-entry] 4 "\n\n(fn ENTRY)"]] 5 (#$ . 9784)])
#@472 An alist for setting up `bug-reference-mode' based on VC URL.
Each element has the form (URL-REGEXP BUG-REGEXP URL-FORMAT-FN).
URL-REGEXP is matched against the version control URL of the
current buffer's file. If it matches, BUG-REGEXP is set as
`bug-reference-bug-regexp'. URL-FORMAT-FN is a function of one
argument that receives a list of the groups 0 to N of matching
URL-REGEXP against the VCS URL and returns the value to be set as
`bug-reference-url-format'.
(defvar bug-reference-setup-from-vc-alist nil (#$ . 10529))
#@194 Try setting up `bug-reference-mode' based on VC information.
Test each configuration in `bug-reference-setup-from-vc-alist'
and `bug-reference--setup-from-vc-alist' and apply it if
applicable.
(defalias 'bug-reference-try-setup-from-vc #[0 "\206 \211\205
\303\304\"\211\205 \305\306\307#\310\"\211\205( \305\306\311\"\312\n\313 \"\"\207" [buffer-file-name default-directory bug-reference-setup-from-vc-alist vc-responsible-backend t seq-some make-closure #[257 "\3021\f \303\301\304\300$0\207\210\305\207" [V0 V1 (error) vc-call-backend repository-url nil] 6 "\n\n(fn REMOTE)"] ("upstream" nil) #[257 "\301\302\300#\207" [V0 apply bug-reference-maybe-setup-from-vc] 5 "\n\n(fn CONFIG)"] append bug-reference--setup-from-vc-alist] 8 (#$ . 11067)])
#@832 An alist for setting up `bug-reference-mode' in mail modes.
This takes action if `bug-reference-mode' is enabled in group and
message buffers of Emacs mail clients. Currently, Gnus and Rmail
are supported.
Each element has the form
(GROUP-REGEXP HEADER-REGEXP BUG-REGEXP URL-FORMAT)
GROUP-REGEXP is a regexp matched against the current mail folder
or newsgroup name. HEADER-REGEXP is a regexp matched against the
From, To, Cc, Newsgroup, and List-ID header values of the current
mail or newsgroup message. If any of those matches, BUG-REGEXP
is set as `bug-reference-bug-regexp' and URL-FORMAT is set as
`bug-reference-url-format'.
Note: In Gnus, if a summary buffer has been set up based on
GROUP-REGEXP, all article buffers opened from there will get the
same `bug-reference-url-format' and `bug-reference-url-format'.
(defvar bug-reference-setup-from-mail-alist (byte-code "\300\301\302BBC\207" ["\\<\\(auctex\\|emacs\\|gnus\\|orgmode\\|tramp\\)\\>" "\\(?:\\(?:-devel@gnu\\|@debbugs\\.gnu\\|ding\\.gnus\\)\\.org\\)" ("\\(\\b[Bb]ug ?#?\\([0-9]+\\(?:#[0-9]+\\)?\\)\\)" "https://debbugs.gnu.org/%s")] 3) (#$ . 11832))
#@398 Set up according to mail GROUP or HEADER-VALUES.
Group is a mail group/folder name and HEADER-VALUES is a list of
mail header values, e.g., the values of From, To, Cc, List-ID,
and Newsgroup.
If any GROUP-REGEXP or HEADER-REGEXP of
`bug-reference-setup-from-mail-alist' matches GROUP or any
element in HEADER-VALUES, the corresponding BUG-REGEXP and
URL-FORMAT are set.
(fn GROUP HEADER-VALUES)
(defalias 'bug-reference-maybe-setup-from-mail #[514 "\3042\201 \211\205~ \211@\203% \211@\203% \211@\305\306\307#)\266\203\204b \203w \211A@\203w \3102_ \211\205\\ \211@\211\203U A@\305\306\307#)\266\203\203U \311\310\306\"\210A\266\202\2024 \2620\203w \312\302!\210\3138\312\303!\210\3148\311\304\306\"\210A\266\202\202 \2620\207" [bug-reference-setup-from-mail-alist inhibit-changing-match-data bug-reference-bug-regexp bug-reference-url-format setup-done nil t string-match matching-header throw make-local-variable 2 3] 13 (#$ . 12967)])
#@160 Try setting up `bug-reference-mode' based on Gnus group or article.
Test each configuration in `bug-reference-setup-from-mail-alist'
and set it if applicable.
(defalias 'bug-reference-try-setup-from-gnus #[0 "\301\302!\205 \303\300!\205 \205 \304\305\306\"\210\307\310\"\207" [gnus-newsgroup-name derived-mode-p gnus-summary-mode boundp add-hook gnus-article-prepare-hook bug-reference--try-setup-gnus-article bug-reference-maybe-setup-from-mail nil] 3 (#$ . 13938)])
(defalias 'bug-reference--try-setup-gnus-article #[0 "\205\210 \306\307\310\"\205\210 \205\210 \n\205\210 \311\312 !!\205\210 \311\312\n!!\205\210 r q\210\3132\207 \203X \311!\203X \314\304!\210rq\210\f)\314\305!\210rq\210
)\f\203X
\203X \315\313\316\"\210\317r\312\n!q\210\212eb\210\320\211\203~ \211@\321!\211\203v \211B\262\210A\266\202\202d \210*\322\317\"\2620)\207" [bug-reference-mode gnus-article-buffer gnus-original-article-buffer gnus-summary-buffer bug-reference-bug-regexp bug-reference-url-format derived-mode-p gnus-article-mode gnus-summary-mode buffer-live-p get-buffer setup-done make-local-variable throw t nil ("list-id" "to" "from" "cc") mail-fetch-field bug-reference-maybe-setup-from-mail] 6])
#@319 Try setting up `bug-reference-mode' from the current rmail mail.
Guesses suitable `bug-reference-bug-regexp' and
`bug-reference-url-format' values by matching the current Rmail
file's name against GROUP-REGEXP and the values of List-Id, To,
From, and Cc against HEADER-REGEXP in
`bug-reference-setup-from-mail-alist'.
(defalias 'bug-reference-try-setup-from-rmail #[0 "\2053 \301\302!\2053 \303\212eb\210\304\211\203* \211@\305!\211\203\"