emacs-devel
[Top][All Lists]
Advanced

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

Re: [ELPA] Package proposal: gnus-mock


From: Eric Abrahamsen
Subject: Re: [ELPA] Package proposal: gnus-mock
Date: Fri, 12 Oct 2018 10:24:21 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

>> From: Eric Abrahamsen <address@hidden>
>> Date: Wed, 10 Oct 2018 12:53:51 -0700
>> 
>> >> 2. There's a small Python script in there that acts as a dummy sendmail
>> >> command: when you send an email from a Gnus mock installation, it
>> >> hands it off to the Python script, which boomerangs it back to a
>> >> folder in the local installation, so you can send yourself messages
>> >>    and see what they look like. The script is called with
>> >>    "#!/usr/bin/env python", which I assume will be fine for Unix-y
>> >>    platforms, but maybe not work for Windows. I'd like it to work for
>> >>    Windows -- does anyone have suggestions for a more portable way of
>> >>    doing this?
>> >
>> > Issue a shell command "python SCRIPT"?
>> 
>> That would work on Windows? (I know nothing about Windows.)
>
> Yes, it should.  'python' is a normal executable, so Windows should
> know how to run it.  It's the assumption that the OS understands the
> hash-bang signature of a script that's unportable, it is
> Unix-specific.
>
>> The problem is that I'm injecting this program at the lowest level
>> possible, as the value of `sendmail-program', so that
>> `message-send-mail-with-sendmail' works correctly, and all aspects of
>> Gnus/message code can be tested. `sendmail-program' is called with
>> `call-process-region', so it needs to be an executable.
>
> python.exe is an executable.
>
>> Would there be some way to write an executable wrapper around the
>> python program? What would that look like on Windows?
>
> It's possible (with CPython, AFAIK), but why ask users to do something
> like that?  Invoking the interpreter directly is much easier, IMO.

I don't want to make the users do anything, I'm just saying that I can't
change `message-send-mail-with-sendmail' to use
`shell-command-on-region' instead of `call-process-region'. I could
override `message-send-mail-with-sendmail' to use a custom function for
Windows users, but I'd rather not do that in case the original function
is exactly what someone is trying to test.

Eric




reply via email to

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