X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=blobdiff_plain;f=murk.el;h=b438aa3d93260d34b4ba67abc27875bf2e1dbc45;hb=85e71a387dc514bc7de3e497408ff211b458a657;hp=20d8b0634de393ee349862d66739a2850acdac1a;hpb=0a49a839c3407146f869af552dfdce60f31a4519;p=lurk.git diff --git a/murk.el b/murk.el index 20d8b06..b438aa3 100644 --- a/murk.el +++ b/murk.el @@ -599,6 +599,23 @@ The head of this list is always the current context.") 'invisible context-atom))))))) (murk-scroll-windows-to-last-line)) +(defun murk-click-context (button) + (murk-switch-to-context (button-get button 'context)) + (murk-highlight-current-context) + (murk-render-prompt) + (if murk-zoomed + (murk-zoom-in (murk-current-context)))) + +(defun murk-make-context-button (context &optional string) + (with-temp-buffer + (let ((label (or string (murk-context->string context)))) + (insert-text-button label + 'action #'murk-click-context + 'context context + 'follow-link t + 'help-echo "Switch context")) + (buffer-string))) + (defun murk-display-message (network from to text) (let ((context (if (string-prefix-p "#" to) (murk-get-context network to) @@ -608,7 +625,9 @@ The head of this list is always the current context.") (propertize (if (murk-network-context-p context) (concat "[" from "->" to "]") - (concat (murk-context->string context) " <" from ">")) + (concat + (murk-make-context-button context) + " <" from ">")) 'face (murk-get-context-facelist context)) text)))