diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2019-10-29 21:42:33 +0100 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2019-10-29 21:42:39 +0100 |
commit | 19c98f762092adab01bf35d4b0c958af7d4ea59e (patch) | |
tree | 7740857748d7b0d916593181762f26db1719e62d /lisp/files.el | |
parent | 1997e3b80f1046d789c4120d50e0f1dde05e7a74 (diff) | |
download | emacs-19c98f762092adab01bf35d4b0c958af7d4ea59e.tar.gz |
Default exotic image formats (like .webp) to image-mode
* doc/lispref/errors.texi (Standard Errors): Mention the new error.
* lisp/files.el (auto-mode-alist): Add a bunch of image suffixes
to the list (bug#37972) based on the output from "gm convert -list
format" (i.e., graphicsmagick).
* lisp/image-mode.el (image-mode): Rewrite to possibly notify the
user about image-use-external-converter.
(image-mode--setup-mode): Factor out into own function and don't
run under `condition-case' as there's nothing here that should
error.
* lisp/image.el (unknown-image-type): New error.
(image-type): Signal that error so that image-mode can offer
sensible feedback to the user.
Diffstat (limited to 'lisp/files.el')
-rw-r--r-- | lisp/files.el | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/lisp/files.el b/lisp/files.el index 4b364b49d84..f6dc4baa7fb 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2847,7 +2847,51 @@ ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\|CBR\\|7Z\\)\\'" . archive-mo ;; The following should come after the ChangeLog pattern ;; for the sake of ChangeLog.1, etc. ;; and after the .scm.[0-9] and CVS' <file>.<rev> patterns too. - ("\\.[1-9]\\'" . nroff-mode))) + ("\\.[1-9]\\'" . nroff-mode) + ;; Image file types probably supported by `image-convert'. + ("\\.art\\'" . image-mode) + ("\\.avs\\'" . image-mode) + ("\\.bmp\\'" . image-mode) + ("\\.cmyk\\'" . image-mode) + ("\\.cmyka\\'" . image-mode) + ("\\.crw\\'" . image-mode) + ("\\.dcr\\'" . image-mode) + ("\\.dcx\\'" . image-mode) + ("\\.dng\\'" . image-mode) + ("\\.dpx\\'" . image-mode) + ("\\.fax\\'" . image-mode) + ("\\.hrz\\'" . image-mode) + ("\\.icb\\'" . image-mode) + ("\\.icc\\'" . image-mode) + ("\\.icm\\'" . image-mode) + ("\\.ico\\'" . image-mode) + ("\\.icon\\'" . image-mode) + ("\\.jbg\\'" . image-mode) + ("\\.jbig\\'" . image-mode) + ("\\.jng\\'" . image-mode) + ("\\.jnx\\'" . image-mode) + ("\\.miff\\'" . image-mode) + ("\\.mng\\'" . image-mode) + ("\\.mvg\\'" . image-mode) + ("\\.otb\\'" . image-mode) + ("\\.p7\\'" . image-mode) + ("\\.pcx\\'" . image-mode) + ("\\.pdb\\'" . image-mode) + ("\\.pfa\\'" . image-mode) + ("\\.pfb\\'" . image-mode) + ("\\.picon\\'" . image-mode) + ("\\.pict\\'" . image-mode) + ("\\.rgb\\'" . image-mode) + ("\\.rgba\\'" . image-mode) + ("\\.tga\\'" . image-mode) + ("\\.wbmp\\'" . image-mode) + ("\\.webp\\'" . image-mode) + ("\\.wmf\\'" . image-mode) + ("\\.wpg\\'" . image-mode) + ("\\.xcf\\'" . image-mode) + ("\\.xmp\\'" . image-mode) + ("\\.xwd\\'" . image-mode) + ("\\.yuv\\'" . image-mode))) "Alist of filename patterns vs corresponding major mode functions. Each element looks like (REGEXP . FUNCTION) or (REGEXP FUNCTION NON-NIL). \(NON-NIL stands for anything that is not nil; the value does not matter.) |