emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Image-conversion shims


From: Lars Ingebrigtsen
Subject: Re: Image-conversion shims
Date: Tue, 01 Oct 2019 14:06:55 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

>> > I don't think I understand why we can't put the association in
>> > auto-mode-alist before running "gm convert".  Please elaborate why.
>> 
>> If we put (say) .webp into auto-mode-alist, but we can't read .webp
>> files, then image-mode will end up issuing an error when called on these
>> files.
>
> I thought when image-mode is invoked, the external converter is called
> automagically, no?

The user may not have any of the required external converters installed.

>> Besides, what formats "gm convert" supports changes over time.  By
>> consulting it, auto-mode-alist will be automatically updated without us
>> having to do anything.
>
> Yes, but I think it's better to have a solution that is 99% correct
> and simple, rather than one that is 100% and much more complex.  After
> all, this is somewhat obscure use case, at least for now.

It is.  I'm concerned about three things: 1) Long-time maintenance of all
these auto-mode-alist mapping, 2) the less-than ideal user experience of
being presented with image-mode and an error instead of a
fundamental-mode buffer as today (if you don't have the converters), and
3) possibly stomping on a user's own addition to auto-mode-alist (if
the user adds mapping to the end of the alist).

By having these modes being absolutely-the-last-fallback (when the user
has enabled this at all), then we avoid all those problems.

Because the list of formats covered by these converters is huge, and
putting all of these into the default auto-mode-alist would be a
problem.

(image-converter--probe 'graphicsmagick)
=> ("3fr" "8bim" "8bimtext" "8bimwtext" "app1" "app1jpeg" "art" "arw" "avs" "b" 
"bie" "bigtiff" "bmp" "c" "cals" "caption" "cin" "cmyk" "cmyka" "cr2" "crw" 
"cur" "cut" "dcm" "dcr" "dcx" "dng" "dpx" "epdf" "epi" "eps" "epsf" "epsi" 
"ept" "ept2" "ept3" "erf" "exif" "fax" "file" "fits" "fractal" "ftp" "g" "gif" 
"gif87" "gradient" "gray" "graya" "hrz" "http" "icb" "icc" "icm" "ico" "icon" 
"identity" "image" "iptc" "iptctext" "iptcwtext" "jbg" "jbig" "jng" "jnx" 
"jpeg" "jpg" "k" "k25" "kdc" "label" "m" "mac" "map" "mat" "mef" "miff" "mng" 
"mono" "mpc" "mrw" "msl" "mtv" "mvg" "nef" "null" "o" "orf" "otb" "p7" "pal" 
"palm" "pam" "pbm" "pcd" "pcds" "pct" "pcx" "pdb" "pdf" "pef" "pfa" "pfb" "pgm" 
"picon" "pict" "pix" "plasma" "png" "png00" "png24" "png32" "png48" "png64" 
"png8" "pnm" "ppm" "ps" "ptif" "pwp" "r" "raf" "ras" "rgb" "rgba" "rla" "rle" 
"sct" "sfw" "sgi" "sr2" "srf" "stegano" "sun" "svg" "svgz" "text" "tga" "tiff" 
"tile" "tim" "topol" "ttf" "txt" "uyvy" "vda" "vicar" "vid" "viff" "vst" "wbmp" 
"webp" "wmf" "wpg" "x" "x3f" "xbm" "xc" "xcf" "xmp" "xpm" "xv" "xwd" "y" "yuv")

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]