From: Eli Zaretskii Date: Fri, 18 Feb 2011 17:51:15 +0000 (+0200) Subject: Fix bug #8047 with require-final-newline and image file display. X-Git-Tag: emacs-23.3~18^2~9 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=61aa93ed0d083435c6fef9ab85d5776f233376e1;p=emacs.git Fix bug #8047 with require-final-newline and image file display. image-mode.el (image-toggle-display-image): Disable require-final-newline in buffers visiting binary image files. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index da5b9ebbda2..8caa24c1f40 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2011-02-18 Eli Zaretskii + * image-mode.el (image-toggle-display-image): Disable + require-final-newline in buffers visiting binary image files. + (Bug#8047) + * international/mule-cmds.el (read-char-by-name, ucs-insert): Document completion with asterisk and a substring. diff --git a/lisp/image-mode.el b/lisp/image-mode.el index b30a43080d6..191e347330d 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -507,6 +507,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 'require-final-newline) nil)) ;; Allow navigation of large images (set (make-local-variable 'auto-hscroll-mode) nil) (setq image-type type)