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: Adding with-editor to Emacs? Date: Sun, 03 Sep 2023 08:00:25 +0300 Message-ID: <83pm2z97h2.fsf@gnu.org> References: <85msy98sni.fsf@elpa.gnu.org> <87r0nidkmt.fsf@bernoul.li> <83bkelc1p1.fsf@gnu.org> <87fs3xwzxm.fsf@bernoul.li> <837cp9bur7.fsf@gnu.org> <87a5u5wskw.fsf@bernoul.li> <8334zxayhx.fsf@gnu.org> <871qfgbg13.fsf@bernoul.li> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34303"; mail-complaints-to="usenet@ciao.gmane.io" Cc: jonas@bernoul.li, emacs-devel@gnu.org, rms@gnu.org To: Stefan Kangas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Sep 03 07:02:11 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 1qcfFS-0008iT-VZ for ged-emacs-devel@m.gmane-mx.org; Sun, 03 Sep 2023 07:02:11 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qcfEU-0001WU-FJ; Sun, 03 Sep 2023 01:01:12 -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 1qcfEK-0001UI-9n for emacs-devel@gnu.org; Sun, 03 Sep 2023 01:01:02 -0400 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 1qcfEF-00017l-R4; Sun, 03 Sep 2023 01:00:57 -0400 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=364/wRUg3bclhb3lczW2Z++0i9RihZk0DjZKugedKDM=; b=K772Czh5mB90 5zbrO6wI76zx5OYxApO2V12XFV52lUTyHGK2vM2kvA9yegUQHJD3GCdH0HwohBUQMEvKsI4V7RTkE 80DKAXOQ7FceQj9FchagTcl6rSjb1QrauhQhCI7M7El9MY3WY/3yQLpOsFNm98Tcp3Q092BGPxYoQ vW4PeBYZDgMTXSKuW+MnM0zGvb86My0c1eaPduuK9UrKAMyNOfCEX9Ws+StAvD7nwmOjvPcT0fZDM fCCbauZ2muzLvm6fLiKeE3bYJqWJ3uzBDIpv2dY7cJA3ifSxqYRr176cG2tVMVTAnK4YZqmlkYEsn VofY+Fhy6H1H8rtaQEt1Qg==; In-Reply-To: (message from Stefan Kangas on Sat, 2 Sep 2023 12:56:32 -0700) 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:309931 Archived-At: > From: Stefan Kangas > Date: Sat, 2 Sep 2023 12:56:32 -0700 > Cc: emacs-devel@gnu.org, rms@gnu.org > > Jonas Bernoulli writes: > > > Identifying the authors of the broken Emacs installations, contacting > > them and explaining the issue to them, and then waiting for months/years > > until the updates trickle down to users, was not an option. I need a > > solution now. And this was such an exhausting experience, I did not > > have the energy to *also* contact everyone who had messed up their Emacs > > package. And it is such a bad memory (it was the first time I got > > massively attacked for publishing free software), that I am also not > > volunteering to do that work now. > > Wow, what a ride. I admire your patience, is all I can say. > > >> Do you mean that emacsclient is installed in a place that just typing > >> "emacsclient RET" at the shell prompt fails to run it? If so, that's > >> a broken installation, and Emacs shouldn't really try to fix that. > > > > I think this is a very reasonable for Emacs. In other words, the best > > course of action is to just forget the suggestion that with-editor is > > added to Emacs. There is no real need and nobody volunteering to do the > > work anyway. > > It sounds like with-editor for the most part contains workarounds for > broken Emacs installations? Is there anything in use-package that does > not belong to that category, and that you therefore think *should* > really be fixed in Emacs? I was thinking about a function that would attempt to produce the best guess for how to invoke the version of emacsclient which corresponds to the running Emacs binary. It is probably only important for features like Magit, which invoke programs known to need $EDITOR. That is quite a special case, which I think explains why no one requested this before. Still, it could be a useful addition. To support the "usual" cases, Emacs running installed and uninstalled, is easy enough. Supporting program-name transformations specified by the --program-prefix/suffix and --program-transform-name configure-time option is a bit trickier, but still reasonably straightforward, at least for some values of transformations. The final fallback should be just "emacsclient", to be found by the system's program loader using its rules (which could include more than just searching PATH). However, to cover all the cases that with-editor supports now, we need to understand them, because I'm not sure we want to support all of them, or if we do, do it in the same way as with-editor does. I couldn't find that explanation in with-editor.el, and the code there doesn't always explain itself, in particular where it alludes to macOS and Debian quirks.