aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Pluim2019-11-15 11:23:20 +0100
committerRobert Pluim2019-11-15 14:18:07 +0100
commit904146cf798122aa6610fdd5209986918dad043a (patch)
treefeca4ab647cdb9845e3b8498bb32d26dd5b203db
parent48169f7c65b2f9c78aa8c066a8b89df13f08ff61 (diff)
downloademacs-904146cf798122aa6610fdd5209986918dad043a.tar.gz
emacs-904146cf798122aa6610fdd5209986918dad043a.zip
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.
-rw-r--r--lisp/files.el3
1 files changed, 2 insertions, 1 deletions
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
2798 ("\\.\\(diffs?\\|patch\\|rej\\)\\'" . diff-mode) 2798 ("\\.\\(diffs?\\|patch\\|rej\\)\\'" . diff-mode)
2799 ("\\.\\(dif\\|pat\\)\\'" . diff-mode) ; for MS-DOS 2799 ("\\.\\(dif\\|pat\\)\\'" . diff-mode) ; for MS-DOS
2800 ("\\.[eE]?[pP][sS]\\'" . ps-mode) 2800 ("\\.[eE]?[pP][sS]\\'" . ps-mode)
2801 ("\\.\\(?:PDF\\|DVI\\|OD[FGPST]\\|DOCX?\\|XLSX?\\|PPTX?\\|pdf\\|djvu\\|dvi\\|od[fgpst]\\|docx?\\|xlsx?\\|pptx?\\)\\'" . doc-view-mode-maybe) 2801 ("\\.\\(?:PDF\\|DVI\\|OD[FGPST]\\|DOCX\\|XLSX?\\|PPTX?\\|pdf\\|djvu\\|dvi\\|od[fgpst]\\|docx\\|xlsx?\\|pptx?\\)\\'" . doc-view-mode-maybe)
2802 ("configure\\.\\(ac\\|in\\)\\'" . autoconf-mode) 2802 ("configure\\.\\(ac\\|in\\)\\'" . autoconf-mode)
2803 ("\\.s\\(v\\|iv\\|ieve\\)\\'" . sieve-mode) 2803 ("\\.s\\(v\\|iv\\|ieve\\)\\'" . sieve-mode)
2804 ("BROWSE\\'" . ebrowse-tree-mode) 2804 ("BROWSE\\'" . ebrowse-tree-mode)
@@ -3062,6 +3062,7 @@ If FUNCTION is nil, then it is not called. (That is a way of saying
3062 (comment-re (concat "\\(?:!--" incomment-re "*-->[ \t\r\n]*<\\)"))) 3062 (comment-re (concat "\\(?:!--" incomment-re "*-->[ \t\r\n]*<\\)")))
3063 (concat "[ \t\r\n]*<" comment-re "*!DOCTYPE ")) 3063 (concat "[ \t\r\n]*<" comment-re "*!DOCTYPE "))
3064 . sgml-mode) 3064 . sgml-mode)
3065 ("\320\317\021\340\241\261\032\341" . doc-view-mode-maybe) ; Word documents 1997-2004
3065 ("%!PS" . ps-mode) 3066 ("%!PS" . ps-mode)
3066 ("# xmcd " . conf-unix-mode))) 3067 ("# xmcd " . conf-unix-mode)))
3067 "Like `magic-mode-alist' but has lower priority than `auto-mode-alist'. 3068 "Like `magic-mode-alist' but has lower priority than `auto-mode-alist'.