From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: poti@potis.org Newsgroups: gmane.emacs.help Subject: Re: no-word.el fails on Windows NT Date: Thu, 24 May 2007 16:07:12 -0400 Message-ID: <20070524200712.GA19423@mail.potis.org> References: <20070523221703.GA17408@mail.potis.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1180037308 17407 80.91.229.12 (24 May 2007 20:08:28 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 24 May 2007 20:08:28 +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 22:08:24 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 1HrJbi-0004qB-Mk for geh-help-gnu-emacs@m.gmane.org; Thu, 24 May 2007 22:08:22 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HrJbl-0003WD-Fw for geh-help-gnu-emacs@m.gmane.org; Thu, 24 May 2007 16:08:25 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HrJbY-0003Vy-KV for help-gnu-emacs@gnu.org; Thu, 24 May 2007 16:08:12 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HrJbY-0003Vm-7Q for help-gnu-emacs@gnu.org; Thu, 24 May 2007 16:08:12 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HrJbY-0003Vj-0S for help-gnu-emacs@gnu.org; Thu, 24 May 2007 16:08:12 -0400 Original-Received: from sitemail2.everyone.net ([216.200.145.36] helo=omta09.mta.everyone.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HrJbX-0007AX-Fy for help-gnu-emacs@gnu.org; Thu, 24 May 2007 16:08:11 -0400 Original-Received: from pop15.mta.everyone.net (bigiplb-dsnat [172.16.0.19]) by omta09.mta.everyone.net (Postfix) with ESMTP id 516D2400A9 for ; Thu, 24 May 2007 13:08:10 -0700 (PDT) X-Eon-Dm: pop15 Original-Received: by pop15.mta.everyone.net (EON-AUTHRELAY2 - 48f102f2) id pop15.4654e56c.26cca for ; Thu, 24 May 2007 13:08:08 -0700 X-Eon-Sig: AQLTeK1GVfCojDeklQIAAAAB,456870736c9f38758ec8d0db6417db6e Original-Received: by potis.org (nbSMTP-1.00) for uid 1000 poti@potis.org; Thu, 24 May 2007 16:07:13 -0400 (EDT) Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.13 (2006-08-11) X-detected-kernel: Linux 2.4-2.6 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:44399 Archived-At: On 10:21 Thu 24 May , Eli Zaretskii wrote: > > 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. > I tried your suggestion. It failed in the same way. When the no-word command is called by the interactive function through M-x no-word-find-file everything works. The problem appears to be in what happens when a file is visited with C-x C-f, in particular, with how "-" is understood in Windows. > Also, you should probably report the problem to the author. I will forward a copy of this to him.