From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.bugs Subject: bug#14188: 24.3.50; ODF files and auto-mode-alist Date: Wed, 17 Apr 2013 20:30:08 +0200 Message-ID: <87fvypqabz.fsf@rosalinde.fritz.box> References: <87a9p4deqb.fsf@rosalinde.fritz.box> <87k3o1i87k.fsf@thinkpad.tsdh.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1366223454 24013 80.91.229.3 (17 Apr 2013 18:30:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 17 Apr 2013 18:30:54 +0000 (UTC) Cc: 14188@debbugs.gnu.org To: Tassilo Horn Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Apr 17 20:30:56 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1USX85-0001ew-W2 for geb-bug-gnu-emacs@m.gmane.org; Wed, 17 Apr 2013 20:30:50 +0200 Original-Received: from localhost ([::1]:38388 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USX85-0003jz-Iq for geb-bug-gnu-emacs@m.gmane.org; Wed, 17 Apr 2013 14:30:49 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:44279) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USX7x-0003ji-Fi for bug-gnu-emacs@gnu.org; Wed, 17 Apr 2013 14:30:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1USX7u-0005A5-3V for bug-gnu-emacs@gnu.org; Wed, 17 Apr 2013 14:30:41 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:52996) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USX7u-0005A1-0c for bug-gnu-emacs@gnu.org; Wed, 17 Apr 2013 14:30:38 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1USXC9-0005Hv-MW for bug-gnu-emacs@gnu.org; Wed, 17 Apr 2013 14:35:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 Apr 2013 18:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14188 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 14188-submit@debbugs.gnu.org id=B14188.136622368120283 (code B ref 14188); Wed, 17 Apr 2013 18:35:01 +0000 Original-Received: (at 14188) by debbugs.gnu.org; 17 Apr 2013 18:34:41 +0000 Original-Received: from localhost ([127.0.0.1]:57105 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1USXBo-0005H4-6l for submit@debbugs.gnu.org; Wed, 17 Apr 2013 14:34:40 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]:57686) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1USXBl-0005Gq-Ab for 14188@debbugs.gnu.org; Wed, 17 Apr 2013 14:34:39 -0400 Original-Received: from mailout-de.gmx.net ([10.1.76.31]) by mrigmx.server.lan (mrigmx002) with ESMTP (Nemesis) id 0MckQB-1UB8rK2Zyz-00HyUj for <14188@debbugs.gnu.org>; Wed, 17 Apr 2013 20:30:11 +0200 Original-Received: (qmail invoked by alias); 17 Apr 2013 18:30:10 -0000 Original-Received: from i59F54C07.versanet.de (EHLO rosalinde.fritz.box) [89.245.76.7] by mail.gmx.net (mp031) with SMTP; 17 Apr 2013 20:30:10 +0200 X-Authenticated: #20778731 X-Provags-ID: V01U2FsdGVkX1/WgBtEOXXWCJy/KQUt3+OEl+r0YFtXrDKcUW3f5U LQ2rJ6yyXe1XIp In-Reply-To: <87k3o1i87k.fsf@thinkpad.tsdh.de> (Tassilo Horn's message of "Wed, 17 Apr 2013 15:43:11 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-Y-GMX-Trusted: 0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:73480 Archived-At: On Wed, 17 Apr 2013 15:43:11 +0200 Tassilo Horn wrote: > Stephen Berman writes: > >> The extension .od[fgpst] for ODF files occurs twice as part of a key >> in the default value of auto-mode-alist, paired first with >> archive-mode and later with doc-view-mode-maybe. As a result, >> visiting such a file shows the directory-style listing of the archive >> instead of the files content. To see the latter, you have to >> explicitly invoke doc-view-mode. But if .od[fgpst] is removed from >> the key paired with archive-mode, then visiting such a file shows the >> content after conversion, and when you type C-c C-c, it switches to >> the archive listing, due to magic-fallback-mode-alist.[1] I think this >> is better behavior. I can't test files with the other extensions in >> the problematic entry ("\\.\\(sx[dmicw]\\|od[fgpst]\\|oxt\\)\\'" >> . archive-mode), so I don't know if the whole entry should be deleted >> or only "od[fgpst]\\|". > > Hm, I think for OpenDocument files, the alternatives of a user wanting > to view the file using archive-mode and doc-view-mode are equally > likely. That's not the case for me, and I'd be surprised if it were for most users. I virtually always want to simply view the document's content in Emacs. I guess the only reason to want to open it in archive-mode is to edit one of the XML source files, but since most or all of these are formatted as one line, it isn't fun to edit the source. Usually I edit ODF files with LibreOffice. > doc-view-mode is arguably more heavy-weight, so probably > archive-mode should stay the default. This is a strong argument, though not a knock-out argument, since if most users are like me, they would toggle to the image anyway, so it would be an extra step if archive-mode remained the default. With doc-view-mode-maybe the default, it's just as easy to toggle to archive-mode, should you want to (which again, I seldom do). > But it should be easier and > obvious to start doc-view-mode from there. > > So how about using the PS (PostScript) approach also here? That is, we > remove the ODF regexes for doc-view-mode-maybe from auto-mode-alist, and > in archive-mode we check if the current archive is an ODF file, and if > so, enable doc-view-minor-mode. > > This would message > > Type M-x doc-view-toggle-display to toggle between editing or viewing > the document. > > thus indicating to the user how he can view the document with doc-view > instead of editing it as an archive. > > Does that sound reasonable? If the message really were what you wrote, I would find that unacceptable. But when I enable doc-view-minor-mode in archive-mode, I see the message Type C-c C-c to toggle between editing or viewing the document. This is acceptable (i.e., the key binding is IMO a must). But again, even better IMO would be to just have doc-view-mode-maybe, falling back to archive-mode when you type C-c C-c. Whichever decision you make, I do think you should do the same with MS OpenXML (.docx, .xlsx) files, too. (These are currently only paired with doc-view-mode-maybe.) Steve Berman