help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: no-word.el fails on Windows NT


From: poti
Subject: Re: no-word.el fails on Windows NT
Date: Thu, 31 May 2007 02:33:13 -0400
User-agent: Mutt/1.5.13 (2006-08-11)

On 10:21 Thu 24 May     , Eli Zaretskii wrote:
> > ..., 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. 
> 
...
> 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).
> 
...
> 
> Also, you should probably report the problem to the author.
> 
With the help of the author, I was able to come up with a solution. 
Rather than treating "-" as input from stdin, Windows treated "-" as 
a filename. Changing this to (buffer-name) worked across platforms. I 
added shell quoting, for good measure. Unless I hear of a more elegant 
solution, I will update  no-word.el on the Emacs wiki. 
Thank you for the help.
-Poti
> 
> _______________________________________________
> help-gnu-emacs mailing list
> help-gnu-emacs@gnu.org
> http://lists.gnu.org/mailman/listinfo/help-gnu-emacs





reply via email to

[Prev in Thread] Current Thread [Next in Thread]