From 9f9a6e8c45e329d58a772dcf25942f7093ba5fc0 Mon Sep 17 00:00:00 2001 From: H Durer Date: Mon, 19 Mar 2018 15:54:23 +0000 Subject: Give mastodon-media--inline-images a saner interface. (#191) Instead of making it search the whole buffer every time to find images to load, give it a range where this work should be done. We then call this immediately after inserting a single status, notification, ... There should be no big noticible difference - images might load a tiny bit sooner although I doubt you can see that. This should be more efficient on large buffers although Alex didn't notice any problems when testing streamed buffers. We should still do it as it make things easier to understand. I was always worried about these global operations. --- lisp/mastodon-profile.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lisp/mastodon-profile.el') diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index 9dc5a82..fca1bd8 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -76,7 +76,8 @@ " ------------\n") 'success)) (setq mastodon-tl-update-point (point)) - (mastodon-tl--timeline json))) + (mastodon-media--inline-images (point-min) (point)) + (mastodon-tl--timeline json))) (mastodon-tl--goto-next-toot))) (defun mastodon-profile--get-toot-author () @@ -112,8 +113,7 @@ FIELD is used to identify regions under 'account" 'byline 't 'toot-id (cdr (assoc 'id toot)) 'toot-json toot) "\n")) - tootv)) - (mastodon-media--inline-images)) + tootv))) (defun mastodon-profile--get-following () "Request a list of those who the user under point follows." -- cgit v1.2.3