branch: elpa/mastodon
commit bfde66d78394c1a4cfda3ffccd0f167b4199da45
Author: marty hiatt <[email protected]>
Commit: marty hiatt <[email protected]>

    notifs timer: add update-check to mode-hook-fun, FIXMEs.
---
 lisp/mastodon-notifications.el | 8 +++-----
 lisp/mastodon.el               | 5 ++++-
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el
index b8b96695ac..2a7392d870 100644
--- a/lisp/mastodon-notifications.el
+++ b/lisp/mastodon-notifications.el
@@ -978,6 +978,7 @@ NOTE means to include a profile note."
         (mastodon-tl--render-text .account.note .account))
       "\n")
      'item-json req)))
+
 
 ;;; UPDATES TIMER
 
@@ -995,8 +996,8 @@ Also nil the variable."
   "Run a timer to update notifications. Added to `mastodon-mode-hook'."
   ;; if no buffers: cancel our timer:
   ;; FIXME: fails on load first masto buffer!
-  ;; `mastodon-mode' loads before we populate the buffer via an update fun
-  ;; do we need an after-update hook?
+  ;; `mastodon-mode-hook' necessariliy runs before we have buf-spec.
+  ;; if we set buf-spec before enabling mode, buf-spec is lost
   (if (not (mastodon-live-buffers))
       ;; if not masto buffers: cancel everything:
       (mastodon-notifications-cancel-timer)
@@ -1036,8 +1037,5 @@ Calls `mastodon-tl--update'."
     (mastodon-notifications-cancel-timer)
     (mastodon-notifications--update-with-timer)))
 
-(add-hook 'mastodon-mode-hook
-          #'mastodon-notifications--update-with-timer)
-
 (provide 'mastodon-notifications)
 ;;; mastodon-notifications.el ends here
diff --git a/lisp/mastodon.el b/lisp/mastodon.el
index e1d7daa1de..0897630922 100644
--- a/lisp/mastodon.el
+++ b/lisp/mastodon.el
@@ -75,6 +75,7 @@
 (autoload 'mastodon-toot--view-toot-history "mastodon-tl")
 (autoload 'mastodon-tl-return "mastodon-tl")
 (autoload 'mastodon-tl-jump-to-followed-tag "mastodon-tl")
+(autoload 'mastodon-notifications--update-with-timer "mastodon-notifications")
 
 ;; for M-x visibility
 ;; (views.el uses `mastodon-mode-map', so we can't easily require it)
@@ -590,7 +591,9 @@ Calls `mastodon-tl--get-buffer-type', which see."
   ;; make `thing-at-point' functions work:
   (setq-local thing-at-point-provider-alist
               (append thing-at-point-provider-alist
-                      '((url . mastodon--url-at-point)))))
+                      '((url . mastodon--url-at-point))))
+  ;; notifs timer
+  (mastodon-notifications--update-with-timer))
 
 ;;;###autoload
 (add-hook 'mastodon-mode-hook #'mastodon-mode-hook-fun)

Reply via email to