From 6621f981f318f9abdbf2182fa3385374fa23affc Mon Sep 17 00:00:00 2001 From: mousebot Date: Fri, 11 Feb 2022 18:50:30 +0100 Subject: fix search-get-user-info test broken by follow suggestions --- test/mastodon-search-tests.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/mastodon-search-tests.el b/test/mastodon-search-tests.el index 996f786..e6d4cdb 100644 --- a/test/mastodon-search-tests.el +++ b/test/mastodon-search-tests.el @@ -126,7 +126,10 @@ (should (equal (mastodon-search--get-user-info mastodon-search--single-account-query) - '(": ( ) { : | : & } ; :" "mousebot" "https://todon.nl/@mousebot")))) + '(": ( ) { : | : & } ; :" + "mousebot" + "https://todon.nl/@mousebot" + "

poetry, writing, dmt, desertion, trash, black metal, translation, hegel, language, autonomia....

https://anarchive.mooo.com
https://pleasantlybabykid.tumblr.com/
IG: https://bibliogram.snopyta.org/u/martianhiatus
photos alt: @goosebot
git: https://git.blast.noho.st/mouse

want to trade chapbooks or zines? hmu!

he/him or they/them

")))) (ert-deftest mastodon-search--get-hashtag-info () "Should build a list of hashtag name and URL." -- cgit v1.2.3 From e5d73624023cb9bf0ec929985f35e935090b40f0 Mon Sep 17 00:00:00 2001 From: Holger Dürer Date: Sat, 12 Feb 2022 15:14:40 +0100 Subject: Fix the timers for auto-updating of relative timestamps. I have no idea how this ever worked, already the original commit (https://github.com/mooseyboots/mastodon.el/commit/746694f0ea75f5fa76739d49509836ccd67d7d65?utm_source=pocket_mylist) seems to have passed a time instead of seconds. The docs for `run-at-time` (https://www.gnu.org/software/emacs/manual/html_node/elisp/Timers.html) make it clear that this cannot work. Now we keep the absolute times but upon calling `run-at-time` we convert that to relative seconds from now. --- lisp/mastodon-tl.el | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index 8921259..cdb4aa2 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -1269,7 +1269,7 @@ is a no-op." ;; We need to re-schedule for an earlier time (cancel-timer mastodon-tl--timestamp-update-timer) (setq mastodon-tl--timestamp-update-timer - (run-at-time this-update + (run-at-time (time-to-seconds (time-subtract this-update (current-time))) nil ;; don't repeat #'mastodon-tl--update-timestamps-callback (current-buffer) nil))))))) @@ -1322,7 +1322,9 @@ from the start if it is nil." (copy-marker previous-timestamp)) ;; otherwise we are done for now; schedule a new run for when needed (setq mastodon-tl--timestamp-update-timer - (run-at-time mastodon-tl--timestamp-next-update + (run-at-time (time-to-seconds + (time-subtract mastodon-tl--timestamp-next-update + (current-time))) nil ;; don't repeat #'mastodon-tl--update-timestamps-callback buffer nil)))))))) @@ -1372,7 +1374,9 @@ JSON is the data returned from the server." update-function ,update-function) mastodon-tl--timestamp-update-timer (when mastodon-tl--enable-relative-timestamps - (run-at-time mastodon-tl--timestamp-next-update + (run-at-time (time-to-seconds + (time-subtract mastodon-tl--timestamp-next-update + (current-time))) nil ;; don't repeat #'mastodon-tl--update-timestamps-callback (current-buffer) @@ -1402,7 +1406,9 @@ Runs synchronously." ,update-function) mastodon-tl--timestamp-update-timer (when mastodon-tl--enable-relative-timestamps - (run-at-time mastodon-tl--timestamp-next-update + (run-at-time (time-to-seconds + (time-subtract mastodon-tl--timestamp-next-update + (current-time))) nil ;; don't repeat #'mastodon-tl--update-timestamps-callback (current-buffer) -- cgit v1.2.3