From: "Juan José García-Ripoll" <juanjose.garciaripoll@gmail.com>
To: emacs-devel@gnu.org
Subject: Re: Problems with call-process (= identifying run-python issues)
Date: Wed, 19 Aug 2020 10:59:39 +0200 [thread overview]
Message-ID: <865z9fggec.fsf@csic.es> (raw)
In-Reply-To: 83wo1vexck.fsf@gnu.org
Eli Zaretskii <eliz@gnu.org> writes:
> Is it all needed? If so, can you explain its role here?
>> Option A:
>> 1. Save files with the specified names and locations
>> 2. Open a command line processor (cmd.exe or PowerShell)
>> 3. Invoke "runemacs -Q --load c:\Users\juanj\Downloads\test.el"
>>
>> Option B:
>> 1. Save files with the specified names
>> 2. Press Windows Key + R (to enter commands)
>> 2. Enter "runemacs -Q --load c:\Users\juanj\Downloads\test.el"
>
> Then I'm afraid I don't understand what the script chain.cmd does and
> what it expects from Emacs or the user. Can you please take me though
> this recipe one step at a time?
Ok, let me please explain the problem: I want to run a process that gets
its input from a file, while Emacs collects its output. This is standard
working in many programming modes. For instance, it is the way
run-python calls python to find out the prompt.
I am finding that when I launch Emacs from the windowing environment
(e.g. shortcuts, Start menu, Windows key + R, explorer), Emacs does not
redirect the input of the subprocess properly. If I launch the Emacs
from the command line, the subprocess works as expected.
To reproduce this I have created a minimal example:
- A bogus input file (foo), that is going to be the redirected input of our
program
- A script, chain.cmd that copies all input to its output, line by
line. This is going to be the subprocess. Unfortunately, Windows does
not have a 'cat' command, which is why I did it this way.
- An elisp file (test.el) that launches the process with the redirected
input and collects the output
This example can be ran in three different ways:
- Invoking runemacs.exe -Q --load test.el from the command line
- Running the same command with Windows key + R
- Creating a shortcut that does the same.
All ingredients are needed, because we need a reproducible program, an
input file and some sophisticated commands that use Emacs'
call-process. However, it is *not* complicated at all and everything is
pretty standard.
One consequence of this problem is that run-python does not work as
expected (Emacs fails to find the prompt), but as I try to show, this is
not due to Python.
Note that this problem is related to the ispell problems I mentioned
before, but it is not the same. I already knew about the issues I was
experiencing with call-process when using python or other programs, and
those problems made me assume the aspell.exe was experiencing them as
well. *That* analysis was incorrect, but this case is way simpler and it
is reproducible using only Windows tools.
Cheers,
Juanjo
--
Juan José García Ripoll
http://juanjose.garciaripoll.com
http://quinfog.hbar.es
next prev parent reply other threads:[~2020-08-19 8:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-18 13:36 Problems with call-process (= identifying run-python issues) Juan José García-Ripoll
2020-08-18 15:41 ` Eli Zaretskii
[not found] ` <CANejTzpQdx=7gzbkV-gzoyFKHx+U1sKy2Uid13g6hpwCa_GnRA@mail.gmail.com>
2020-08-18 16:24 ` Eli Zaretskii
2020-08-19 8:59 ` Juan José García-Ripoll [this message]
2020-08-19 14:41 ` Eli Zaretskii
2020-08-19 16:23 ` Juan José García-Ripoll
2020-08-19 17:03 ` Eli Zaretskii
2020-08-20 7:52 ` Juan José García-Ripoll
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=865z9fggec.fsf@csic.es \
--to=juanjose.garciaripoll@gmail.com \
--cc=emacs-devel@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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).