Function: bug-reference-fontify
bug-reference-fontify is a byte-compiled function defined in
bug-reference.el.gz.
Signature
(bug-reference-fontify START END)
Documentation
Apply bug reference overlays to the region between START and END.
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/bug-reference.el.gz
(defun bug-reference-fontify (start end)
"Apply bug reference overlays to the region between START and END."
(save-excursion
(let* ((beg-line (progn (goto-char start) (line-beginning-position)))
(end-line (progn (goto-char end) (line-end-position)))
;; Reuse existing overlays overlays.
(overlays (bug-reference--overlays-in beg-line end-line)))
(goto-char beg-line)
(while (and (< (point) end-line)
(re-search-forward bug-reference-bug-regexp end-line 'move))
(when (or (not bug-reference-prog-mode)
;; This tests for both comment and string syntax.
(nth 8 (save-match-data (syntax-ppss))))
(let* ((bounds (bug-reference--overlay-bounds))
(overlay (or
(let ((ov (pop overlays)))
(when ov
(move-overlay ov (car bounds) (cdr bounds))
ov))
(let ((ov (make-overlay (car bounds) (cdr bounds)
nil t nil)))
(overlay-put ov 'category 'bug-reference)
ov))))
;; Don't put a link if format is undefined.
(when bug-reference-url-format
(overlay-put overlay 'bug-reference-url
(if (stringp bug-reference-url-format)
(format bug-reference-url-format
(match-string-no-properties 2))
(funcall bug-reference-url-format)))))))
;; Delete remaining but unused overlays.
(dolist (ov overlays)
(delete-overlay ov)))))