summaryrefslogtreecommitdiff
path: root/lisp/image-mode.el
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@gnu.org>2015-11-17 11:27:51 +0900
committerDaiki Ueno <ueno@gnu.org>2015-11-17 11:49:40 +0900
commit1721600d2463bacd13faa2c7613b7897a84d1099 (patch)
tree33e291d00fc8c5eb7779e39c0b8120ef73fd3ffd /lisp/image-mode.el
parentc9fd597a4cffcae873b25381ee8cc755f0debe95 (diff)
downloademacs-1721600d2463bacd13faa2c7613b7897a84d1099.tar.gz
* lisp/image-mode.el: Support encrypted file
(image-toggle-display-image): Read content from the buffer instead of the file, if the buffer holds a decrypted data. (Bug#21870)
Diffstat (limited to 'lisp/image-mode.el')
-rw-r--r--lisp/image-mode.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/image-mode.el b/lisp/image-mode.el
index e6d6a3edb71..8ef9c277c36 100644
--- a/lisp/image-mode.el
+++ b/lisp/image-mode.el
@@ -658,7 +658,12 @@ was inserted."
(not (and (boundp 'archive-superior-buffer)
archive-superior-buffer))
(not (and (boundp 'tar-superior-buffer)
- tar-superior-buffer)))))
+ tar-superior-buffer))
+ ;; This means the buffer holds the
+ ;; decrypted content (bug#21870).
+ (not (and (boundp 'epa-file-encrypt-to)
+ (local-variable-p
+ 'epa-file-encrypt-to))))))
(file-or-data (if data-p
(string-make-unibyte
(buffer-substring-no-properties (point-min) (point-max)))