Function: erc-stamp--redo-right-stamp-post-clear

erc-stamp--redo-right-stamp-post-clear is a byte-compiled function defined in erc-stamp.el.gz.

Signature

(erc-stamp--redo-right-stamp-post-clear _ END)

Documentation

Append new right stamp to first inserted message after END.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc-stamp.el.gz
(defun erc-stamp--redo-right-stamp-post-clear (_ end)
  "Append new right stamp to first inserted message after END."
  ;; During truncation, the last existing right stamp is often deleted
  ;; regardless of `erc-timestamp-only-if-changed-flag'.  As of ERC 5.6,
  ;; recreating inserted messages from scratch isn't doable.  (Although,
  ;; attempting surgery like this is likely unwise.)
  (when-let* ((erc-stamp--date-mode)
              ((< end (1- erc-insert-marker))) ; not a /CLEAR
              (bounds (erc--get-inserted-msg-bounds (1+ end)))
              (ts (get-text-property (car bounds) 'erc--ts))
              (format (with-suppressed-warnings
                          ((obsolete erc-timestamp-format-right))
                        (or erc-timestamp-format-right erc-timestamp-format)))
              (rendered (erc-format-timestamp ts format))
              ((not (equal rendered erc-timestamp-last-inserted-right)))
              ((not (eq 'erc-timestamp (field-at-pos (1- (cdr bounds))))))
              (erc--msg-props (map-into `((erc--ts . ,ts)) 'hash-table)))
    (save-excursion
      (save-restriction
        (let ((erc-timestamp-last-inserted erc-timestamp-last-inserted)
              (erc-timestamp-last-inserted-right
               erc-timestamp-last-inserted-right))
          (narrow-to-region (car bounds) (1+ (cdr bounds)))
          (cl-assert (= ?\n (char-before (point-max))))
          (erc-add-timestamp))))))