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#57752: 28.1.91; emacsclient-mail.desktop doesn't work for me Date: Sun, 18 Sep 2022 11:31:58 -0700 Message-ID: <78d5c54b-5b33-8571-7de5-b5bd2ddd95b7@gmail.com> References: <87r10gcum8.fsf@cassou.me> <87bkrj31r0.fsf@gnus.org> <87y1unxv15.fsf@cassou.me> <83leqn4cji.fsf@gnu.org> <87v8prxtox.fsf@cassou.me> <878rmjy78x.fsf@gnus.org> <9e796c00-92e2-37fd-a90e-6ef615296b9e@gmail.com> <87zgex56bw.fsf@gnus.org> 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="29450"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Damien Cassou , Eli Zaretskii , git@mavit.org.uk, 57752@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 18 20:33:42 2022 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 1oZz6r-0007VS-Hm for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 18 Sep 2022 20:33:41 +0200 Original-Received: from localhost ([::1]:46232 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oZz6q-0007ja-Gf for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 18 Sep 2022 14:33:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58534) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZz6E-0006eI-3i for bug-gnu-emacs@gnu.org; Sun, 18 Sep 2022 14:33:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52154) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oZz6D-0004k2-Qr for bug-gnu-emacs@gnu.org; Sun, 18 Sep 2022 14:33:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oZz6D-000448-LW for bug-gnu-emacs@gnu.org; Sun, 18 Sep 2022 14: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: Sun, 18 Sep 2022 18:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57752 X-GNU-PR-Package: emacs Original-Received: via spool by 57752-submit@debbugs.gnu.org id=B57752.166352592715561 (code B ref 57752); Sun, 18 Sep 2022 18:33:01 +0000 Original-Received: (at 57752) by debbugs.gnu.org; 18 Sep 2022 18:32:07 +0000 Original-Received: from localhost ([127.0.0.1]:51232 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZz5K-00042u-KL for submit@debbugs.gnu.org; Sun, 18 Sep 2022 14:32:06 -0400 Original-Received: from mail-pl1-f176.google.com ([209.85.214.176]:42905) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZz5I-00042P-BH for 57752@debbugs.gnu.org; Sun, 18 Sep 2022 14:32:04 -0400 Original-Received: by mail-pl1-f176.google.com with SMTP id v1so26029537plo.9 for <57752@debbugs.gnu.org>; Sun, 18 Sep 2022 11:32:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:content-language:in-reply-to:mime-version :date:message-id:from:references:cc:to:subject:from:to:cc:subject :date; bh=qN9mXkhn3Ttn5gf7yg5hBWbk7lPuViokykgZC10jv68=; b=nrbe8zb5GjRgfrFCZy/aWKZH3AWsEQ4Rg0VSUkciG/vuH05NnbukN/q3mSxO7Qjn3z fCF8EhSVgePp99mg6Lmxd8BQlcD5urrnsMzCjVtcFuLULbxJoqt/shqrPlcfTu/jZvAq rBRyeMxGQDUD+SzJgfu+MqDYHgv+yZeF9B3s8wR3v/Y8IL8bKZx8PStMNRYAd3Bf9Z2F int+xi3kp0EcoUeIenI0T3gZXkP/+a+KjDIkGjO+U7kCVCPVFpYJrrotzQDaR1eKau4o a74VCK7qKtN+M6KQCkjN7oSieP50fJFUzgE5bPquUwN5wm1RBpEzFlkOjEMJbwvdr38o 950g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:content-language:in-reply-to:mime-version :date:message-id:from:references:cc:to:subject:x-gm-message-state :from:to:cc:subject:date; bh=qN9mXkhn3Ttn5gf7yg5hBWbk7lPuViokykgZC10jv68=; b=PzVCzbHxmGMb5lUdph1u5VCFWUb6Q2FtRqdEcQhxdc1lxHoLQDERrQS42wdWOO3UQT VLGHUx/DIjR3/zqYphw/+khIim3WGPQICoKVeMQFd6TZ4eN4FezNg7qvaROOnwf6HO55 rgOGtP6vFJgePv7wOar1KCFy1qZU+soq625ek5JiWdtqc9NUU2Ng/NKBW944P0Idt2e7 8W01AWlQnwPMlvTZfZF5s7uo0/CXBh0ID9fTUOg+grLpMnyss8UlFnbPfUXGe/PVjt+y LFQgJVMI8RiR0ER1qdSc6yW4aWyjB8qGa1PZxwfwxre+qTQSMauG35aWgmdSHBT6pRIG BulA== X-Gm-Message-State: ACrzQf1LtVqxtjWQxcS9uK3ficm5jNJoNv5tVq1ab8DUWHD0wZVIjHzO upKBWndO+PaJ6USoj4CDcz9DvE6z86Q= X-Google-Smtp-Source: AMsMyM6CyGhlqQu6jZNw/ButnaSXt19ByIt40+Bbb8HqOA3DrI2dMFBUNr7DVncacU2XnPiyD6JMGA== X-Received: by 2002:a17:90b:1b06:b0:202:cce0:2148 with SMTP id nu6-20020a17090b1b0600b00202cce02148mr27151308pjb.84.1663525918607; Sun, 18 Sep 2022 11:31:58 -0700 (PDT) Original-Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id q67-20020a17090a1b4900b00200461cfa99sm4950397pjq.11.2022.09.18.11.31.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 18 Sep 2022 11:31:57 -0700 (PDT) In-Reply-To: <87zgex56bw.fsf@gnus.org> Content-Language: en-US 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" Xref: news.gmane.io gmane.emacs.bugs:243006 Archived-At: On 9/18/2022 3:23 AM, Lars Ingebrigtsen wrote: > Jim Porter writes: > >> 1) Instead of specifying the function args with a flag, I think I'd go >> the other way and specify the function as being special, e.g.: >> >> emacs --apply func arg1 arg2 > > Yes, that sounds good. (But we'd still need "--" to say that the > arguments have ended.) This is actually the trickiest part about this to me. If I were designing this, I'd say that '--apply' consumes every positional argument up to the next flag. If it encounters a '--' while consuming arguments, *every* remaining argument gets passed to the function. That allows the following: emacs --apply func1 arg1 arg2 --apply func2 arg3 arg4 -Q => emacs -Q (func1 "arg1" "arg2") (func2 "arg3" "arg4") emacs --apply func -- --arg1 --arg2 => emacs (func "--arg1" "--arg2") This way, users can pass arguments beginning with a "-" to the function being applied while still retaining a fair amount of flexibility in other cases. It would also be good for shell scripts/aliases where you don't know ahead of time what the arguments will look like. If you had this in your shell environment: EDITOR="emacs --apply fancy-find-file" then you might try to visit a file named "-Q". However, it would treat "-Q" as an argument to emacs instead. With what I suggested above, you'd just say: EDITOR="emacs --apply fancy-find-file --" That's a common way of doing this for other command-line tools, so I think most people should understand the behavior fairly easily. >> 2) Even better, why not just use --function and pass some higher-order >> function: >> >> emacs --function apply-from-command-line func arg1 arg2 > > I think that sounds more obscure, really (even if it's simpler to > implement in the "emacs" case). Either is fine with me. Originally, I thought that "--funcall apply-from-command-line ..."[1] might be nicer since you could replace 'apply-from-command-line' with a fancier function, e.g. one that parses numeric values, but I think you'd be able to do that with --apply anyway. It's probably better to keep the simple path simple and go with --apply. [1] I had meant to type --funcall instead of --function in my previous message, but got mixed up.