diff options
-rw-r--r-- | gnus.org | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -660,15 +660,22 @@ (shr-render-region begin (1- (point)))))))))) (add-hook 'gnus-part-display-hook 'jao-gnus-remove-anchors) - (defvar-local jao-gnus--images-p nil) + + (defvar-local jao-gnus--images nil) + + (defun jao-gnus--init-images () + (with-current-buffer gnus-article-buffer + (setq jao-gnus--images nil))) + + (add-hook 'gnus-select-article-hook #'jao-gnus--init-images) (defun jao-gnus-show-images () (interactive) (save-window-excursion (gnus-summary-select-article-buffer) (save-excursion - (setq jao-gnus--images-p (not jao-gnus--images-p)) - (if jao-gnus--images-p + (setq jao-gnus--images (not jao-gnus--images)) + (if jao-gnus--images (gnus-article-show-images) (gnus-article-remove-images))))) #+end_src |