diff options
-rw-r--r-- | lisp/mastodon-media.el | 30 | ||||
-rw-r--r-- | lisp/mastodon-tl.el | 2 |
2 files changed, 16 insertions, 16 deletions
diff --git a/lisp/mastodon-media.el b/lisp/mastodon-media.el index 94c6e9f..f010fee 100644 --- a/lisp/mastodon-media.el +++ b/lisp/mastodon-media.el @@ -144,21 +144,21 @@ REGION-LENGTH is the length of the region that should be replaced with the image (image (when data (apply #'create-image data (when image-options 'imagemagick) t image-options)))) - (switch-to-buffer (marker-buffer marker)) - ;; Save narrowing in our buffer - (let ((inhibit-read-only t)) - (save-restriction - (widen) - (put-text-property marker (+ marker region-length) 'media-state 'loaded) - (when image - ;; We only set the image to display if we could load - ;; it; we already have set a default image when we - ;; added the tag. - (put-text-property marker (+ marker region-length) - 'display image)) - ;; We are done with the marker; release it: - (set-marker marker nil))) - (kill-buffer url-buffer)))))) + (with-current-buffer (marker-buffer marker) + ;; Save narrowing in our buffer + (let ((inhibit-read-only t)) + (save-restriction + (widen) + (put-text-property marker (+ marker region-length) 'media-state 'loaded) + (when image + ;; We only set the image to display if we could load + ;; it; we already have set a default image when we + ;; added the tag. + (put-text-property marker (+ marker region-length) + 'display image)) + ;; We are done with the marker; release it: + (set-marker marker nil))) + (kill-buffer url-buffer))))))) (defun mastodon-media--load-image-from-url (url media-type start region-length) "Takes a URL and MEDIA-TYPE and load the image asynchronously. diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index dbc815f..2f26b55 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -297,7 +297,7 @@ also render the html" preview-url) (concat "Media::" preview-url "\n")))) media-attachements ""))) - (if (not (and (not mastodon-tl--display-media-p) + (if (not (and mastodon-tl--display-media-p (equal media-string ""))) (concat "\n" media-string) ""))) |