diff options
author | jao <jao@gnu.org> | 2022-03-23 00:59:50 +0000 |
---|---|---|
committer | jao <jao@gnu.org> | 2022-03-23 00:59:50 +0000 |
commit | c0bfe5d1c5602dac1e1eee9646e4da4007aec7e0 (patch) | |
tree | 6f34710d9b577a716d5503aa2225e312345b207c | |
parent | 988db834b7debd9033b385dfeb080cd718101a29 (diff) | |
download | elibs-c0bfe5d1c5602dac1e1eee9646e4da4007aec7e0.tar.gz elibs-c0bfe5d1c5602dac1e1eee9646e4da4007aec7e0.tar.bz2 |
gnus: proper image toggling
-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 |