summaryrefslogtreecommitdiff
path: root/lisp/image-mode.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2018-10-15 22:31:54 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2018-10-15 22:31:54 -0400
commit6716eb24cfc5b21be5232acdc8c743dd0de81b41 (patch)
treed6ef7981f3af49fb94bc5cf9b4e7d91f115053d0 /lisp/image-mode.el
parentd9d5b2b7af69ff4697ab0be8e9c4a83e06eb8367 (diff)
downloademacs-6716eb24cfc5b21be5232acdc8c743dd0de81b41.tar.gz
* lisp/image-mode.el (image-toggle-display-image): Avoid string-make-unibyte
Diffstat (limited to 'lisp/image-mode.el')
-rw-r--r--lisp/image-mode.el18
1 files changed, 11 insertions, 7 deletions
diff --git a/lisp/image-mode.el b/lisp/image-mode.el
index 97c23e67480..606c66143aa 100644
--- a/lisp/image-mode.el
+++ b/lisp/image-mode.el
@@ -145,7 +145,7 @@ otherwise it defaults to t, used for times when the buffer is not displayed."
(unless (listp image-mode-winprops-alist)
(setq image-mode-winprops-alist nil))
(add-hook 'window-configuration-change-hook
- 'image-mode-reapply-winprops nil t))
+ #'image-mode-reapply-winprops nil t))
;;; Image scrolling functions
@@ -572,8 +572,8 @@ Key bindings:
;; Keep track of [vh]scroll when switching buffers
(image-mode-setup-winprops)
- (add-hook 'change-major-mode-hook 'image-toggle-display-text nil t)
- (add-hook 'after-revert-hook 'image-after-revert-hook nil t)
+ (add-hook 'change-major-mode-hook #'image-toggle-display-text nil t)
+ (add-hook 'after-revert-hook #'image-after-revert-hook nil t)
(run-mode-hooks 'image-mode-hook)
(let ((image (image-get-display-property))
(msg1 (substitute-command-keys
@@ -725,10 +725,14 @@ was inserted."
(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)))
- filename))
+ (file-or-data
+ (if data-p
+ (let ((str
+ (buffer-substring-no-properties (point-min) (point-max))))
+ (if enable-multibyte-characters
+ (encode-coding-string str buffer-file-coding-system)
+ str))
+ filename))
;; If we have a `fit-width' or a `fit-height', don't limit
;; the size of the image to the window size.
(edges (and (null image-transform-resize)