unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#9044: 24.0.50; File mode specification error: (error "Malformed -*- line")
@ 2011-07-10 23:36 Peter Dyballa
  2011-07-12 21:53 ` Glenn Morris
  0 siblings, 1 reply; 18+ messages in thread
From: Peter Dyballa @ 2011-07-10 23:36 UTC (permalink / raw)
  To: 9044

Hello!

I have configured GNU Emacs without direct JPEG and TIFF support.  
After launching it with -Q I execute in *scratch* buffer

	(imagemagick-register-types)

(nil is returned). When I view from dired file.tif, then only its  
bytes are displayed in a (Fundamental View) buffer. In *Messages* buffer

	File mode specification error: (error "Malformed -*- line")
	File local-variables error: (error "Malformed -*- line")

is recorded.

GCC is GCC 4.4.6, Mac OS X 10.5.8, PPC, big-endian.

In GNU Emacs 24.0.50.2 (powerpc-apple-darwin9.8.0, GTK+ Version 2.24.4)
  of 2011-07-10 on Latsche.fritz.box
Windowing system distributor `The X.Org Foundation', version  
11.0.11002000
configured using `configure  '--without-sound' '--without-dbus' '-- 
without-pop' '--without-gconf' '--without-gpm' '--without-gsettings'  
'--without-jpeg' '--without-tiff' '--with-x-toolkit=gtk' '--enable- 
locallisppath=/Library/Application Support/Emacs/calendar24:/Library/ 
Application Support/Emacs' 'CFLAGS=-g -H -pipe -fPIC -fno-common - 
mcpu=7450 -mtune=7450 -maltivec -faltivec -mabi=altivec -Os -mfused- 
madd -mmultiple -ftree-vectorize' 'LDFLAGS=-Wl,-dead_strip_dylibs -Wl,- 
bind_at_load -Wl,-t' 'CC=gcc-4' 'CPP=cpp-4' 'PKG_CONFIG_PATH=/opt/ 
local/lib/pkgconfig:/opt/local/share/pkgconfig:/usr/lib/pkgconfig''

Important settings:
   value of $LC_ALL: nil
   value of $LC_COLLATE: nil
   value of $LC_CTYPE: de_DE.UTF-8
   value of $LC_MESSAGES: nil
   value of $LC_MONETARY: nil
   value of $LC_NUMERIC: nil
   value of $LC_TIME: nil
   value of $LANG: de_DE.UTF-8
   value of $XMODIFIERS: nil
   locale-coding-system: utf-8-unix
   default enable-multibyte-characters: t

Major mode: Dired by name

Minor modes in effect:
   tooltip-mode: t
   mouse-wheel-mode: t
   tool-bar-mode: t
   menu-bar-mode: t
   file-name-shadow-mode: t
   global-font-lock-mode: t
   font-lock-mode: t
   blink-cursor-mode: t
   auto-composition-mode: t
   auto-encryption-mode: t
   auto-compression-mode: t
   line-number-mode: t
   transient-mark-mode: t

--
Greetings

   Pete

$ sumascii BILL GATES
   B   I   L   L   G   A   T   E   S
  66+ 73+ 76+ 76+ 71+ 65+ 84+ 69+ 83 = 663

  and add 3 because he's Bill Gates the third.






^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#9044: 24.0.50; File mode specification error: (error "Malformed -*- line")
  2011-07-10 23:36 bug#9044: 24.0.50; File mode specification error: (error "Malformed -*- line") Peter Dyballa
@ 2011-07-12 21:53 ` Glenn Morris
  2011-07-12 23:27   ` Peter Dyballa
  0 siblings, 1 reply; 18+ messages in thread
From: Glenn Morris @ 2011-07-12 21:53 UTC (permalink / raw)
  To: Peter Dyballa; +Cc: 9044

Peter Dyballa wrote:

> 	(imagemagick-register-types)
>
> (nil is returned). When I view from dired file.tif, then only its
> bytes are displayed in a (Fundamental View) buffer. In *Messages*
> buffer
>
> 	File mode specification error: (error "Malformed -*- line")
> 	File local-variables error: (error "Malformed -*- line")

Is this for any *.tif file, or just one in particular?
If the latter, can you send it?





^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#9044: 24.0.50; File mode specification error: (error "Malformed -*- line")
  2011-07-12 21:53 ` Glenn Morris
@ 2011-07-12 23:27   ` Peter Dyballa
  2011-07-13  0:01     ` Glenn Morris
  0 siblings, 1 reply; 18+ messages in thread
From: Peter Dyballa @ 2011-07-12 23:27 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 9044

[-- Attachment #1: Type: text/plain, Size: 543 bytes --]


Am 12.07.2011 um 23:53 schrieb Glenn Morris:

> Peter Dyballa wrote:
>
>> 	(imagemagick-register-types)
>>
>> (nil is returned). When I view from dired file.tif, then only its
>> bytes are displayed in a (Fundamental View) buffer. In *Messages*
>> buffer
>>
>> 	File mode specification error: (error "Malformed -*- line")
>> 	File local-variables error: (error "Malformed -*- line")
>
> Is this for any *.tif file, or just one in particular?
> If the latter, can you send it?


It's obviously just one, none of the 20 others I just checked:


[-- Attachment #2: Image.tif --]
[-- Type: image/tiff, Size: 259642 bytes --]

[-- Attachment #3: Type: text/plain, Size: 378 bytes --]




In GNU Emacs 23.3 I get, when typing v on the file in dired:

	Type C-c C-c to view the image as text.
	File local-variables error: (error "Malformed -*- line")
	Type C-c C-c to view the image as an image.
	Reverting buffer `Arbeit'.

--
Greetings

   Pete

Perl—the only language that looks the same before and after RSA  
encryption.
				- Keith Bostic


^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#9044: 24.0.50; File mode specification error: (error "Malformed -*- line")
  2011-07-12 23:27   ` Peter Dyballa
@ 2011-07-13  0:01     ` Glenn Morris
  2011-09-11  3:24       ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 18+ messages in thread
From: Glenn Morris @ 2011-07-13  0:01 UTC (permalink / raw)
  To: Peter Dyballa; +Cc: 9044

Peter Dyballa wrote:

> It's obviously just one, none of the 20 others I just checked:
[...]
> In GNU Emacs 23.3 I get, when typing v on the file in dired:
>
> 	Type C-c C-c to view the image as text.
> 	File local-variables error: (error "Malformed -*- line")


Yes; it has no relation to imagemagick and occurs in 23.3 too. The tiff
file is a single line and happens to contain "-*-" at one point. Emacs
tries to parse this as a file local variables section and fails, so it
complains. It's just a harmless message that you can ignore, it does not
affect anything. I'm not sure that it's worth trying to do anything
about this.





^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#9044: 24.0.50; File mode specification error: (error "Malformed -*- line")
  2011-07-13  0:01     ` Glenn Morris
@ 2011-09-11  3:24       ` Lars Magne Ingebrigtsen
  2011-09-15 18:37         ` Juri Linkov
  0 siblings, 1 reply; 18+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-09-11  3:24 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Peter Dyballa, 9044

Glenn Morris <rgm@gnu.org> writes:

> Yes; it has no relation to imagemagick and occurs in 23.3 too. The tiff
> file is a single line and happens to contain "-*-" at one point. Emacs
> tries to parse this as a file local variables section and fails, so it
> complains. It's just a harmless message that you can ignore, it does not
> affect anything. I'm not sure that it's worth trying to do anything
> about this.

Well, it would make sense to have the "-*-" parser try to be a bit more
intelligent, wouldn't it?  But I don't really have a good idea what to
do.

Having Emacs error totally out and refuse to show the image sounds like
a bad idea, though.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/





^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#9044: 24.0.50; File mode specification error: (error "Malformed -*- line")
  2011-09-11  3:24       ` Lars Magne Ingebrigtsen
@ 2011-09-15 18:37         ` Juri Linkov
  2011-09-15 20:03           ` Stefan Monnier
  0 siblings, 1 reply; 18+ messages in thread
From: Juri Linkov @ 2011-09-15 18:37 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: Peter Dyballa, 9044

> Well, it would make sense to have the "-*-" parser try to be a bit more
> intelligent, wouldn't it?  But I don't really have a good idea what to
> do.
>
> Having Emacs error totally out and refuse to show the image sounds like
> a bad idea, though.

This can be fixed by limiting the search for "-*-" with some reasonable value,
e.g. modifying `set-auto-mode-1' to use: `(min (line-end-position) 1024)'.

Another solution is to add file extensions of binary image formats to
`inhibit-first-line-modes-regexps' or `inhibit-first-line-modes-suffixes'.
But a list of image formats supported by ImageMagick is too long:
(length (imagemagick-types)) => 206.  Perhaps this is not a problem.





^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#9044: 24.0.50; File mode specification error: (error "Malformed -*- line")
  2011-09-15 18:37         ` Juri Linkov
@ 2011-09-15 20:03           ` Stefan Monnier
  2011-09-16  1:58             ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 18+ messages in thread
From: Stefan Monnier @ 2011-09-15 20:03 UTC (permalink / raw)
  To: Juri Linkov; +Cc: Lars Magne Ingebrigtsen, Peter Dyballa, 9044

> Another solution is to add file extensions of binary image formats to
> `inhibit-first-line-modes-regexps' or `inhibit-first-line-modes-suffixes'.
> But a list of image formats supported by ImageMagick is too long:
> (length (imagemagick-types)) => 206.  Perhaps this is not a problem.

I don't see any problem adding it to inhibit-first-line-modes-regexps,
especially using regexp-opt.
But only for non-text formats (e.g. not xpm or postscript).


        Stefan





^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#9044: 24.0.50; File mode specification error: (error "Malformed -*- line")
  2011-09-15 20:03           ` Stefan Monnier
@ 2011-09-16  1:58             ` Lars Magne Ingebrigtsen
  2011-09-16 12:50               ` Juri Linkov
  0 siblings, 1 reply; 18+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-09-16  1:58 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Peter Dyballa, 9044

Stefan Monnier <monnier@IRO.UMontreal.CA> writes:

>> Another solution is to add file extensions of binary image formats to
>> `inhibit-first-line-modes-regexps' or `inhibit-first-line-modes-suffixes'.
>> But a list of image formats supported by ImageMagick is too long:
>> (length (imagemagick-types)) => 206.  Perhaps this is not a problem.
>
> I don't see any problem adding it to inhibit-first-line-modes-regexps,
> especially using regexp-opt.
> But only for non-text formats (e.g. not xpm or postscript).

The list is:

(YUV YCbCrA YCbCr Y XWD XV XPS XPM XCF XC XBM X3F X WPG WMZ WMV WMF WBMP
VST VIFF VID VICAR VDA UYVY UIL UBRL TXT TTF TTC TIM TILE TIFF64 TIFF
THUMBNAIL TGA TEXT SVGZ SVG SUN STEGANO SRF SR2 SHTML SGI SFW SCT SCR
RLE RLA RGBO RGBA RGB RBG RAS RAF RADIAL-GRADIENT R PWP PTIF PSD PSB PS3
PS2 PS PREVIEW PPM PNM PNG8 PNG32 PNG24 PNG PLASMA PJPEG PIX PICT PICON
PGX PGM PFM PFB PFA PES PEF PDFA PDF PDB PCX PCT PCL PCDS PCD PBM
PATTERN PAM PALM PAL OTF OTB ORF O NULL NEF MVG MTV MSVG MSL MRW MPG
MPEG MPC MP4 MOV MONO MNG MIFF MATTE MAT MAP M4V M2V M LABEL KDC K25 K
JPX JPG JPEG JPC JP2 JNG J2C ISOBRL IPL INLINE INFO ICON ICO ICB HTML
HTM HRZ HISTOGRAM HALD GROUP4 GRB GRAY GRADIENT GIF87 GIF GBR G3 G FTS
FRACTAL FITS FAX EXR ERF EPT3 EPT2 EPT EPSI EPSF EPS3 EPS2 EPS EPI EPDF
DPX DOT DNG DJVU DFONT DDS DCX DCR DCM CUT CUR CRW CR2 CMYKA CMYK CLIP
CIP CIN CAPTION CALS CAL C BRG BRF BMP3 BMP2 BMP BGRA BGR B AVS AVI ARW
ART AI A 3FR)

And that's a lot of text formats.

How about just adding the common ones -- jpeg?, tiff?, png, gif.  That
will take care of 99% of the problems.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/





^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#9044: 24.0.50; File mode specification error: (error "Malformed -*- line")
  2011-09-16  1:58             ` Lars Magne Ingebrigtsen
@ 2011-09-16 12:50               ` Juri Linkov
  2011-09-17  5:06                 ` Lars Magne Ingebrigtsen
  2011-09-17 21:58                 ` Chong Yidong
  0 siblings, 2 replies; 18+ messages in thread
From: Juri Linkov @ 2011-09-16 12:50 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: Peter Dyballa, 9044

[-- Attachment #1: Type: text/plain, Size: 1439 bytes --]

> The list is:
>
> (YUV YCbCrA YCbCr Y XWD XV XPS XPM XCF XC XBM X3F X WPG WMZ WMV WMF WBMP
> VST VIFF VID VICAR VDA UYVY UIL UBRL TXT TTF TTC TIM TILE TIFF64 TIFF
> THUMBNAIL TGA TEXT SVGZ SVG SUN STEGANO SRF SR2 SHTML SGI SFW SCT SCR
> RLE RLA RGBO RGBA RGB RBG RAS RAF RADIAL-GRADIENT R PWP PTIF PSD PSB PS3
> PS2 PS PREVIEW PPM PNM PNG8 PNG32 PNG24 PNG PLASMA PJPEG PIX PICT PICON
> PGX PGM PFM PFB PFA PES PEF PDFA PDF PDB PCX PCT PCL PCDS PCD PBM
> PATTERN PAM PALM PAL OTF OTB ORF O NULL NEF MVG MTV MSVG MSL MRW MPG
> MPEG MPC MP4 MOV MONO MNG MIFF MATTE MAT MAP M4V M2V M LABEL KDC K25 K
> JPX JPG JPEG JPC JP2 JNG J2C ISOBRL IPL INLINE INFO ICON ICO ICB HTML
> HTM HRZ HISTOGRAM HALD GROUP4 GRB GRAY GRADIENT GIF87 GIF GBR G3 G FTS
> FRACTAL FITS FAX EXR ERF EPT3 EPT2 EPT EPSI EPSF EPS3 EPS2 EPS EPI EPDF
> DPX DOT DNG DJVU DFONT DDS DCX DCR DCM CUT CUR CRW CR2 CMYKA CMYK CLIP
> CIP CIN CAPTION CALS CAL C BRG BRF BMP3 BMP2 BMP BGRA BGR B AVS AVI ARW
> ART AI A 3FR)
>
> And that's a lot of text formats.
>
> How about just adding the common ones -- jpeg?, tiff?, png, gif.  That
> will take care of 99% of the problems.

There are many other binary formats that may contain "-*-" in the first line.

For example, it's impossible to visit TGA files in Emacs because they contain
a lot of "-*-".  TARGA is an old raster graphics file format still used
in modern programs for saving screenshots.  You can see one example below:


[-- Attachment #2: 1311129378.tga --]
[-- Type: image/x-targa, Size: 196626 bytes --]

[-- Attachment #3: Type: text/plain, Size: 105 bytes --]


BTW, Gnus doesn't display images supported by ImageMagick inline.
Could you please fix this in Gnus ;-)

^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#9044: 24.0.50; File mode specification error: (error "Malformed -*- line")
  2011-09-16 12:50               ` Juri Linkov
@ 2011-09-17  5:06                 ` Lars Magne Ingebrigtsen
  2011-09-17 12:48                   ` Juri Linkov
  2011-09-17 21:58                 ` Chong Yidong
  1 sibling, 1 reply; 18+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-09-17  5:06 UTC (permalink / raw)
  To: Juri Linkov; +Cc: Peter Dyballa, 9044

Juri Linkov <juri@jurta.org> writes:

>> How about just adding the common ones -- jpeg?, tiff?, png, gif.  That
>> will take care of 99% of the problems.
>
> There are many other binary formats that may contain "-*-" in the first line.
>
> For example, it's impossible to visit TGA files in Emacs because they contain
> a lot of "-*-".  TARGA is an old raster graphics file format still used
> in modern programs for saving screenshots.  You can see one example below:

Sure.  Just go through the list and add the likely formats.  But using
the list as-is just won't fly, since it even contains "TXT" and "HTML".

> BTW, Gnus doesn't display images supported by ImageMagick inline.
> Could you please fix this in Gnus ;-)

I've now added support for ImageMagick pictures, but I can't get Emacs
to display that image inline.  `create-image' says that it creates the
image just fine, but when I `insert-image' it, I just get the dreaded
blank square box.  What does that mean?

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/





^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#9044: 24.0.50; File mode specification error: (error "Malformed -*- line")
  2011-09-17  5:06                 ` Lars Magne Ingebrigtsen
@ 2011-09-17 12:48                   ` Juri Linkov
  2011-09-18  7:49                     ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 18+ messages in thread
From: Juri Linkov @ 2011-09-17 12:48 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: Peter Dyballa, 9044

> Sure.  Just go through the list and add the likely formats.  But using
> the list as-is just won't fly, since it even contains "TXT" and "HTML".

We could remove text formats currently present in `imagemagick-types-inhibit':

  (C HTML HTM TXT PDF)

>> BTW, Gnus doesn't display images supported by ImageMagick inline.
>> Could you please fix this in Gnus ;-)
>
> I've now added support for ImageMagick pictures, but I can't get Emacs
> to display that image inline.  `create-image' says that it creates the
> image just fine, but when I `insert-image' it, I just get the dreaded
> blank square box.  What does that mean?

Debugging it reveals that lambda for "image/*" (BTW, is it a typo?
shouldn't this regexp be "image/.*"?) in `mm-inline-media-tests'
gets called twice and *Messages* shows:

  Invalid image number `nil' in image `(image :type imagemagick :data ...





^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#9044: 24.0.50; File mode specification error: (error "Malformed -*- line")
  2011-09-16 12:50               ` Juri Linkov
  2011-09-17  5:06                 ` Lars Magne Ingebrigtsen
@ 2011-09-17 21:58                 ` Chong Yidong
  2011-09-18  7:50                   ` Lars Magne Ingebrigtsen
  2011-09-18 19:28                   ` Juri Linkov
  1 sibling, 2 replies; 18+ messages in thread
From: Chong Yidong @ 2011-09-17 21:58 UTC (permalink / raw)
  To: Juri Linkov; +Cc: Lars Magne Ingebrigtsen, 9044, Peter Dyballa

Juri Linkov <juri@jurta.org> writes:

>> How about just adding the common ones -- jpeg?, tiff?, png, gif.  That
>> will take care of 99% of the problems.
>
> There are many other binary formats that may contain "-*-" in the
> first line.  For example, it's impossible to visit TGA files in Emacs
> because they contain a lot of "-*-".

I propose two fixes: (1) Adding some common image types to
inhibit-first-line-modes-regexps, and (2) changing
hack-local-variables-prop-line to return nil instead of signalling an
error for the "Malformed mode line" case.

Does anyone see a problem with this approach (in particular (2))?

=== modified file 'lisp/files.el'
*** lisp/files.el	2011-09-12 20:45:56 +0000
--- lisp/files.el	2011-09-17 21:56:13 +0000
***************
*** 2461,2467 ****
  
  See also `auto-mode-alist'.")
  
! (defvar inhibit-first-line-modes-regexps (mapcar 'purecopy '("\\.tar\\'" "\\.tgz\\'"))
    "List of regexps; if one matches a file name, don't look for `-*-'.")
  
  (defvar inhibit-first-line-modes-suffixes nil
--- 2461,2469 ----
  
  See also `auto-mode-alist'.")
  
! (defvar inhibit-first-line-modes-regexps
!   (mapcar 'purecopy '("\\.tar\\'" "\\.tgz\\'" "\\.tiff?\\'"
! 		      "\\.gif\\'" "\\.png\\'" "\\.jpe?g\\'"))
    "List of regexps; if one matches a file name, don't look for `-*-'.")
  
  (defvar inhibit-first-line-modes-suffixes nil
***************
*** 2952,2961 ****
  and VAL is the specified value.  Ignores any specification for
  `mode:' and `coding:' (which should have already been handled
  by `set-auto-mode' and `set-auto-coding', respectively).
! Throws an error if the -*- line is malformed.
  
  If MODE-ONLY is non-nil, just returns the symbol specifying the
  mode, if there is one, otherwise nil."
    (save-excursion
      (goto-char (point-min))
      (let ((end (set-auto-mode-1))
--- 2954,2964 ----
  and VAL is the specified value.  Ignores any specification for
  `mode:' and `coding:' (which should have already been handled
  by `set-auto-mode' and `set-auto-coding', respectively).
! Return nil if the -*- line is malformed.
  
  If MODE-ONLY is non-nil, just returns the symbol specifying the
  mode, if there is one, otherwise nil."
+   (catch 'fail
    (save-excursion
      (goto-char (point-min))
      (let ((end (set-auto-mode-1))
***************
*** 2974,2981 ****
  	     (while (and (or (not mode-only)
  			     (not result))
  			 (< (point) end))
! 	       (or (looking-at "[ \t]*\\([^ \t\n:]+\\)[ \t]*:[ \t]*")
! 		   (error "Malformed -*- line"))
  	       (goto-char (match-end 0))
  	       ;; There used to be a downcase here,
  	       ;; but the manual didn't say so,
--- 2977,2985 ----
  	     (while (and (or (not mode-only)
  			     (not result))
  			 (< (point) end))
! 	       (unless (looking-at "[ \t]*\\([^ \t\n:]+\\)[ \t]*:[ \t]*")
! 		 (message "Malformed mode-line")
! 		 (throw 'fail nil))
  	       (goto-char (match-end 0))
  	       ;; There used to be a downcase here,
  	       ;; but the manual didn't say so,
***************
*** 3005,3011 ****
  				       val) result)
  			 (error nil))))
  		 (skip-chars-forward " \t;")))
! 	     result)))))
  
  (defun hack-local-variables-filter (variables dir-name)
    "Filter local variable settings, querying the user if necessary.
--- 3009,3015 ----
  				       val) result)
  			 (error nil))))
  		 (skip-chars-forward " \t;")))
! 	     result))))))
  
  (defun hack-local-variables-filter (variables dir-name)
    "Filter local variable settings, querying the user if necessary.






^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#9044: 24.0.50; File mode specification error: (error "Malformed -*- line")
  2011-09-17 12:48                   ` Juri Linkov
@ 2011-09-18  7:49                     ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 18+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-09-18  7:49 UTC (permalink / raw)
  To: Juri Linkov; +Cc: Peter Dyballa, 9044

Juri Linkov <juri@jurta.org> writes:

> Debugging it reveals that lambda for "image/*" (BTW, is it a typo?
> shouldn't this regexp be "image/.*"?)

Yup, fixed.

> in `mm-inline-media-tests' gets called twice and *Messages* shows:
>
>   Invalid image number `nil' in image `(image :type imagemagick :data ...

Hm.  Where does that message come from?  And what does it mean?

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/





^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#9044: 24.0.50; File mode specification error: (error "Malformed -*- line")
  2011-09-17 21:58                 ` Chong Yidong
@ 2011-09-18  7:50                   ` Lars Magne Ingebrigtsen
  2011-09-18 19:28                   ` Juri Linkov
  1 sibling, 0 replies; 18+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-09-18  7:50 UTC (permalink / raw)
  To: Chong Yidong; +Cc: Peter Dyballa, 9044

Chong Yidong <cyd@stupidchicken.com> writes:

> (2) changing hack-local-variables-prop-line to return nil instead of
> signalling an error for the "Malformed mode line" case.
>
> Does anyone see a problem with this approach (in particular (2))?

Sounds good to me.  Not being able to examine a file just because of
spurious text in the file isn't very nice.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/





^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#9044: 24.0.50; File mode specification error: (error "Malformed -*- line")
  2011-09-17 21:58                 ` Chong Yidong
  2011-09-18  7:50                   ` Lars Magne Ingebrigtsen
@ 2011-09-18 19:28                   ` Juri Linkov
  2011-09-18 20:50                     ` Juri Linkov
  1 sibling, 1 reply; 18+ messages in thread
From: Juri Linkov @ 2011-09-18 19:28 UTC (permalink / raw)
  To: Chong Yidong; +Cc: Lars Magne Ingebrigtsen, 9044, Peter Dyballa

> I propose two fixes: (1) Adding some common image types to
> inhibit-first-line-modes-regexps,

There is a little inconsistency: the default values for some formats
are added to `inhibit-first-line-modes-regexps' in files.el.
But other values are added to `inhibit-first-line-modes-suffixes'
dynamically by `jka-compr-install' in jka-cmpr-hook.el.
But this is not important because some image formats are
already present in files.el in `auto-mode-alist'.

> and (2) changing hack-local-variables-prop-line to return nil instead
> of signalling an error for the "Malformed mode line" case.

Yes, displaying a message is better even when "Malformed mode-line"
is momentarily replaced with "Type C-c C-c to view the image as text",
because it still allows visiting image files.





^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#9044: 24.0.50; File mode specification error: (error "Malformed -*- line")
  2011-09-18 19:28                   ` Juri Linkov
@ 2011-09-18 20:50                     ` Juri Linkov
  2011-09-19 13:06                       ` Stefan Monnier
  0 siblings, 1 reply; 18+ messages in thread
From: Juri Linkov @ 2011-09-18 20:50 UTC (permalink / raw)
  To: Chong Yidong; +Cc: Lars Magne Ingebrigtsen, Peter Dyballa, 9044

BTW, I discovered a related problem - visiting the file `ebrowse'
in the `info' subdir fails with:

Debugger entered--Lisp error: (error "No Ebrowse file header found")
  signal(error ("No Ebrowse file header found"))
  error("No Ebrowse file header found")
  ebrowse-read()
  ebrowse-tree-mode()
  set-auto-mode-0(ebrowse-tree-mode nil)
  set-auto-mode()
  normal-mode(t)
  after-find-file(nil t)
  find-file-noselect-1(#<buffer ebrowse> "info/ebrowse" nil nil "info/ebrowse" (4068440 2054))
  find-file-noselect("info/ebrowse" nil nil nil)
  find-file("info/ebrowse")
  dired-find-file()
  call-interactively(dired-find-file nil nil)

It has the following entry in `auto-mode-alist':

     ("BROWSE\\'" . ebrowse-tree-mode)

but its case is ignored due to `auto-mode-case-fold'=t.





^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#9044: 24.0.50; File mode specification error: (error "Malformed -*- line")
  2011-09-18 20:50                     ` Juri Linkov
@ 2011-09-19 13:06                       ` Stefan Monnier
  2011-09-19 14:18                         ` Juri Linkov
  0 siblings, 1 reply; 18+ messages in thread
From: Stefan Monnier @ 2011-09-19 13:06 UTC (permalink / raw)
  To: Juri Linkov; +Cc: Lars Magne Ingebrigtsen, Chong Yidong, Peter Dyballa, 9044

> It has the following entry in `auto-mode-alist':
>      ("BROWSE\\'" . ebrowse-tree-mode)
> but its case is ignored due to `auto-mode-case-fold'=t.

Congratulations for finding the first such case.  The fix is simple:
rename `ebrowse' to `ebrowse.info'.


        Stefan





^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#9044: 24.0.50; File mode specification error: (error "Malformed -*- line")
  2011-09-19 13:06                       ` Stefan Monnier
@ 2011-09-19 14:18                         ` Juri Linkov
  0 siblings, 0 replies; 18+ messages in thread
From: Juri Linkov @ 2011-09-19 14:18 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Lars Magne Ingebrigtsen, Chong Yidong, Peter Dyballa, 9044

>> It has the following entry in `auto-mode-alist':
>>      ("BROWSE\\'" . ebrowse-tree-mode)
>> but its case is ignored due to `auto-mode-case-fold'=t.
>
> Congratulations for finding the first such case.

Maybe auto-mode-alist should be case-insensitive only for entries
that don't contain upper case letters (i.e. to follow the logic of
`isearch-no-upper-case-p')?

> The fix is simple: rename `ebrowse' to `ebrowse.info'.

Yes, this would help.  I don't know why Info files in the `info' subdir
miss the `.info' file extension.





^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2011-09-19 14:18 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-10 23:36 bug#9044: 24.0.50; File mode specification error: (error "Malformed -*- line") Peter Dyballa
2011-07-12 21:53 ` Glenn Morris
2011-07-12 23:27   ` Peter Dyballa
2011-07-13  0:01     ` Glenn Morris
2011-09-11  3:24       ` Lars Magne Ingebrigtsen
2011-09-15 18:37         ` Juri Linkov
2011-09-15 20:03           ` Stefan Monnier
2011-09-16  1:58             ` Lars Magne Ingebrigtsen
2011-09-16 12:50               ` Juri Linkov
2011-09-17  5:06                 ` Lars Magne Ingebrigtsen
2011-09-17 12:48                   ` Juri Linkov
2011-09-18  7:49                     ` Lars Magne Ingebrigtsen
2011-09-17 21:58                 ` Chong Yidong
2011-09-18  7:50                   ` Lars Magne Ingebrigtsen
2011-09-18 19:28                   ` Juri Linkov
2011-09-18 20:50                     ` Juri Linkov
2011-09-19 13:06                       ` Stefan Monnier
2011-09-19 14:18                         ` Juri Linkov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).