]> git.eshelyaron.com Git - emacs.git/commitdiff
Prefer erc--skip property to erc-track--skipped-msgs
authorF. Jason Park <jp@neverwas.me>
Tue, 7 May 2024 04:59:48 +0000 (21:59 -0700)
committerEshel Yaron <me@eshelyaron.com>
Thu, 9 May 2024 06:41:23 +0000 (08:41 +0200)
* 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
lisp/erc/erc-track.el

index 77981bc9d07f021fe5bdd685a1512ead082762bf..fd137c0548a0adcfee134f73d0afd4f5949431e5 100644 (file)
@@ -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 ()
index 04ee76a9349c0abf55a1b2f98a24c813fda92784..40e83fff9740139360d32e4b8ea1058a81652042 100644 (file)
@@ -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