diff options
| author | Miles Bader | 2013-07-30 19:21:31 +0900 |
|---|---|---|
| committer | Miles Bader | 2017-09-09 12:30:33 +0900 |
| commit | b464dab2af90b5ebcf1925fcca144a9ed294e6a3 (patch) | |
| tree | 855f9efbdf04f7ce6e30cd3ea10f996b4dea2670 | |
| parent | 79150f6086286294c9e5ed56df5b14c87129cde6 (diff) | |
| download | emacs-b464dab2af90b5ebcf1925fcca144a9ed294e6a3.tar.gz emacs-b464dab2af90b5ebcf1925fcca144a9ed294e6a3.zip | |
Use text-property buttons in rcirc-markup-urls
* lisp/net/rcirc.el (rcirc-markup-urls): Use `make-text-button'
instead of `make-button'; the former is much more efficient in large
buffers, and for the purposes of rcirc, changes no functionality.
| -rw-r--r-- | lisp/net/rcirc.el | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index c01ece9641d..60af1973ccb 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el | |||
| @@ -2499,12 +2499,12 @@ If ARG is given, opens the URL in a new browser window." | |||
| 2499 | (end (match-end 0)) | 2499 | (end (match-end 0)) |
| 2500 | (url (match-string-no-properties 0)) | 2500 | (url (match-string-no-properties 0)) |
| 2501 | (link-text (buffer-substring-no-properties start end))) | 2501 | (link-text (buffer-substring-no-properties start end))) |
| 2502 | (make-button start end | 2502 | (make-text-button start end |
| 2503 | 'face 'rcirc-url | 2503 | 'face 'rcirc-url |
| 2504 | 'follow-link t | 2504 | 'follow-link t |
| 2505 | 'rcirc-url url | 2505 | 'rcirc-url url |
| 2506 | 'action (lambda (button) | 2506 | 'action (lambda (button) |
| 2507 | (browse-url (button-get button 'rcirc-url)))) | 2507 | (browse-url (button-get button 'rcirc-url)))) |
| 2508 | ;; record the url if it is not already the latest stored url | 2508 | ;; record the url if it is not already the latest stored url |
| 2509 | (when (not (string= link-text (caar rcirc-urls))) | 2509 | (when (not (string= link-text (caar rcirc-urls))) |
| 2510 | (push (cons link-text start) rcirc-urls))))) | 2510 | (push (cons link-text start) rcirc-urls))))) |