From b0f644e7dba4d8cb69cf85e7f26c42e294745323 Mon Sep 17 00:00:00 2001 From: "F. Jason Park" Date: Mon, 6 May 2024 21:59:48 -0700 Subject: [PATCH] Prefer erc--skip property to erc-track--skipped-msgs * lisp/erc/erc-stamp.el (erc-add-timestamp): Honor an overriding `erc--ts' "msg prop". (erc-stamp--defer-date-insertion-on-post-modify): Add `erc--skip' for the `track' module. * lisp/erc/erc-track.el (erc-track--skipped-msgs): Remove unused variable. Originally added as part of bug#60936. (erc-track-modified-channels): Rely on the `erc--skip' "msg prop" instead of the now defunct `erc-track--skipped-msgs' variable for detecting requests to omit `track' mode-line updates during `erc-display-message'. (cherry picked from commit 36c68e7e34df996bbde4cc82c04ea1619349b64a) --- lisp/erc/erc-stamp.el | 6 ++++-- lisp/erc/erc-track.el | 6 +----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lisp/erc/erc-stamp.el b/lisp/erc/erc-stamp.el index 77981bc9d07..fd137c0548a 100644 --- a/lisp/erc/erc-stamp.el +++ b/lisp/erc/erc-stamp.el @@ -243,7 +243,8 @@ or `erc-send-modify-hook'." (unless (and (not erc-stamp--allow-unmanaged-p) (or (null erc--msg-props) (erc--memq-msg-prop 'erc--skip 'stamp))) - (let* ((ct (erc-stamp--current-time)) + (let* ((ct (or (erc--check-msg-prop 'erc--ts) + (erc-stamp--current-time))) (invisible (get-text-property (point-min) 'invisible)) (erc-stamp--invisible-property ;; FIXME on major version bump, make this `erc-' prefixed. @@ -737,7 +738,8 @@ non-nil." (setq erc-stamp--deferred-date-stamp nil) (let* ((aligned (erc-stamp--time-as-day ct)) (erc-stamp--current-time aligned) - (erc--msg-props (map-into '((erc--msg . datestamp)) + (erc--msg-props (map-into '((erc--msg . datestamp) + (erc--skip track)) 'hash-table)) (erc-insert-post-hook `(,(lambda () diff --git a/lisp/erc/erc-track.el b/lisp/erc/erc-track.el index 04ee76a9349..40e83fff974 100644 --- a/lisp/erc/erc-track.el +++ b/lisp/erc/erc-track.el @@ -959,9 +959,6 @@ NEW-FACES has a cdr." (throw 'face candidate)))))) choice))) -(defvar erc-track--skipped-msgs '(datestamp) - "Values of `erc--msg' text prop to ignore.") - (defun erc-track-modified-channels () "Hook function for `erc-insert-post-hook'. Check if the current buffer should be added to the mode line as a @@ -980,8 +977,7 @@ the current buffer is in `erc-mode'." erc-track-exclude-types) ;; Skip certain non-server-sent messages. (and (not parsed) - (erc--check-msg-prop 'erc--msg - erc-track--skipped-msgs)))))) + (erc--memq-msg-prop 'erc--skip 'track)))))) ;; If the active buffer is not visible (not shown in a ;; window), and not to be excluded, determine the kinds of ;; faces used in the current message, and unless the user -- 2.39.5