From ebae073445d67c0570137f8b8ba972faa4f60538 Mon Sep 17 00:00:00 2001 From: "F. Jason Park" Date: Wed, 24 Nov 2021 03:10:20 -0800 Subject: [PATCH 1/3] Remove timestamp from erc-stamp sensor function * lisp/erc/erc-stamp.el (erc-add-timestamp): Add new text property called `erc-timestamp' to store lisp time object formerly ensconced in closure. (erc-echo-timestamp): Check text property for timestamp when not provided as second argument, which is now optional. --- lisp/erc/erc-stamp.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/erc/erc-stamp.el b/lisp/erc/erc-stamp.el index 7d31bc971e..1ef791c78b 100644 --- a/lisp/erc/erc-stamp.el +++ b/lisp/erc/erc-stamp.el @@ -179,7 +179,8 @@ erc-add-timestamp ;; be different on different entries (bug#22700). (list 'cursor-sensor-functions (list (lambda (_window _before dir) - (erc-echo-timestamp dir ct)))))))) + (erc-echo-timestamp dir))) + 'erc-timestamp ct))))) (defvar-local erc-timestamp-last-window-width nil "The width of the last window that showed the current buffer. @@ -398,10 +399,10 @@ erc-toggle-timestamps (erc-munge-invisibility-spec))) (erc-buffer-list))) -(defun erc-echo-timestamp (dir stamp) +(defun erc-echo-timestamp (dir &optional stamp) "Print timestamp text-property of an IRC message." (when (and erc-echo-timestamps (eq 'entered dir)) - (when stamp + (when (or stamp (setq stamp (get-text-property (point) 'erc-timestamp))) (message "%s" (format-time-string erc-echo-timestamp-format stamp))))) -- 2.31.1