summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorF. Jason Park <jp@neverwas.me>2021-11-24 03:10:20 -0800
committerF. Jason Park <jp@neverwas.me>2023-04-08 14:23:51 -0700
commitad3dc74e074719a58226e23a45c4556cd54c0a48 (patch)
treed0803021ea286e1e78d7c1f2ddc4f4680aeadf3d /lisp/emacs-lisp
parent8793874616f1020f7af5149643a75d551887ea5c (diff)
downloademacs-ad3dc74e074719a58226e23a45c4556cd54c0a48.tar.gz
emacs-ad3dc74e074719a58226e23a45c4556cd54c0a48.tar.bz2
emacs-ad3dc74e074719a58226e23a45c4556cd54c0a48.zip
Expose insertion time as text prop in erc-stamp
* lisp/erc/erc-stamp.el (erc-add-timestamp): Add new text property `erc-timestamp' to store lisp time object formerly ensconced in a closure. Instead of creating a new lambda for the cursor-sensor function of each message in a buffer, leave a gap between messages to trip the sensor function. The motivation behind this change is to allow third parties access to valuable timestamp data already stored by ERC anyway. Of secondary importance is discouraging the reliance on those lambdas as a means of detecting message bounds. The gap now serves a similar purpose. Basically, the final character in a message, a newline, will not have a timestamp or a sensor function. In the rare instance the stamps module isn't loaded, the new `erc-command' property can be used for this purpose instead. Also, instead of looking for the `invisible' text property at point, which is normally `point-max' and thus outside the accessible portion of the buffer, look at the beginning of the inserted message. This allows hook members running before this function to opt out of timestamps by marking a message as invisible. (erc-echo-timestamp): Make interactive and show timestamps even when the variable `erc-echo-timestamps' is nil. (erc--echo-ts-csf): Add new function to serve as value of cursor-sensor function text properties. * test/lisp/erc/erc-stamp-tests.el: New file. (Bug#60936.)
Diffstat (limited to 'lisp/emacs-lisp')
0 files changed, 0 insertions, 0 deletions