diff options
| author | F. Jason Park | 2023-12-30 16:39:18 -0800 |
|---|---|---|
| committer | F. Jason Park | 2023-12-31 06:56:32 -0800 |
| commit | 8513ecc8a38f76b497348bbae61ae4c5ac5a9995 (patch) | |
| tree | de28e3ed0b37528afb5b0f42273333125d9e2286 /lisp/erc | |
| parent | 4eda77ed335f982460f818ae1b8619cbd32ba77d (diff) | |
| download | emacs-8513ecc8a38f76b497348bbae61ae4c5ac5a9995.tar.gz emacs-8513ecc8a38f76b497348bbae61ae4c5ac5a9995.zip | |
Restore predicate for detecting date stamps in ERC
* etc/ERC-NEWS: Mention function `erc-stamp-inserting-date-stamp-p'.
* lisp/erc/erc-stamp.el (erc-stamp-inserting-date-stamp-p): New
function for third parties to detect whether the message being
inserted is a date stamp. Date stamps as independent messages were
originally introduced as part of bug#60936.
Diffstat (limited to 'lisp/erc')
| -rw-r--r-- | lisp/erc/erc-stamp.el | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lisp/erc/erc-stamp.el b/lisp/erc/erc-stamp.el index a65b564ba6c..cfd756ce625 100644 --- a/lisp/erc/erc-stamp.el +++ b/lisp/erc/erc-stamp.el | |||
| @@ -678,6 +678,13 @@ value of t means the option's value doesn't require trimming.") | |||
| 678 | 0 erc-stamp--date-format-end) | 678 | 0 erc-stamp--date-format-end) |
| 679 | erc-timestamp-format-left)))) | 679 | erc-timestamp-format-left)))) |
| 680 | 680 | ||
| 681 | (defun erc-stamp-inserting-date-stamp-p () | ||
| 682 | "Return non-nil if the narrowed buffer contains a date stamp. | ||
| 683 | Expect to be called by members of `erc-insert-modify-hook' and | ||
| 684 | `erc-insert-post-hook' to detect whether the message being | ||
| 685 | inserted is a date stamp." | ||
| 686 | (erc--check-msg-prop 'erc--msg 'datestamp)) | ||
| 687 | |||
| 681 | ;; Calling `erc-display-message' from within a hook it's currently | 688 | ;; Calling `erc-display-message' from within a hook it's currently |
| 682 | ;; running is roundabout, but it's a definite means of ensuring hooks | 689 | ;; running is roundabout, but it's a definite means of ensuring hooks |
| 683 | ;; can act on the date stamp as a standalone message to do things like | 690 | ;; can act on the date stamp as a standalone message to do things like |