+ nil
+ lurk-error-prefix " "
+ (apply #'concat messages)))
+
+(defun lurk-highlight-context (context)
+ (maphash
+ (lambda (this-context facelist)
+ (if (equal this-context context)
+ (setcar facelist 'lurk-text)
+ (setcar facelist 'lurk-faded)))
+ lurk-context-facelists)
+ (force-window-update "*lurk*"))
+
+(defun lurk-zoom-in (context)
+ (with-current-buffer "*lurk*"
+ (maphash
+ (lambda (this-context _)
+ (when this-context
+ (let ((this-context-atom (intern this-context)))
+ (if (equal this-context context)
+ (remove-from-invisibility-spec this-context-atom)
+ (add-to-invisibility-spec this-context-atom)))))
+ lurk-context-facelists)
+ (force-window-update "*lurk*")))
+
+(defun lurk-zoom-out ()
+ (with-current-buffer "*lurk*"
+ (maphash
+ (lambda (this-context _)
+ (let ((this-context-atom (if this-context (intern this-context) nil)))
+ (remove-from-invisibility-spec this-context-atom)))
+ lurk-context-facelists)
+ (force-window-update "*lurk*")))
+
+(defconst lurk-url-regex
+ (rx (:
+ (group (+ alpha))
+ "://"
+ (group (or (+ (any alnum "." "-"))
+ (+ (any alnum ":"))))
+ (opt (group (: ":" (+ digit))))
+ (opt (group (: "/"
+ (opt
+ (* (any alnum ",.-~/@|:%#=&_"))
+ (+ (any alnum "-~/@|:%#=&")))))))))
+
+(defun lurk-click-url (button)
+ (browse-url (button-get button 'url)))
+
+(defun lurk-buttonify-urls (string)
+ "Turn substrings which look like urls in STRING into clickable buttons."
+ (with-temp-buffer
+ (insert string)
+ (goto-char (point-min))
+ (while (re-search-forward lurk-url-regex nil t)
+ (let ((url (match-string 0)))
+ (make-text-button (match-beginning 0)
+ (match-end 0)
+ 'action #'lurk-click-url
+ 'url url
+ 'follow-link t
+ 'face 'button
+ 'help-echo "Open URL in browser.")))
+ (buffer-string)))
+