From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel Newsgroups: gmane.emacs.bugs Subject: bug#25671: Feature request: emacs -Q --script as a single binary Date: Thu, 9 Feb 2017 16:14:41 -0500 Message-ID: <4d463814-5439-da70-d3af-b9e603121f8a@live.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="xoFaqFl4h5E05QCHf5CUTihoQF2he58kw" X-Trace: blaine.gmane.org 1486674975 27321 195.159.176.226 (9 Feb 2017 21:16:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 9 Feb 2017 21:16:15 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 To: 25671@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 09 22:16:08 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1cbw4V-0006jd-BU for geb-bug-gnu-emacs@m.gmane.org; Thu, 09 Feb 2017 22:16:07 +0100 Original-Received: from localhost ([::1]:40261 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cbw4b-00043d-2F for geb-bug-gnu-emacs@m.gmane.org; Thu, 09 Feb 2017 16:16:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50547) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cbw4T-00043W-Ux for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2017 16:16:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cbw4P-0008TE-VF for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2017 16:16:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35300) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cbw4P-0008TA-Ru for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2017 16:16:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cbw4P-0005dC-MT for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2017 16:16:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 09 Feb 2017 21:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 25671 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.148667490621577 (code B ref -1); Thu, 09 Feb 2017 21:16:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 9 Feb 2017 21:15:06 +0000 Original-Received: from localhost ([127.0.0.1]:33499 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cbw3U-0005bw-QT for submit@debbugs.gnu.org; Thu, 09 Feb 2017 16:15:06 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:59292) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cbw3T-0005bB-DR for submit@debbugs.gnu.org; Thu, 09 Feb 2017 16:15:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cbw3N-0008D0-2R for submit@debbugs.gnu.org; Thu, 09 Feb 2017 16:14:58 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:40038) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cbw3M-0008Cv-V9 for submit@debbugs.gnu.org; Thu, 09 Feb 2017 16:14:56 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50248) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cbw3L-0003wO-L0 for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2017 16:14:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cbw3H-0008Az-Ks for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2017 16:14:55 -0500 Original-Received: from mout.kundenserver.de ([212.227.17.13]:56278) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cbw3H-0008AV-7Q for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2017 16:14:51 -0500 Original-Received: from [18.111.113.197] ([18.111.113.197]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.184]) with ESMTPSA (Nemesis) id 0MAMbS-1cj6nK24sM-00BYs9 for ; Thu, 09 Feb 2017 22:14:48 +0100 X-Provags-ID: V03:K0:S22Dg0zlvvDls6sboPue9OPjgv0jBi4YmSI0foTLLphldlId7ub daaYpjrvGFCuidRmzZThi+Bw4suu5bwNtHH1SQMbe5BB3VzFBK5Ljo2UuKZ3sXs6z/YKjjH oQ7McJpai3FvI4hjoPNVTkVTryd/F09Uyq9euzkMztY0+IGu6jw2YbczaoFdVB0nOrFDiHb 1j+jWfHyIbd/TQn8H33Dg== X-UI-Out-Filterresults: notjunk:1;V01:K0:ZSXVyfIJOtk=:nd09tDNx+t+fMhpn+mPixp lcoaHzYw43fIfOCxjdo+ztKN1lyb7AN+ktl+LVm9ebxcWuAip+WjbYkGlCWzlpJJ3BvISDDqv 4vKpIyXch22adCbpdHKQ7qKK8DSSRAEtJQFQy0IM8OWXL24IG+BuvjU09XP7IsZIMCuoDddWt z03xH79lZKy7s2X2qN0oX3EoLwciJaaSQlHU6u8rWk7MipX87c7g7in5SdF9eZcAYgKZ8MBx5 UWIbdnlt6Ni0+CpbmkTw80Wsu85iP2A3wF9lhIsrmPAOOtiVcCs1C78suCaTE1/Y9fMZfCdjK R1zHbr1kOIwePcDRqhwa5sRai0O7HII20+NvztvcM3riRE4naPQ9eAeVjYQPPPK8S2GKe/OuG 0YNhPIscGd7nbzaBVPRjw3Cyju1EETQyPgPp7nUKU2IEGH4Kg1EkADKehmg6Avtu7I4X+T3ep wN4yd31UgxocxCyZxEPPmhsPTWYH+v8Z0H0MO9cXBoIiNP9Wkj66tPvhvpJmvVSKyO6xtycCz pUrtoLSXmes9hGdDLXwYtgNAQqCiRJFfXGfbisswHzkjpQW82cpKODE18SO5ySKuRHuSjK8vX Q0QJc4BeqH84amnHL213/L0mkDTOx9971iYPW/uL5tQkQpEUMak0ZL5WLVVFY/uiMucs1rilz cMA/ljYZoa5JgNVGorLOtNvYvRGmmpj/DW5fVlNYV2uhOPYm/xhCn4cOMcMH8YOFqxJE= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:129162 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --xoFaqFl4h5E05QCHf5CUTihoQF2he58kw Content-Type: multipart/mixed; boundary="FIhkWLj5CuruqwwJR1D0QOThNd4ecXoO5"; protected-headers="v1" From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= To: bug-gnu-emacs@gnu.org Message-ID: <4d463814-5439-da70-d3af-b9e603121f8a@live.com> Subject: Feature request: emacs -Q --script as a single binary --FIhkWLj5CuruqwwJR1D0QOThNd4ecXoO5 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi bug-gnu-emacs, Since version 22 Emacs lets scripts begin with a shebang line: #!/usr/bin/emacs --script ;; Some ELisp code here This breaks if Emacs isn't installed in /usr/bin, though. Thus, one woul= d want to write this: #!/usr/bin/env emacs --script ;; Some ELisp code here But this doesn't work (env doesn't split its arguments), and it also brea= ks even if one is happy with hardcoding /usr/bin/emacs but tries to pass = more than one argument (think -Q and --script). Thus one writes this: #!/bin/sh ":"; exec emacs -Q --script "$0" "$@" # -*- mode: emacs-lisp; lexical-b= inding: t; -*- (See http://stackoverflow.com/questions/6238331/emacs-shell-scripts-how-t= o-put-initial-options-into-the-script/6259330#6259330) This isn't pretty. Could we set up emacs to assume --script and possibly= -Q when started as "elisp", or "emacs-script", or some other name (that = is, could we make it so that invoking emacs with argv[0] =3D ".../elisp" = starts emacs -Q --script)? (And ideally Emacs would ignore all options af= ter the script's name, to let the script itself process them). Thanks! Cl=C3=A9ment. --FIhkWLj5CuruqwwJR1D0QOThNd4ecXoO5-- --xoFaqFl4h5E05QCHf5CUTihoQF2he58kw Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYnNvCAAoJEPqg+cTm90wjQdQP/3Bw+votsYytaeuI7kJTJeDf 4SPwJVBLPW4DssoC7tW6c1fxFgN72kfyJ6fL4eAebwEotmeWwJiT25INHjIMdoV+ /+YM20Umtadu6ekHAOxNk5dMs4ANqfNGWC+x3N5a48hoLkHTi5qbBfp5BnImvrGb vI1rMkUzCiQ+YwEh4cH9gaST38K2qJJwxz4HGut364d3+stvA4CpOmeOwp1BN3y9 u/AzJV++FC28m7H36jSB+b9I+8wk6G/+5Fna8Ux80Jj9dM1YT7lgjla0D92AbyEq LC7gfmmugtO3+zCkqHA6iIxo32rxBU4sEandiBrDB8nvbRb6Z3ZrLJGeslOevQMj 1RVRiNoozaQT3NW2gdftuPgnrvzvdCWh65pIVN2iIaE7uSvGtcM7TY7jNZEe4fYu 9X/ohyQBFvv1RoilZ5N45e+c83eM9JvmnI77/n3jdkkceWcMzT3iZkDu9t585FfB P3CNat71S/SPedi9uhRh/lsPueCUKe8d8xwCo3sZcmfctq2tDwxfe9H39YBzjcr7 U/ZZED8XEw+G0252bxftu/v6gJJeO+C1IGZ+OV5cbJZe0MKxaCObBQYKKr7sR+Cg Lhuvgd6FQiPY7gplDAU5Me7h3hbOmjZSRiyVtBu4ecSJP9l9hgxKIhTYkp3lEPuJ cI+mnpjpJknfmzSd20xK =R9/1 -----END PGP SIGNATURE----- --xoFaqFl4h5E05QCHf5CUTihoQF2he58kw--