about summary refs log tree commit diff
path: root/tools/emacs-pkgs/dottime/dottime.el
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-01-19T16·48+0000
committerVincent Ambo <tazjin@google.com>2020-01-19T16·48+0000
commit9879703155a2916b8851a11b0858e2d61b3e3173 (patch)
tree93a3dded04e2ea719b2965443266343af01fdf8d /tools/emacs-pkgs/dottime/dottime.el
parentf09c6a8ecd505812ee50864e981a3f1ef108afd2 (diff)
fix(emacs-pkgs/dottime): Do not call telega macros in advice setup r/421
This advice is potentially defined before the autoloads for telega
have run, which means that the macro-expansion fails and
`telega-ins-fmt` is looked up as a function.

With this setup the initialisation works as expected.
Diffstat (limited to '')
-rw-r--r--tools/emacs-pkgs/dottime/dottime.el3
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/emacs-pkgs/dottime/dottime.el b/tools/emacs-pkgs/dottime/dottime.el
index 3500b1c9f4..2446f6488f 100644
--- a/tools/emacs-pkgs/dottime/dottime.el
+++ b/tools/emacs-pkgs/dottime/dottime.el
@@ -67,14 +67,13 @@
   ;; This will never display offsets in the chat window, as those are
   ;; always visible in the modeline anyways.
   (when (featurep 'telega)
-    (require 'telega)
     (defun telega-ins--dottime-advice (orig timestamp)
       (let* ((dtime (decode-time timestamp t))
              (current-ts (time-to-seconds (current-time)))
              (ctime (decode-time current-ts))
              (today00 (telega--time-at00 current-ts ctime)))
         (if (> timestamp today00)
-            (telega-ins-fmt "%02d·%02d" (nth 2 dtime) (nth 1 dtime))
+            (telega-ins (format "%02d·%02d" (nth 2 dtime) (nth 1 dtime)))
           (funcall orig timestamp))))
 
     (advice-add 'telega-ins--date :around #'telega-ins--dottime-advice)))