From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: DocView now supports OpenDocument & MS Office formats Date: Thu, 30 Dec 2010 11:04:25 -0500 Message-ID: References: <87vd2bxskk.fsf@member.fsf.org> <67C423E857BB47B7AFAE5F39568E36A0@us.oracle.com> <87mxnnxql8.fsf@member.fsf.org> <87ei8zxnvw.fsf@member.fsf.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1293725077 13045 80.91.229.12 (30 Dec 2010 16:04:37 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 30 Dec 2010 16:04:37 +0000 (UTC) Cc: Drew Adams , emacs-devel@gnu.org To: Tassilo Horn Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 30 17:04:32 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PYKzQ-0001pI-0e for ged-emacs-devel@m.gmane.org; Thu, 30 Dec 2010 17:04:32 +0100 Original-Received: from localhost ([127.0.0.1]:56149 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PYKzP-0002Xr-Jz for ged-emacs-devel@m.gmane.org; Thu, 30 Dec 2010 11:04:31 -0500 Original-Received: from [140.186.70.92] (port=45929 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PYKzL-0002XU-0M for emacs-devel@gnu.org; Thu, 30 Dec 2010 11:04:27 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PYKzJ-0008GV-V8 for emacs-devel@gnu.org; Thu, 30 Dec 2010 11:04:26 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:15962 helo=ironport2-out.pppoe.ca) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PYKzJ-0008GR-RE for emacs-devel@gnu.org; Thu, 30 Dec 2010 11:04:25 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAD88HE1FpZcL/2dsb2JhbACkOnS/BYIUgzYEhGWOGw X-IronPort-AV: E=Sophos;i="4.60,249,1291611600"; d="scan'208";a="86793491" Original-Received: from 69-165-151-11.dsl.teksavvy.com (HELO pastel.home) ([69.165.151.11]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 30 Dec 2010 11:04:25 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 11B4859331; Thu, 30 Dec 2010 11:04:25 -0500 (EST) In-Reply-To: <87ei8zxnvw.fsf@member.fsf.org> (Tassilo Horn's message of "Thu, 30 Dec 2010 16:48:35 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:134052 Archived-At: > So something along the lines of: > - ("\\.\\(?:PDF\\|DVI\\|pdf\\|dvi\\)\\'" . doc-view-mode) > + ,(if (executable-find "unoconv") > + > ("\\.\\(?:PDF\\|DVI\\|OD[FGPST]\\|DOCX?\\|XLSX?\\|pdf\\|dvi\\|od[fgpst]\\|docx?\\|xlsx?\\)\\'" > . doc-view-mode) > + '("\\.\\(?:PDF\\|DVI\\|pdf\\|dvi\\)\\'" . doc-view-mode)) Could be an approach, except that files.el is preloaded, so that would be evaluated at dump time rather than run time. Another is to link them to doc-view-mode-maybe which would first check whether doc-view-mode can really be used and fallback to the next best choice otherwise (could even remove itself from auto-mode-alist at that point, tho it's not clear that it would be useful). Stefan