[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: |
Tue, 5 Jun 2007 21:40:07 -0400 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
On 08:05 Fri 01 Jun , Kevin Rodgers wrote:
> poti@potis.org wrote:
> >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.
>
> (buffer-name) does not return a file name that corresponds to stdin on
> any platform, so why does that work?
I did in fact want the file name. It seemed to me (buffer-name) would
work out to shell-command-on-region issuing a shell command roughly
amounting to "antiword myfile.doc"
The author was using (doc-name (buffer-name)) to name the temp buffer
into which the output of antiword was placed. That is where I got
the idea to use (buffer-name).
The reason it was working is because in the cases I tried, it did in
fact work out to this. However I see from your correction how this
could fail.
Reading how find-file-noselect works, I see the buffer
name was coming from create-file-buffer, which could have named the
buffer myfile.doc<2>, which would not work.
>
> If you want the name of the file that the buffer is visiting, use
> (buffer-file-name) or (file-name-nondirectory (buffer-file-name)),
> shell-quoted of course.
Thank you for showing the right way to do this.
-Poti