From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Generalize start-process with keyword args Date: Fri, 20 Mar 2015 10:03:29 -0400 Message-ID: References: <87d24d3uwz.fsf-ueno@gnu.org> <86a8zc21ua.fsf@gmail.com> <83oanszq6u.fsf@gnu.org> <8661a01stb.fsf@gmail.com> <83egooyu08.fsf@gnu.org> <86oanrwdhb.fsf@gmail.com> <83lhivxr42.fsf@gnu.org> <86k2yfwaad.fsf@gmail.com> <83egolvtdj.fsf@gnu.org> <861tkk8tel.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1426860247 17620 80.91.229.3 (20 Mar 2015 14:04:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 Mar 2015 14:04:07 +0000 (UTC) Cc: emacs-devel@gnu.org To: Andy Moreton Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Mar 20 15:03:59 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YYxWk-0005fF-1n for ged-emacs-devel@m.gmane.org; Fri, 20 Mar 2015 15:03:54 +0100 Original-Received: from localhost ([::1]:43961 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYxWe-0004c0-HH for ged-emacs-devel@m.gmane.org; Fri, 20 Mar 2015 10:03:48 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60162) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYxWX-0004bS-3a for emacs-devel@gnu.org; Fri, 20 Mar 2015 10:03:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YYxWQ-0001s8-J3 for emacs-devel@gnu.org; Fri, 20 Mar 2015 10:03:41 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:50355) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYxWQ-0001rb-EY for emacs-devel@gnu.org; Fri, 20 Mar 2015 10:03:34 -0400 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id t2KE3U3J020355; Fri, 20 Mar 2015 10:03:30 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id E1FF7F63; Fri, 20 Mar 2015 10:03:29 -0400 (EDT) In-Reply-To: <861tkk8tel.fsf@gmail.com> (Andy Moreton's message of "Thu, 19 Mar 2015 23:22:10 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5251=0 X-NAI-Spam-Version: 2.3.0.9393 : core <5251> : inlines <2452> : streams <1408621> : uri <1885559> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.20 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:184035 Archived-At: >>> I agree that this is awkward. What I envisaged was an (optional) alist >>> of (REGEXP . (INTERPRETER INTERPRETER-ARGS)) pairs such that if >>> start-process is onvoked for a PROGRAM that matches REGEXP, then use >>> INTERPRETER as the PROGRAM argument to start-process, and prepend >>> INTERPRETER-ARGS to the PROGRAM-ARGS list. >> But that means this alist will have to be updated for each new script >> you want to handle, no? How useful is that? > This issue is clearly a minority concern, so feel free to disregard it. BTW, in the absence of this alist in Emacs, you can code it up yourself with a quick advice like (guaranteed 100% untested): (defun handle-scripts-in-start-process (args) (if (string-match REGEXP (nth 2 args)) `(,(nth 0 args) (nth 1 args) "bash" "-c" ,@(nthcdr 2 args)) args)) (avice-add 'start-process :filter-args #'handle-scripts-in-start-process) -- Stefan