From: poti@potis.org
To: help-gnu-emacs@gnu.org
Subject: Re: no-word.el fails on Windows NT
Date: Tue, 5 Jun 2007 21:40:07 -0400 [thread overview]
Message-ID: <20070606014007.GA11705@mail.potis.org> (raw)
In-Reply-To: <f3p933$qol$1@sea.gmane.org>
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
prev parent reply other threads:[~2007-06-06 1:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-23 22:17 no-word.el fails on Windows NT poti
2007-05-24 7:21 ` Eli Zaretskii
2007-05-24 20:07 ` poti
2007-05-25 5:31 ` Eli Zaretskii
2007-05-25 6:22 ` poti
2007-05-25 12:45 ` Eli Zaretskii
2007-05-31 6:33 ` poti
2007-06-01 14:05 ` Kevin Rodgers
2007-06-06 1:40 ` poti [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070606014007.GA11705@mail.potis.org \
--to=poti@potis.org \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.