From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: no-word.el fails on Windows NT Date: Thu, 24 May 2007 10:21:21 +0300 Message-ID: References: <20070523221703.GA17408@mail.potis.org> NNTP-Posting-Host: lo.gmane.org X-Trace: sea.gmane.org 1179991306 24087 80.91.229.12 (24 May 2007 07:21:46 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 24 May 2007 07:21:46 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu May 24 09:21:42 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Hr7dk-0002lu-7f for geh-help-gnu-emacs@m.gmane.org; Thu, 24 May 2007 09:21:40 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hr7dl-0006lu-F3 for geh-help-gnu-emacs@m.gmane.org; Thu, 24 May 2007 03:21:41 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Hr7dY-0006la-AA for help-gnu-emacs@gnu.org; Thu, 24 May 2007 03:21:28 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Hr7dW-0006lG-Di for help-gnu-emacs@gnu.org; Thu, 24 May 2007 03:21:27 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hr7dW-0006lD-6X for help-gnu-emacs@gnu.org; Thu, 24 May 2007 03:21:26 -0400 Original-Received: from romy.inter.net.il ([213.8.233.24]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Hr7dV-00066D-4f for help-gnu-emacs@gnu.org; Thu, 24 May 2007 03:21:25 -0400 Original-Received: from HOME-C4E4A596F7 (IGLD-84-228-2-188.inter.net.il [84.228.2.188]) by romy.inter.net.il (MOS 3.7.3-GA) with ESMTP id HXE59316 (AUTH halo1); Thu, 24 May 2007 10:21:16 +0300 (IDT) In-reply-to: <20070523221703.GA17408@mail.potis.org> X-detected-kernel: FreeBSD 4.7-5.2 (or MacOS X 10.2-10.4) (2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:44364 Archived-At: > Date: Wed, 23 May 2007 18:17:03 -0400 > From: poti@potis.org > > I am looking for an emacs interface for reading Microsoft Word > documents. I have been using antiword, which is fine and has > an emacs mode provided by no-word.el. This works fine on OSX and > Linux. However, when I visit a doc file on Windows NT, I get the > following error: > > - is not a Word Document. > > > This appears to be related to the following elisp code: > (if file (replace-regexp-in-string " " "\\ " file t t) "-") > which is concatenated to the command "antiword" and options. > This is in the no-word function, where file is optional. > Apparently, visiting the file does not pass a file to this function. > This is as much as I can figure out. Why is the behavior different on > Windows, is there a fix that will work as expected across platforms? I think this is a bug in no-word.el: it assumes that the shell invoked by shell-command-on-region is a Unixy shell, and so uses that shell's quoting rules to escape-protect spaces in file names. But on Windows, the standard shell is cmd.exe, which doesn't understand those quoting rules. Try to change the above line to this (untested): (if file (setq file (shell-quote-argument file))) (this uses the quoting rules suitable for the underlying platform's shell). Note that there are 2 more instances of such quoting in no-word.el; you may wish to modify them as well. Also, you should probably report the problem to the author.