1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-12 14:30:42 -08:00
emacs/doc
Tassilo Horn ccc9bd774c bug-reference-bug-regexp now defines a contract for the overlay region
Formerly, bug-reference-fontify placed the overlay on the complete
match of bug-reference-bug-regexp.  That made it impossible to encode
constraints like "must not match at BOL" in the regexp without messing
up fontification.  Therefore, now it establishes the contract that
subexpression 1 defines the overlay region.  Subexpression 2 must
still match the part of the bug reference injected into
bug-reference-url-format if that's a string.  If its a function, the
interpretation of subexpressions > 1 is up to the function.

For backwards compatibility, bug-reference-fontify checks if the
bounds of subexpression 2..10 are within the bounds of subexpession
1.  If not, or subexpression 1 doesn't even exist/match, we fall back
to placing the overlay from (match-beginning 0) to (match-end 0) but
issue a warning.

* lisp/progmodes/bug-reference.el (bug-reference-bug-regexp): Document
contract that subexpression 1 defines the overlay region and adapt the
default value accordingly.
(bug-reference--nonconforming-regexps): New internal variable.
(bug-reference--overlay-bounds): New function.
(bug-reference-fontify): Place overlay on subexpression 1's bounds if
bug-reference-bug-regexp conforms to the documented contract.
(bug-reference--setup-from-vc-alist): Adapt regexps to new contract.
* doc/emacs/maintaining.texi (Bug Reference): Adapt regexp used in
example.
2021-09-11 11:51:14 +02:00
..
emacs bug-reference-bug-regexp now defines a contract for the overlay region 2021-09-11 11:51:14 +02:00
lispintro ; Fix Texinfo markup of a recent change 2021-08-21 17:15:43 +03:00
lispref Improve documentation of line truncation and wrapping 2021-09-04 13:34:32 +03:00
man * doc/man/emacs.1.in: Minor fixes. 2021-06-08 02:00:29 +02:00
misc Clarify Gnus vs. font locking in the Gnus manual 2021-09-09 15:42:00 +02:00