From: Robert Pluim <rpluim@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: era+emacs@iki.fi, Andreas Schwab <schwab@suse.de>,
larsi@gnus.org, 20891@debbugs.gnu.org, stefan@marxist.se
Subject: bug#20891: emacs: Back off if .doc is not an Office document
Date: Fri, 15 Nov 2019 10:14:19 +0100 [thread overview]
Message-ID: <m2d0dtfqms.fsf@gmail.com> (raw)
In-Reply-To: <83sgmq4dfj.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 14 Nov 2019 18:42:40 +0200")
>>>>> On Thu, 14 Nov 2019 18:42:40 +0200, Eli Zaretskii <eliz@gnu.org> said:
Eli> So we want to remove docx? from auto-mode-alist and instead to add the
Eli> magic signature to magic-mode-alist? But then AFAIK MS Word documents
Eli> had different signatures for different versions, so we should have
Eli> several. And a literal docx should be left in auto-mode-alist, right?
Yes. The following detects a word 97 file for me, and a text .doc file
opens in fundamental-mode.
diff --git i/lisp/files.el w/lisp/files.el
index 053583b4cb..ea3d3deb34 100644
--- i/lisp/files.el
+++ w/lisp/files.el
@@ -2798,7 +2798,7 @@ auto-mode-alist
("\\.\\(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 @@ magic-fallback-mode-alist
(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)
("%!PS" . ps-mode)
("# xmcd " . conf-unix-mode)))
"Like `magic-mode-alist' but has lower priority than `auto-mode-alist'.
next prev parent reply other threads:[~2019-11-15 9:14 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-24 11:19 bug#20891: emacs: Back off if .doc is not an Office document era+emacs
2019-08-01 20:53 ` Lars Ingebrigtsen
2019-11-06 1:53 ` Stefan Kangas
2019-11-06 13:08 ` era
2019-11-06 23:19 ` Stefan Kangas
2019-11-07 4:45 ` Richard Stallman
2019-11-07 8:29 ` era
2019-11-08 20:59 ` Lars Ingebrigtsen
2019-11-09 6:25 ` Eli Zaretskii
2019-11-09 20:14 ` Lars Ingebrigtsen
2019-11-14 8:54 ` Eli Zaretskii
2019-11-14 9:55 ` Lars Ingebrigtsen
2019-11-14 14:12 ` Eli Zaretskii
2019-11-14 15:06 ` Robert Pluim
2019-11-14 16:19 ` Eli Zaretskii
2019-11-14 16:33 ` Andreas Schwab
2019-11-14 16:42 ` Eli Zaretskii
2019-11-15 7:51 ` Lars Ingebrigtsen
2019-11-15 8:48 ` Eli Zaretskii
2019-11-15 8:56 ` Lars Ingebrigtsen
2019-11-15 9:51 ` Eli Zaretskii
2019-11-15 13:20 ` Robert Pluim
2019-11-15 9:14 ` Robert Pluim [this message]
2019-11-15 7:50 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2d0dtfqms.fsf@gmail.com \
--to=rpluim@gmail.com \
--cc=20891@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=era+emacs@iki.fi \
--cc=larsi@gnus.org \
--cc=schwab@suse.de \
--cc=stefan@marxist.se \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).