From: Robert Pluim Date: Fri, 15 Nov 2019 10:23:20 +0000 (+0100) Subject: Used magic-fallback-mode-alist to detect .doc files (Bug#20891) X-Git-Tag: emacs-27.0.90~607 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=904146cf798122aa6610fdd5209986918dad043a;p=emacs.git Used magic-fallback-mode-alist to detect .doc files (Bug#20891) This avoids running doc-view-mode on files that are actually text files. * lisp/files.el (auto-mode-alist): Don't use doc-view-mode-maybe for .doc (but continue to do so for .docx). (magic-fallback-mode-alist): Add signature for .doc files. --- diff --git a/lisp/files.el b/lisp/files.el index 053583b4cbb..448e00cbd75 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2798,7 +2798,7 @@ ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\|CBR\\|7Z\\)\\'" . archive-mo ("\\.\\(diffs?\\|patch\\|rej\\)\\'" . diff-mode) ("\\.\\(dif\\|pat\\)\\'" . diff-mode) ; for MS-DOS ("\\.[eE]?[pP][sS]\\'" . ps-mode) - ("\\.\\(?:PDF\\|DVI\\|OD[FGPST]\\|DOCX?\\|XLSX?\\|PPTX?\\|pdf\\|djvu\\|dvi\\|od[fgpst]\\|docx?\\|xlsx?\\|pptx?\\)\\'" . doc-view-mode-maybe) + ("\\.\\(?:PDF\\|DVI\\|OD[FGPST]\\|DOCX\\|XLSX?\\|PPTX?\\|pdf\\|djvu\\|dvi\\|od[fgpst]\\|docx\\|xlsx?\\|pptx?\\)\\'" . doc-view-mode-maybe) ("configure\\.\\(ac\\|in\\)\\'" . autoconf-mode) ("\\.s\\(v\\|iv\\|ieve\\)\\'" . sieve-mode) ("BROWSE\\'" . ebrowse-tree-mode) @@ -3062,6 +3062,7 @@ If FUNCTION is nil, then it is not called. (That is a way of saying (comment-re (concat "\\(?:!--" incomment-re "*-->[ \t\r\n]*<\\)"))) (concat "[ \t\r\n]*<" comment-re "*!DOCTYPE ")) . sgml-mode) + ("\320\317\021\340\241\261\032\341" . doc-view-mode-maybe) ; Word documents 1997-2004 ("%!PS" . ps-mode) ("# xmcd " . conf-unix-mode))) "Like `magic-mode-alist' but has lower priority than `auto-mode-alist'.