diff options
| author | Juri Linkov | 2009-01-14 00:37:49 +0000 |
|---|---|---|
| committer | Juri Linkov | 2009-01-14 00:37:49 +0000 |
| commit | 1cec8b5fa6975889baa07242fecc259b6cc8c86a (patch) | |
| tree | d86e90146a79f8657a1502acd5aad18919631d63 /lisp/progmodes/bug-reference.el | |
| parent | a372b1a24fd81e0225218ffd7fbb60cee99904b5 (diff) | |
| download | emacs-1cec8b5fa6975889baa07242fecc259b6cc8c86a.tar.gz emacs-1cec8b5fa6975889baa07242fecc259b6cc8c86a.zip | |
(bug-reference-fontify): Check for
non-nil `bug-reference-url-format' before putting an overlay
property `bug-reference-url'.
(bug-reference-mode, bug-reference-prog-mode): Don't check for
`bug-reference-url-format'. Doc fix. (Bug#1744)
Diffstat (limited to 'lisp/progmodes/bug-reference.el')
| -rw-r--r-- | lisp/progmodes/bug-reference.el | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/lisp/progmodes/bug-reference.el b/lisp/progmodes/bug-reference.el index 5453fd0d082..98e0dddb50a 100644 --- a/lisp/progmodes/bug-reference.el +++ b/lisp/progmodes/bug-reference.el | |||
| @@ -85,9 +85,11 @@ There is no default setting for this, it must be set per file.") | |||
| 85 | (let ((overlay (make-overlay (match-beginning 0) (match-end 0) | 85 | (let ((overlay (make-overlay (match-beginning 0) (match-end 0) |
| 86 | nil t nil))) | 86 | nil t nil))) |
| 87 | (overlay-put overlay 'category 'bug-reference) | 87 | (overlay-put overlay 'category 'bug-reference) |
| 88 | (overlay-put overlay 'bug-reference-url | 88 | ;; Don't put a link if format is undefined |
| 89 | (format bug-reference-url-format | 89 | (when bug-reference-url-format |
| 90 | (match-string-no-properties 1))))))))) | 90 | (overlay-put overlay 'bug-reference-url |
| 91 | (format bug-reference-url-format | ||
| 92 | (match-string-no-properties 1)))))))))) | ||
| 91 | 93 | ||
| 92 | ;; Taken from button.el. | 94 | ;; Taken from button.el. |
| 93 | (defun bug-reference-push-button (&optional pos use-mouse-action) | 95 | (defun bug-reference-push-button (&optional pos use-mouse-action) |
| @@ -108,14 +110,12 @@ There is no default setting for this, it must be set per file.") | |||
| 108 | 110 | ||
| 109 | ;;;###autoload | 111 | ;;;###autoload |
| 110 | (define-minor-mode bug-reference-mode | 112 | (define-minor-mode bug-reference-mode |
| 111 | "Minor mode to buttonize bugzilla references in the current buffer. | 113 | "Minor mode to buttonize bugzilla references in the current buffer." |
| 112 | Requires `bug-reference-url-format' to be set in the buffer." | ||
| 113 | nil | 114 | nil |
| 114 | "" | 115 | "" |
| 115 | nil | 116 | nil |
| 116 | (if bug-reference-mode | 117 | (if bug-reference-mode |
| 117 | (when bug-reference-url-format | 118 | (jit-lock-register #'bug-reference-fontify) |
| 118 | (jit-lock-register #'bug-reference-fontify)) | ||
| 119 | (jit-lock-unregister #'bug-reference-fontify) | 119 | (jit-lock-unregister #'bug-reference-fontify) |
| 120 | (save-restriction | 120 | (save-restriction |
| 121 | (widen) | 121 | (widen) |
| @@ -128,8 +128,7 @@ Requires `bug-reference-url-format' to be set in the buffer." | |||
| 128 | "" | 128 | "" |
| 129 | nil | 129 | nil |
| 130 | (if bug-reference-prog-mode | 130 | (if bug-reference-prog-mode |
| 131 | (when bug-reference-url-format | 131 | (jit-lock-register #'bug-reference-fontify) |
| 132 | (jit-lock-register #'bug-reference-fontify)) | ||
| 133 | (jit-lock-unregister #'bug-reference-fontify) | 132 | (jit-lock-unregister #'bug-reference-fontify) |
| 134 | (save-restriction | 133 | (save-restriction |
| 135 | (widen) | 134 | (widen) |