summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/lisp.el
diff options
context:
space:
mode:
authorF. Jason Park <jp@neverwas.me>2021-11-24 05:35:35 -0800
committerF. Jason Park <jp@neverwas.me>2023-04-08 14:23:51 -0700
commit379d35695b1985b71ff768c1e40d90f3b1da7fe6 (patch)
tree2d5448a08e81e31c830398a4ea7be5a968f833cf /lisp/emacs-lisp/lisp.el
parentad3dc74e074719a58226e23a45c4556cd54c0a48 (diff)
downloademacs-379d35695b1985b71ff768c1e40d90f3b1da7fe6.tar.gz
emacs-379d35695b1985b71ff768c1e40d90f3b1da7fe6.tar.bz2
emacs-379d35695b1985b71ff768c1e40d90f3b1da7fe6.zip
Make some erc-stamp functions more limber
* lisp/erc/erc-stamp.el (erc-timestamp-format-right): Deprecate option and change meaning of its nil value to fall through to `erc-timestamp-format'. Do this to allow modules to predict what the right-hand stamp's final width will be. This also saves `erc-insert-timestamp-left-and-right' from calling `erc-format-timestamp' again for every inserted message. (erc-stamp-mode, erc-stamp-enable, erc-stamp-disable): Add `erc-stamp--recover-on-reconnect' to `erc-mode-hook'. (erc-stamp--recover-on-reconnect): Add function to reuse last values of `erc-timestamp-last-inserted' and friends to avoid reprinting stamps when reconnecting. (erc-stamp--current-time): Add new generic function and method to return current time. Default to calling `erc-current-time'. Also add new internal variable of the same name to hold time value used to construct formatted stamps passed to `erc-insert-timestamp-function'. (erc-add-timestamp): Bind `erc-stamp--current-time' when calling `erc-insert-timestamp-function'. (erc-stamp--insert-date-function): New variable for modules to tweak date-insertion. (erc-insert-timestamp-left-and-right): Use STRING parameter and favor it over the now deprecated `erc-timestamp-format-right' to avoid formatting twice. Also extract current time from the variable `erc-stamp--current-time' for similar reasons. And defer to `erc-stamp--insert-date-function' to insert left stamp. (Bug#60936.) (erc-stamp--tz): New internal variable. (erc-format-timestamp): Pass `erc-stamp--tz' as time-zone to `format-time-string'.
Diffstat (limited to 'lisp/emacs-lisp/lisp.el')
0 files changed, 0 insertions, 0 deletions