+(defun lurk--start-of-final-line ()
+ (with-current-buffer "*lurk*"
+ (save-excursion
+ (goto-char (point-max))
+ (line-beginning-position))))
+
+(defun lurk-scroll-windows-to-last-line ()
+ (with-current-buffer "*lurk*"
+ (dolist (window (get-buffer-window-list))
+ (if (>= (window-point window) (lurk--start-of-final-line))
+ (with-selected-window window
+ (recenter -1))))))
+
+(defun lurk-make-context-button (context &optional label)
+ (with-temp-buffer
+ (insert-text-button (or label context)
+ 'action #'lurk--context-button-action
+ 'follow-link t
+ 'help-echo "Switch context.")
+ (buffer-string)))
+
+(defun lurk--context-button-action (button)
+ (let ((context (button-get button 'context)))
+ (if (eq lurk-current-context context)
+ (lurk-toggle-zoom)
+ (lurk-set-current-context context))))
+