'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)
(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)))