From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.devel Subject: Re: [ELPA] Package proposal: gnus-mock Date: Fri, 12 Oct 2018 10:24:21 -0700 Message-ID: <87d0sfxem2.fsf@ericabrahamsen.net> References: <87d0shr60b.fsf@ericabrahamsen.net> <83d0shy6bq.fsf@gnu.org> <87tvltmvcg.fsf@ericabrahamsen.net> <83lg73wpfc.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1539364966 32292 195.159.176.226 (12 Oct 2018 17:22:46 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 12 Oct 2018 17:22:46 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 12 19:22:41 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gB197-0008GT-07 for ged-emacs-devel@m.gmane.org; Fri, 12 Oct 2018 19:22:41 +0200 Original-Received: from localhost ([::1]:41864 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gB1BD-0007Dl-Bh for ged-emacs-devel@m.gmane.org; Fri, 12 Oct 2018 13:24:51 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38212) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gB1B0-0007CD-PH for emacs-devel@gnu.org; Fri, 12 Oct 2018 13:24:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gB1Ax-0005xs-Lz for emacs-devel@gnu.org; Fri, 12 Oct 2018 13:24:38 -0400 Original-Received: from [195.159.176.226] (port=41153 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gB1Ax-0005nV-E6 for emacs-devel@gnu.org; Fri, 12 Oct 2018 13:24:35 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1gB18n-0007rd-EM for emacs-devel@gnu.org; Fri, 12 Oct 2018 19:22:21 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 46 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:+dv3WKRA1iHFCeSJo8iSMrAKgAI= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:230353 Archived-At: Eli Zaretskii writes: >> From: Eric Abrahamsen >> 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