From e17cc751baa17f142fbc41710bf645f6fdc64a80 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Sun, 13 Jun 2021 21:10:25 +0200 Subject: [PATCH] Add mouse properties to activity string * rcirc.el (rcirc-activity-string): Allow clicking on string --- lisp/net/rcirc.el | 16 ++++++++++------ 1 file 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 (defvar rcirc-update-activity-string-hook nil "Hook run whenever the activity string is updated.") -;; TODO: add mouse properties (defun rcirc-update-activity-string () "Update mode-line string." (let* ((pair (rcirc-split-activity rcirc-activity)) @@ -2238,12 +2237,17 @@ activity. Only run if the buffer is not visible and (let ((s (substring-no-properties (rcirc-short-buffer-name b)))) (with-current-buffer b (dolist (type rcirc-activity-types) - (rcirc-add-face 0 (length s) - (cl-case type + (rcirc-facify s (cl-case type (nick 'rcirc-track-nick) - (keyword 'rcirc-track-keyword)) - s))) - s)) + (keyword 'rcirc-track-keyword))))) + (let ((map (make-mode-line-mouse-map + 'mouse-1 + (lambda () + (interactive) + (pop-to-buffer b))))) + (propertize s + 'mouse-face 'mode-line-highlight + 'local-map map)))) buffers ",")) (defun rcirc-short-buffer-name (buffer) -- 2.39.2