diff options
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ChangeLog | 1 | ||||
-rw-r--r-- | lisp/progmodes/bug-reference.el | 23 |
2 files changed, 11 insertions, 13 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4fc1e99454..9739db2ad4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -20,7 +20,6 @@ rather than mouse-1. (bug-reference-url-format): Autoload safe if string. (bug-reference-bug-regexp): Make space after "bug" optional. - (bug-reference-fontify): Save match data. * Makefile.in (all): Explicitly pass EMACS to sub-make, for some non-GNU makes. diff --git a/lisp/progmodes/bug-reference.el b/lisp/progmodes/bug-reference.el index d98604a2af..26ae2d57cc 100644 --- a/lisp/progmodes/bug-reference.el +++ b/lisp/progmodes/bug-reference.el @@ -77,18 +77,17 @@ There is no default setting for this, it must be set per file.") ;; Remove old overlays. (bug-reference-unfontify beg-line end-line) (goto-char beg-line) - (save-match-data - (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 (syntax-ppss))) - (let ((overlay (make-overlay (match-beginning 0) (match-end 0) - nil t nil))) - (overlay-put overlay 'category 'bug-reference) - (overlay-put overlay 'bug-reference-url - (format bug-reference-url-format - (match-string-no-properties 1)))))))))) + (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 (syntax-ppss))) + (let ((overlay (make-overlay (match-beginning 0) (match-end 0) + nil t nil))) + (overlay-put overlay 'category 'bug-reference) + (overlay-put overlay 'bug-reference-url + (format bug-reference-url-format + (match-string-no-properties 1))))))))) ;; Taken from button.el. (defun bug-reference-push-button (&optional pos use-mouse-action) |