Stefan Monnier writes: > > I think it's a good idea. It may require some non-trivial changes on > the Lisp side, since libmagic's information is not quite the same as > what Emacs currently uses: we'll probably want to use libmagic to get > a MIME-type and then have a table mapping mime-types to major modes or > some such. > > > Stefan I attach an early draft filemagic patch. Some notes: - The mime type info usualy is less granular than the free text info: file --mime /tmp/tst.xcf /tmp/tst.xcf: application/octet-stream; charset=binary file /tmp/tst.xcf /tmp/tst.xcf: GIMP XCF image data, version 0, 640 x 480, RGB Color This is dependent on the file magic info file used. - We can probably have much fun debating what the interface should look like at the lisp level. Any ideas?