From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.bugs Subject: bug#70847: 29.3; eshell scripts "from anywhere" Date: Tue, 28 May 2024 17:31:02 -0700 Message-ID: References: <87h6f6c1hk.fsf@librehacker.com> <87a5k9v9fv.fsf@librehacker.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23508"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 70847@debbugs.gnu.org To: Christopher Howard Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 29 02:33:07 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sC7Fb-0005yv-10 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 29 May 2024 02:33:07 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sC7FN-0001fU-6y; Tue, 28 May 2024 20:32:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sC7FM-0001fG-Fq for bug-gnu-emacs@gnu.org; Tue, 28 May 2024 20:32:52 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sC7FM-0002I0-4I for bug-gnu-emacs@gnu.org; Tue, 28 May 2024 20:32:52 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sC7FV-00049g-LV for bug-gnu-emacs@gnu.org; Tue, 28 May 2024 20:33:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 29 May 2024 00:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70847 X-GNU-PR-Package: emacs Original-Received: via spool by 70847-submit@debbugs.gnu.org id=B70847.171694274115898 (code B ref 70847); Wed, 29 May 2024 00:33:01 +0000 Original-Received: (at 70847) by debbugs.gnu.org; 29 May 2024 00:32:21 +0000 Original-Received: from localhost ([127.0.0.1]:36737 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sC7Eq-00048M-SE for submit@debbugs.gnu.org; Tue, 28 May 2024 20:32:21 -0400 Original-Received: from mail-pl1-f182.google.com ([209.85.214.182]:43022) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sC7Eo-000483-Eg for 70847@debbugs.gnu.org; Tue, 28 May 2024 20:32:19 -0400 Original-Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-1f48e9414e9so3466485ad.0 for <70847@debbugs.gnu.org>; Tue, 28 May 2024 17:32:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716942663; x=1717547463; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=S1qOE2HaU1AjT+zaJl0+DVWKef/k6JBr+tXS3LYPZcU=; b=jPc2NY8yH+2Y4gnipF84YsvBV0UfnIpSpSL4fukaJb0wBQYIAumBdOY4WxaJh8JrXc ynhzXzt5eOp9vj0iNAwuSe2ZA+A4Vfp+hCh/hR6P3sT88czRPd8EB30gW1bQ8FH5svyH qYcxFeJX7gDQVk9PpUNru2iI4XUTCTujhbhDJJJQu8Om3ZrIWEDAv8phPF1xBFn9akg9 BJ+01a0u7Qpv2jIgyccxWZqJi8fo+AjkjGQ6MIBf5UWcYR7qAt9x8rBlBnsYdXUhguAA WphgVSpH9dOO/QNwftmywtjInV0om0+KH/ZOupH5FhoZ6CQVLhMRKanPUXLhprGf/piL WyyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716942663; x=1717547463; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=S1qOE2HaU1AjT+zaJl0+DVWKef/k6JBr+tXS3LYPZcU=; b=SNvTwIhVi9xi8BmvJUg5Vjh1DTPR7EXSLnOc0Z9ex/RF+NGFOiuTrx+rCL094WhyHc K1VTyhAwHJFVmwWyFd/fEkMVVt/pMGyWJWOG6/evDJep5J522yx88SsdwNcN7BQGlYh0 nSQr+t8nSpGhSMbtT+fuO6xfHiiXdIbW/JLEQqPVCqvt0T0f7Y4b5XU+40WmhHgRGgtm hdUGB7eIKmHCbwQSeXiuqtvBYLLl7z09/Qk/ePMx3IQ/NcVUCIYCCcmz24uVnUgqzezX ReGSSGMEPzsv0KRaoa873TZp9qAT27Uzk6ahqNy7A0THpde2wtjvDIgBT7DRNtfUD1BO tdeA== X-Gm-Message-State: AOJu0Yw3MX/79AtM8+TQYlhgWqZmKxbadcTYbRAsvRNmJzIbnqKEMBbs duHvuVFhc82E9gBkOfOdwvyBdA1URNqrnIFdFy9cLJ7VSe1mM6IN X-Google-Smtp-Source: AGHT+IFUfIhWAp1O+9fhYNZ0SAUfelkv14hqBgOxR/A1RcMg45tN9DUXBHCWNcLBNxDO0LP54cvVWA== X-Received: by 2002:a17:903:230d:b0:1eb:6cfe:7423 with SMTP id d9443c01a7336-1f4ea9ab5a2mr8951315ad.19.1716942662735; Tue, 28 May 2024 17:31:02 -0700 (PDT) Original-Received: from [192.168.1.2] (syn-023-240-098-037.res.spectrum.com. [23.240.98.37]) by smtp.googlemail.com with ESMTPSA id d9443c01a7336-1f44c75debfsm86845585ad.14.2024.05.28.17.31.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 28 May 2024 17:31:02 -0700 (PDT) Content-Language: en-US In-Reply-To: <87a5k9v9fv.fsf@librehacker.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:286134 Archived-At: On 5/28/2024 3:49 PM, Christopher Howard wrote: > (1) Regarding eshell-execute-file: > (a) command executes as expected when called as a normal function > (b) it would seem highly desireable for this to be an interactive function as well. Though of course you'd have to think through exactly how you wanted to handle ARGS and DESTINATION during an interactive call. Thanks for trying out the patches. I've gone back and forth on whether to make this function interactive. On the one hand, it could be convenient, but on the other hand, calling 'eshell-command' interactively should also work: if you type "source my-file.esh arg1 arg2..." at the 'eshell-command' prompt, that would do more-or-less the same thing as calling 'eshell-execute-file'. You could even add "> destination" to the end to redirect the output somewhere, e.g. to a buffer. > (2) I'm having trouble testing the eshell-batch-file functionality. I created a script like so: > > ``` > #!/home/christopher/local/bin/emacs --batch -f eshell-batch-file > echo bleep > ``` > > When I try to run this, the correct emacs gets launched (the patched one) but emacs also tries to load my local init.el file - the one written for my 29.3 install - which leads to a backtrace as certain things don't load correctly. My understanding was that --batch is supposed to prevent local init files from being loaded. > > I tried adding -Q to the shebang line but that doesn't seem to have an effect. You'll probably need to use "env -S" in the shebang to split the args. Shebangs treat everything after the first word as a single argument, so Emacs sees "--batch -f eshell-batch-file" all together. Something like this should work (I hope): #!/usr/bin/env -S /home/christopher/local/bin/emacs --batch -f eshell-batch-file