diff options
| author | Philip Kaludercic | 2021-06-13 21:10:25 +0200 |
|---|---|---|
| committer | Philip Kaludercic | 2021-06-14 00:21:48 +0200 |
| commit | e17cc751baa17f142fbc41710bf645f6fdc64a80 (patch) | |
| tree | cb63caa15f8382f2b8682b085157c5edcaf9fe87 | |
| parent | e61bdd5a96c2961dbbbdfc75a51ce573eaf71d1f (diff) | |
| download | emacs-e17cc751baa17f142fbc41710bf645f6fdc64a80.tar.gz emacs-e17cc751baa17f142fbc41710bf645f6fdc64a80.zip | |
Add mouse properties to activity string
* rcirc.el (rcirc-activity-string): Allow clicking on string
| -rw-r--r-- | lisp/net/rcirc.el | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index 400facf3440..9fdbf12cd89 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el | |||
| @@ -2211,7 +2211,6 @@ activity. Only run if the buffer is not visible and | |||
| 2211 | (defvar rcirc-update-activity-string-hook nil | 2211 | (defvar rcirc-update-activity-string-hook nil |
| 2212 | "Hook run whenever the activity string is updated.") | 2212 | "Hook run whenever the activity string is updated.") |
| 2213 | 2213 | ||
| 2214 | ;; TODO: add mouse properties | ||
| 2215 | (defun rcirc-update-activity-string () | 2214 | (defun rcirc-update-activity-string () |
| 2216 | "Update mode-line string." | 2215 | "Update mode-line string." |
| 2217 | (let* ((pair (rcirc-split-activity rcirc-activity)) | 2216 | (let* ((pair (rcirc-split-activity rcirc-activity)) |
| @@ -2238,12 +2237,17 @@ activity. Only run if the buffer is not visible and | |||
| 2238 | (let ((s (substring-no-properties (rcirc-short-buffer-name b)))) | 2237 | (let ((s (substring-no-properties (rcirc-short-buffer-name b)))) |
| 2239 | (with-current-buffer b | 2238 | (with-current-buffer b |
| 2240 | (dolist (type rcirc-activity-types) | 2239 | (dolist (type rcirc-activity-types) |
| 2241 | (rcirc-add-face 0 (length s) | 2240 | (rcirc-facify s (cl-case type |
| 2242 | (cl-case type | ||
| 2243 | (nick 'rcirc-track-nick) | 2241 | (nick 'rcirc-track-nick) |
| 2244 | (keyword 'rcirc-track-keyword)) | 2242 | (keyword 'rcirc-track-keyword))))) |
| 2245 | s))) | 2243 | (let ((map (make-mode-line-mouse-map |
| 2246 | s)) | 2244 | 'mouse-1 |
| 2245 | (lambda () | ||
| 2246 | (interactive) | ||
| 2247 | (pop-to-buffer b))))) | ||
| 2248 | (propertize s | ||
| 2249 | 'mouse-face 'mode-line-highlight | ||
| 2250 | 'local-map map)))) | ||
| 2247 | buffers ",")) | 2251 | buffers ",")) |
| 2248 | 2252 | ||
| 2249 | (defun rcirc-short-buffer-name (buffer) | 2253 | (defun rcirc-short-buffer-name (buffer) |