(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
;;
;;; 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)
(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))
"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*")