From: Eli Zaretskii Date: Fri, 18 Feb 2011 17:59:06 +0000 (+0200) Subject: Fix bug #8047 with require-final-newline in binary image buffers. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~815 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4114ed61cd3edf2a0d54aff4cfc625d13abd6e0e;p=emacs.git Fix bug #8047 with require-final-newline in binary image buffers. image-mode.el (image-toggle-display-image): Set find-file-literally non-nil in buffers visiting binary image files. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f65ec67e7b8..367e685dd1d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2011-02-18 Eli Zaretskii + + * image-mode.el (image-toggle-display-image): Set + find-file-literally non-nil in buffers visiting binary image + files. (Bug#8047) + 2011-02-18 Stefan Monnier * files.el (cd): Make completion obey cd-path (bug#7924). diff --git a/lisp/image-mode.el b/lisp/image-mode.el index 190ca08722b..64dcf9076ae 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -505,6 +505,11 @@ was inserted." ;; This just makes the arrow displayed in the right fringe ;; area look correct when the image is wider than the window. (setq truncate-lines t) + ;; Disable adding a newline at the end of the image file when it + ;; is written with, e.g., C-x C-w. + (if (coding-system-equal (coding-system-base buffer-file-coding-system) + 'no-conversion) + (set (make-local-variable 'find-file-literally) t)) ;; Allow navigation of large images (set (make-local-variable 'auto-hscroll-mode) nil) (setq image-type type)