X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=blobdiff_plain;f=lurk.el;h=05e7da3c4340cc1d45b48e60220ecefe9b395842;hb=fc4f780770d4f903983b0ae04b47e180a461987a;hp=e2d175ecb8736dfdabc4b0a4103ec0da1726f254;hpb=b48c2617b0dace85c5a16dcd8fe081c336878d0c;p=lurk.git diff --git a/lurk.el b/lurk.el index e2d175e..05e7da3 100644 --- a/lurk.el +++ b/lurk.el @@ -107,6 +107,19 @@ (defvar lurk-debug nil "If non-nil, enable debug mode.") + +;;; Utility procedures +;; + +(defun lurk--filtered-join (&rest args) + (string-join (seq-filter (lambda (el) el) args) " ")) + +(defun lurk--as-string (obj) + (if obj + (with-output-to-string (princ obj)) + nil)) + + ;;; Network process ;; @@ -182,11 +195,6 @@ ;;; Server messages ;; -(defun lurk--as-string (obj) - (if obj - (with-output-to-string (princ obj)) - nil)) - (defun lurk-msg (tags src cmd &rest params) (list (lurk--as-string tags) (lurk--as-string src) @@ -235,9 +243,6 @@ portion of the source component of the message, as LURK doesn't use this.") (apply #'lurk-msg (append (list tags src cmd) params))) (error "Failed to parse string " string))) -(defun lurk--filtered-join (&rest args) - (string-join (seq-filter (lambda (el) el) args) " ")) - (defun lurk-msg->string (msg) (let ((tags (lurk-msg-tags msg)) (src (lurk-msg-src msg)) @@ -368,22 +373,25 @@ portion of the source component of the message, as LURK doesn't use this.") "Marker for prompt position in LURK buffer.") (defun lurk-setup-header () - (setq-local header-line-format - '(:eval - (let ((proc (get-process "lurk"))) - (if proc - (concat - "Host: " (car (process-contact proc)) - ", Context: " - (if lurk-current-context - (concat - lurk-current-context - " (" - (number-to-string - (length (lurk-get-context-users lurk-current-context))) - " users)") - "Server")) - "No connection"))))) + (with-current-buffer "*lurk*" + (setq-local header-line-format + '((:eval + (let ((proc (get-process "lurk"))) + (if proc + (concat + "Host: " (car (process-contact proc)) + ", Context: " + (if lurk-current-context + (concat + lurk-current-context + " (" + (number-to-string + (length (lurk-get-context-users lurk-current-context))) + " users)") + "Server")) + "No connection"))) + (:eval + (if lurk-zoomed " [ZOOMED]" "")))))) (defun lurk-setup-buffer () (with-current-buffer (get-buffer-create "*lurk*") @@ -544,8 +552,8 @@ portion of the source component of the message, as LURK doesn't use this.") (opt (group (: ":" (+ digit)))) (opt (group (: "/" (opt - (* (any alnum "-/.,#:%=&_?~@")) - (any alnum "-/#:%=&_~@"))))))) + (* (any alnum "-/.,#:%=&_?~@+")) + (any alnum "-/#:%=&_~@+"))))))) "Imperfect regex used to find URLs in plain text.") (defun lurk-click-url (button)