From: Tim Vaughan Date: Tue, 6 Jul 2021 08:05:43 +0000 (+0200) Subject: Added timestamp face. X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=commitdiff_plain;h=d90f1a6c0bd8c21ce504f64f7f4e66ccd3289ed3;p=lurk.git Added timestamp face. --- diff --git a/lurk.el b/lurk.el index 0c9c31b..cad38b9 100644 --- a/lurk.el +++ b/lurk.el @@ -77,6 +77,10 @@ '((t :inherit org-agenda-dimmed-todo-face)) "Face used for faded Lurk text.") +(defface lurk-timestamp + '((t :inherit org-agenda-dimmed-todo-face)) + "Face used for timestamps.") + (defface lurk-error '((t :inherit font-lock-regexp-grouping-construct)) "Face used for Lurk error text.") @@ -160,7 +164,7 @@ (defun lurk-send-msg (msg) (if lurk-debug - (lurk-display-string nil (lurk-msg->string msg))) + (lurk-display-string nil nil (lurk-msg->string msg))) (let ((proc (get-process "lurk"))) (if (and proc (eq (process-status proc) 'open)) (process-send-string proc (concat (lurk-msg->string msg) "\r\n")) @@ -397,7 +401,7 @@ portion of the source component of the message, as LURK doesn't use this.") (puthash context facelist lurk-context-facelists)) facelist)) -(defun lurk-display-string (context &rest strings) +(defun lurk-display-string (context prefix &rest strings) (with-current-buffer (get-buffer-create "*lurk*") (save-excursion (goto-char lurk-prompt-marker) @@ -408,7 +412,7 @@ portion of the source component of the message, as LURK doesn't use this.") (context-atom (if context (intern context) nil))) (insert-before-markers (propertize (concat (format-time-string "%H:%M") " ") - 'face (lurk-get-context-facelist context) + 'face 'lurk-timestamp 'read-only t 'context context 'invisible context-atom) @@ -424,7 +428,7 @@ portion of the source component of the message, as LURK doesn't use this.") to (if (equal to lurk-nick) from to)))) (lurk-display-string - context + context nil (pcase (lurk-get-context-type to) ('channel (concat to " <" from "> ")) ('nick (concat "[" from " -> " to "] ")) @@ -437,19 +441,19 @@ portion of the source component of the message, as LURK doesn't use this.") to (if (equal to lurk-nick) from to)))) (lurk-display-string - context + context nil "* " from " " action-text))) (defun lurk-display-notice (context &rest notices) (lurk-display-string - context + context nil lurk-notice-prefix " " (apply #'concat notices))) (defun lurk-display-error (&rest messages) (lurk-display-string - nil + nil nil lurk-error-prefix " " (apply #'concat messages))) @@ -520,7 +524,7 @@ portion of the source component of the message, as LURK doesn't use this.") (defun lurk-eval-msg-string (string) (if lurk-debug - (lurk-display-string nil string)) + (lurk-display-string nil nil string)) (let* ((msg (lurk-string->msg string))) (pcase (lurk-msg-cmd msg) ("PING"