From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 20 10:54:51 2020 Received: (at submit) by debbugs.gnu.org; 20 Apr 2020 14:54:52 +0000 Received: from localhost ([127.0.0.1]:48240 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jQXov-0003QE-Tm for submit@debbugs.gnu.org; Mon, 20 Apr 2020 10:54:51 -0400 Received: from lists.gnu.org ([209.51.188.17]:57307) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jQVRq-0007l8-IA for submit@debbugs.gnu.org; Mon, 20 Apr 2020 08:22:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46712 helo=eggs1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQVRq-0004rq-4l for bug-gnu-emacs@gnu.org; Mon, 20 Apr 2020 08:22:50 -0400 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from Debian-exim by eggs1p.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jQVRn-0002gl-OJ for bug-gnu-emacs@gnu.org; Mon, 20 Apr 2020 08:22:49 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:34757) by eggs1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jQVRn-0002gE-Ck for bug-gnu-emacs@gnu.org; Mon, 20 Apr 2020 08:22:47 -0400 Received: by mail-wm1-x32a.google.com with SMTP id v4so4492025wme.1 for ; Mon, 20 Apr 2020 05:22:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=MLmH8t/NAqt8HBu/Yocsdn5Pnr7lzh3wMth8+y8SY5Y=; b=kWsfhwf8OmKER1ued8JEewxX5hvv3xXig/DphVvXM/sdX9SrT1k2Km8YtcnGcr48Gc S8MY+YcHvygfYcZP8RH97kSUdLoPHQpe+3zBv4F2OfaPCGfcm4zZjDFHG+mr/YiD7gUV 2E6qWKlzU+heLn5oZOQeHiiR5uyh6pbyhDcYyA2nT3iYd74xzMLU8zvjVxrgtTZE67sY 8Gh7bZQ3WuhwDCF+cf/mWn4LK+kOLTcE7rBNOW5aIY2FXCjKOPi1NzxY8EoX5vcdxkRu NQoSIPcrQVmQrndKSkEbjhl7zOqzCydlCA4z2S89083nYWrmYbkaPiJI5+IM8AWaVHMK A7OQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=MLmH8t/NAqt8HBu/Yocsdn5Pnr7lzh3wMth8+y8SY5Y=; b=oSPUmt230zKUXHmeqovOJUSFGJdlrLb5OHjwbZ0RaibcOVmeg+JjBhgvDmqpvVZG8E ZKoMO4N3/lWz5/pAe1yzvR2G9APBeGPcqv9X6o2MHO8m9reQLQrXJy4delsude4mzHXI J1NF/5ghqNGkO7yjpVdnnKxJijYSNOo3LxBZjMBVybB/JgiQ/qtisbpcclUwwXX72qsU 8qaAXYPCZtmVUVulabxeU1UTt4N0OLaYCzjnZnK83xeVT8EocsQWKp8wnQLnHJZFaeGS OWumuiRTntqmxD+8xluVTCSSaHR4lNC2MwxN8ceW6y6EiqAGOeX+N/8pouQxc6O3vg/Y eHAQ== X-Gm-Message-State: AGi0PuackeJzWwmwzY5bmk8z84f6tVnW9+PdJcX1fg3EucRubwVENAeZ dOQzW20wvfBnKWDaVjPQymZrbNI9 X-Google-Smtp-Source: APiQypLuIWiI44pEPt4nesPIc4WqhEFXDE4e0aPSNJmIY/daS7/3tEAqtQc/wG0ycxO6Si5kvlegMg== X-Received: by 2002:a1c:dfc6:: with SMTP id w189mr18074386wmg.180.1587385365590; Mon, 20 Apr 2020 05:22:45 -0700 (PDT) Received: from Ilyas-MacBook-Pro.local ([195.114.148.12]) by smtp.gmail.com with ESMTPSA id b66sm1185227wmh.12.2020.04.20.05.22.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2020 05:22:44 -0700 (PDT) From: Ilya Ostapyshyn To: bug-gnu-emacs@gnu.org Subject: [PATCH] Make emacsclient fail if --eval is used and no Emacs server connection established Date: Mon, 20 Apr 2020 15:22:43 +0300 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=ilya.ostapyshyn@gmail.com; helo=mail-wm1-x32a.google.com X-detected-operating-system: by eggs1p.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2a00:1450:4864:20::32a X-Spam-Score: 2.3 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hello, This patch makes emacsclient quit with an error message if both --eval and --alternate-editor were specified. According to the current implementation, the emacsclient runs alternate-editor, treating the eval expression as the filename, which is IMO not very intuitive. Content analysis details: (2.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (ilya.ostapyshyn[at]gmail.com) -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [209.51.188.17 listed in list.dnswl.org] 2.0 SPOOFED_FREEMAIL No description available. X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 20 Apr 2020 10:54:48 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --=-=-= Content-Type: text/plain Hello, This patch makes emacsclient quit with an error message if both --eval and --alternate-editor were specified. According to the current implementation, the emacsclient runs alternate-editor, treating the eval expression as the filename, which is IMO not very intuitive. Kind regards, Illia. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-exit-if-no-connection-and-eval-used.patch Content-Description: PATCH >From dcc18914c7109c06d570790d24b44f99ceb2a5d7 Mon Sep 17 00:00:00 2001 From: Ilya Ostapyshyn Date: Mon, 20 Apr 2020 15:06:07 +0300 Subject: [PATCH] exit if no connection and --eval used --- lib-src/emacsclient.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 380be95222..d74750ea5d 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c @@ -691,14 +691,21 @@ print_help_and_exit (void) exit (EXIT_SUCCESS); } -/* Try to run a different command, or --if no alternate editor is +/* If args were to be evaluated exit immediately with an error code. + Try to run a different command, or --if no alternate editor is defined-- exit with an error code. Uses argv, but gets it from the global variable main_argv. */ static _Noreturn void fail (void) { - if (alternate_editor) + if (eval) + { + /* No way to evaluate Lisp expressions if there is + no connection to an Emacs server. */ + message (true, "%s: unable evaluate ELisp expressions.\n", progname); + } + else if (alternate_editor) { size_t extra_args_size = (main_argc - optind + 1) * sizeof (char *); size_t new_argv_size = extra_args_size; -- 2.26.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 22 05:51:46 2020 Received: (at 40731) by debbugs.gnu.org; 22 Apr 2020 09:51:46 +0000 Received: from localhost ([127.0.0.1]:51346 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jRC2g-0007Id-RQ for submit@debbugs.gnu.org; Wed, 22 Apr 2020 05:51:46 -0400 Received: from mail-wm1-f43.google.com ([209.85.128.43]:51180) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jR9jc-0003Vo-Bi for 40731@debbugs.gnu.org; Wed, 22 Apr 2020 03:23:52 -0400 Received: by mail-wm1-f43.google.com with SMTP id x25so1066544wmc.0 for <40731@debbugs.gnu.org>; Wed, 22 Apr 2020 00:23:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=p+P3e+MAKaDoh+pN2S5urJB3xeNJEY09fXxG0XXjOY4=; b=t4IMSJbk1YzroKS11Y7vWOXOo/0iJnUwEQDOR9dK4MJWAkoHPfue1D/f7wGcdfbouM 7m6fXFFeDfPbt8uZvQ5Nx1BHNGys4TY8GkmYGGWvfODBOc849eMohNs/vQa4oLTBnkjE Z++gA2q+EcNsQsesv/eIdCqI/6kGlVdPjRO3EY0p60Spk0DQu1JUdofFfSrRqIL+b9Jv 9EqJnkBT+gr50rAv2Xdf2dd+Y/CsAql0ARn/Z1/Sn8mwPRUNfQwBEz6M6NnyacVumaoC aXlMtJZ/dbWGYbxet+o6Dw/suxzylhd96SwSOjSml7JNoluDSqotc4sf+N6Wa2pkRlDn 4wfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=p+P3e+MAKaDoh+pN2S5urJB3xeNJEY09fXxG0XXjOY4=; b=Xa/uFd3PYpCdgMgdAcQ8IEuZzzM0nSAQP0R+0K/BB06+z82b1ockTUnTudyWX88q6Q +5kGFvrvcUr6j0Gc7kAL5omn2xUTLKcJeutTfx1tohywy3SDJw2jTCPw9B2dpQBqqwbO Av/+0rMKf0rHlJDRAYY3N4drfssERPmpVvnq2kz2D0apUQ33Rt3H0iEjUkTqW/otDEtA Sls1ggoJ0h9rgqAXrfRLSVLp56VMrePNL+EqQI3b1B4F/LRmMNGBS+spqfwRagxfjN4o fsi0VNCXQYFGH0EtLHiSWORi6zxvgHFcRsc08XmBKLLHLT/ufzyP0JyZ3HRyQMQwD9/+ vLGg== X-Gm-Message-State: AGi0PubXg5AjoofW5gB1wxGhENYhzFb8Bjk8xaK3xv5gl/y3iRpIQdU7 Gs6Bba0F9D++WxCmVPV1A95Gge6A X-Google-Smtp-Source: APiQypK56bepFX+eGi3VIbbufK836xmiAFYzF+mo66NsSFhrVc3KVL4DTPoS0i2aTUMqBrvMMtscCg== X-Received: by 2002:a1c:98c3:: with SMTP id a186mr8899693wme.178.1587540226089; Wed, 22 Apr 2020 00:23:46 -0700 (PDT) Received: from ilya-mbp.lan ([195.114.148.12]) by smtp.gmail.com with ESMTPSA id n131sm6848582wmf.35.2020.04.22.00.23.44 for <40731@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Apr 2020 00:23:45 -0700 (PDT) From: Ilya Ostapyshyn To: 40731@debbugs.gnu.org Subject: bug#40731 Followup Date: Wed, 22 Apr 2020 10:23:43 +0300 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 40731 X-Mailman-Approved-At: Wed, 22 Apr 2020 05:51:41 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) I have found a commit ~6fe661342a24edcaea255c3ba9a37613031554da~ which addressed the same issue but in a different way. However, the commit was reverted (hash ~f198a5c5144fdded1400df6e8454e4b1b912c7de~) with the following message: > The alternate editor may be Emacs, which is useful when you want to > eval something in an existing Emacs (if it exists), or in a new Emacs > if there's no server running. I beg to differ. In fact, the --eval is not an optarg parameter, instead it tells emacsclient to treat the whole FILE argument as lisp expressions for evaluation. Therefore, invoking emacsclient -a emacs -e '(emacs-version)' just opens a file named "(emacs-version)" in a new instance of Emacs if server is not running. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 08 08:39:45 2020 Received: (at 40731) by debbugs.gnu.org; 8 Aug 2020 12:39:45 +0000 Received: from localhost ([127.0.0.1]:58451 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k4O8X-0002I7-7C for submit@debbugs.gnu.org; Sat, 08 Aug 2020 08:39:45 -0400 Received: from quimby.gnus.org ([95.216.78.240]:51224) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k4O8W-0002Ho-2y for 40731@debbugs.gnu.org; Sat, 08 Aug 2020 08:39:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=S3y+OutGS8pxT9K/nkrMRbqFXCiy6eFx9IDjUTp1fBk=; b=J3LglpYuQ0rstR9MHm6bGi/cnN N5Iv4kkFyqBZKFLwPzMXZBtTrdJDAGjMjcSpRj5B3esrG54Ll+F/E6x4TD7OrEuIZ0vnOt8BEWHbv KpO9zSuGfeR3hDuFD6xZpxtmCda+kW53dBhcsn3qm9EZ767La5M8F+0JnJYvUetouTA8=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k4O8M-0004NQ-Fs; Sat, 08 Aug 2020 14:39:37 +0200 From: Lars Ingebrigtsen To: Ilya Ostapyshyn Subject: Re: bug#40731: Followup References: Date: Sat, 08 Aug 2020 14:39:33 +0200 In-Reply-To: (Ilya Ostapyshyn's message of "Wed, 22 Apr 2020 10:23:43 +0300") Message-ID: <87v9ht1fcq.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Ilya Ostapyshyn writes: > I have found a commit ~6fe661342a24edcaea255c3ba9a37613031554da~ which > addressed the same issue but in a different way. > > However, the commit was reverted > (hash ~f198a5c5144fdded1400df6e8454e4 [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 40731 Cc: 40731@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Ilya Ostapyshyn writes: > I have found a commit ~6fe661342a24edcaea255c3ba9a37613031554da~ which > addressed the same issue but in a different way. > > However, the commit was reverted > (hash ~f198a5c5144fdded1400df6e8454e4b1b912c7de~) with the following message: > >> The alternate editor may be Emacs, which is useful when you want to >> eval something in an existing Emacs (if it exists), or in a new Emacs >> if there's no server running. > > I beg to differ. In fact, the --eval is not an optarg parameter, instead > it tells emacsclient to treat the whole FILE argument as lisp > expressions for evaluation. > > Therefore, invoking > emacsclient -a emacs -e '(emacs-version)' > just opens a file named "(emacs-version)" in a new instance of Emacs if > server is not running. Hm. Unfortunately the reverting commit doesn't refer to the test case that somebody had for this, but there was a complaint after the change that the change ruined their work flow. There was a test case for this, but it wasn't included in the reversion commit, and I don't recall what it was now... emacsclient -a "emacs -e" -e '(emacs-version)' or something? In any case, we can't regress this work flow, so we can't fix this somewhat illogical way emacsclient works, so I'm closing this bug report. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 08 08:39:52 2020 Received: (at control) by debbugs.gnu.org; 8 Aug 2020 12:39:52 +0000 Received: from localhost ([127.0.0.1]:58454 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k4O8d-0002IX-ER for submit@debbugs.gnu.org; Sat, 08 Aug 2020 08:39:51 -0400 Received: from quimby.gnus.org ([95.216.78.240]:51238) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k4O8b-0002I0-La for control@debbugs.gnu.org; Sat, 08 Aug 2020 08:39:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=hqLp/rUyNmXMsVOi2sQbnQnKV9qfhz2sjfCClDJ4N20=; b=upCKbzAPj5ZH0gWvRwe36ao2oY ruA/cxxR7R9sjjZRbbLF3RTaUiyoTDPfBgMn6O/1maYZszc7Yz9Vzfv5NGhlHqD7iFaTtBErUuTmI p/DFayLg8asFfekLhJH8m1wV9QZ1208aSlL8hoNQJsRgs2J3T4lHwagcnk0od9ge6dyA=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k4O8T-0004NX-V9 for control@debbugs.gnu.org; Sat, 08 Aug 2020 14:39:44 +0200 Date: Sat, 08 Aug 2020 14:39:40 +0200 Message-Id: <87tuxd1fcj.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #40731 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 40731 wontfix close 40731 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 40731 wontfix close 40731 quit From unknown Thu Aug 14 21:49:06 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 06 Sep 2020 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator