Subject: Re: bug#10601: 24.0.92; Visiting tgz files sets mode from File Local Variables

From: Juri Linkov <[email-masked]>
Date: Wed, 25 Jan 2012 21:32:45 +0200

> Isn't this bug #10506 that Glenn fixed a few days ago?  When was your
> Emacs built?

With bug#10506 Glenn also fixed the case of visiting `browser.jar'
that I reported in http://debbugs.gnu.org/10338#11

But visiting TGA image files still displays the message "Malformed -*- line"
as reported in http://debbugs.gnu.org/9044#29

I think `imagemagick-register-types' should add TGA to
`inhibit-local-variables-regexps':

=== modified file 'lisp/image.el'
--- lisp/image.el	2012-01-25 17:54:01 +0000
+++ lisp/image.el	2012-01-25 19:31:10 +0000
@@ -712,7 +712,8 @@ (defun imagemagick-register-types ()
 		     (not (memq (intern (upcase (symbol-name im-type)))
 				imagemagick-types-inhibit)))
 	    (push (cons (car header-regexp) 'imagemagick)
-		  image-type-header-regexps)))))))
+		  image-type-header-regexps))))
+      (push "\\.tga\\'" inhibit-local-variables-regexps))))
 
 (provide 'image)

This is desirable for TGA because it usually contains many occurences of -*-
in the first line.

Of course, in 24.2 it would be better to check for `image-mode'
to cover all other image formats as well.