From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Emacs script options Date: Sat, 18 Nov 2023 09:36:36 +0200 Message-ID: <83cyw7o6m3.fsf@gnu.org> References: <1325582.1700277236@archlinux> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5886"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Greg Minshall Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Nov 18 08:37:36 2023 Return-path: Envelope-to: ged-emacs-devel@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 1r4FtY-0001JE-2A for ged-emacs-devel@m.gmane-mx.org; Sat, 18 Nov 2023 08:37:36 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r4Fsg-0001eh-St; Sat, 18 Nov 2023 02:36:42 -0500 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 1r4Fsf-0001dL-1a for emacs-devel@gnu.org; Sat, 18 Nov 2023 02:36:41 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r4Fsd-0007R9-VF; Sat, 18 Nov 2023 02:36:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=lZEoJOl8wnsOt4MNptW8iucf03UuYXQUYoH1+yrT7g0=; b=dXJ7ju6wQVJo Ndf9vdW0WsnTXIVXlhpOs49hVkJKze5ijkayom0tF4tXznS9OVw1ipK9V/9zVrm7Wigu8T/78xcFT cOWq9P5zh0AwgHkzU3oXRn8bN2QQ7QnH9QFgUvNkrWD81uhbtpP5+UXBuYpaUhfWXy1D0PRWD3b38 Z70chTWdYGetPj5hhJRv6wVqoB7ZWKiwMxm+Eqo7yIpvQAu04X+iqSSpXqf0pR5hUW2wLxVSAtb0r W4JsB5NL2W7c60qVETngINU9SUeyDsyO1UuWQmzuL7W1GgejtAKeBqZoApj5LF8Fl+kLOrXm/RsSY +liDYNqsGfxbe4jS3gwsFw==; In-Reply-To: <1325582.1700277236@archlinux> (message from Greg Minshall on Fri, 17 Nov 2023 19:13:56 -0800) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:312895 Archived-At: > From: Greg Minshall > Date: Fri, 17 Nov 2023 19:13:56 -0800 > > hi. i would like to be able to write Emacs scripts ("#!...") that allow > a user to enter almost any option to the script itself, *without* having > to use double dashes ("--") to avoid colliding with Emacs option > processing. > > looking at "--script" and "-x", this doesn't seem possible. > > as a test case, given a simple script foo.sh (*), using "-x", and > invoking it with an option "--eval" gives this error: > > ---- > % ./foo.sh --eval > emacs: Option '--eval' requires an argument > ---- > > (that bare "--eval" *should* be an error if it were meant for Emacs > itself; however, it is meant for the Emacs script, which may have other > ideas of the syntax/semantics of "--eval".) But if we change that, how can we pass additional options to Emacs when invoking it from a script? That is also an important capability, and replacing it with what you want seems to be an incompatible change, which takes away a capability we have now. If we want to be able to pass options to the script itself, we need to do it in a compatible way, that doesn't lose what we have now. In any case, could you please show a real-life case where this is needed? The -x option was intended to support the use cases where the rest of the script is Emacs Lisp code, so what would such a script do with an option that is not interpreted by Emacs, and why is that needed? Thanks.