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.bugs Subject: bug#71971: 31.0.50; Add user option server-window-alist Date: Sat, 06 Jul 2024 17:47:53 +0300 Message-ID: <86wmly37c6.fsf@gnu.org> References: <871q463hke.fsf@gmx.de> <86cynq4vfa.fsf@gnu.org> <87msmuvc5m.fsf@bernoul.li> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37948"; mail-complaints-to="usenet@ciao.gmane.io" Cc: michael.albinus@gmx.de, 71971@debbugs.gnu.org To: Jonas Bernoulli Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 06 16:49:35 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 1sQ6jG-0009en-I3 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 Jul 2024 16:49:34 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sQ6ij-0001wr-Nt; Sat, 06 Jul 2024 10:49:01 -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 1sQ6ih-0001w4-HY for bug-gnu-emacs@gnu.org; Sat, 06 Jul 2024 10:48:59 -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 1sQ6ih-000675-9T for bug-gnu-emacs@gnu.org; Sat, 06 Jul 2024 10:48:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sQ6ik-00033Y-U0 for bug-gnu-emacs@gnu.org; Sat, 06 Jul 2024 10:49:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 06 Jul 2024 14:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71971 X-GNU-PR-Package: emacs Original-Received: via spool by 71971-submit@debbugs.gnu.org id=B71971.172027728911668 (code B ref 71971); Sat, 06 Jul 2024 14:49:02 +0000 Original-Received: (at 71971) by debbugs.gnu.org; 6 Jul 2024 14:48:09 +0000 Original-Received: from localhost ([127.0.0.1]:46535 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sQ6ht-000327-5L for submit@debbugs.gnu.org; Sat, 06 Jul 2024 10:48:09 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:33514) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sQ6hr-00031a-3N for 71971@debbugs.gnu.org; Sat, 06 Jul 2024 10:48:07 -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 1sQ6hg-0004W3-Q4; Sat, 06 Jul 2024 10:47:56 -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=vtS19Caq5opWfsefWKswREqWQE90eH1nw0Qzbyq2V84=; b=RCDs64BknwRP dQzz+PUQmXZYJt+GnkjTifb8IqcjAKwlUXqfvMzEAooLR0CgNYhoIbPFN8JlyjPqv2HhJKq1PQ1lz J5Ug0R9F0DB2M7JrzqYr5+AWGlkaeReSFNoLdYF/m6sPNrKOJFAMArCHnkVM1nmDNKU/nq3QzMbPJ NSACjHA8J0NpmRXhgkWibKr3HxjsKQFU0ox9HK0un3a+6zhFpkTRn9R2fmHa6YKJ7J9s2mtNNQMyM MGqfB5RxRVDNBVpsTLmyP8clNrmY2dloI8t2lmIRYg3Bf8yIg0CnFRvYiphd24he6lLCNX2NfFY/p GLKfIeMHQfkJ7t/JjKQkJw==; In-Reply-To: <87msmuvc5m.fsf@bernoul.li> (message from Jonas Bernoulli on Sat, 06 Jul 2024 16:16:21 +0200) 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:288500 Archived-At: > From: Jonas Bernoulli > Cc: 71971@debbugs.gnu.org > Date: Sat, 06 Jul 2024 16:16:21 +0200 > > So in summary, it is possible for the same person to want the behavior > to be different in different situations. The fact that "committing from > Emacs using Magit" involves the use of emacsclient, just like "quickly > edit a file from the terminal" does, is an implementation detail, and > should not make it necessary for the user to decide which use-case > should be optimized to their liking, at the cost of undesirable behavior > in the other case. That sounds to me like the value of $EDITOR should be "emacsclient -c" whereas the value of $GIT_EDITOR should be just "emacsclient"? IOW, what you describe involves workflows some of which want a new client frame and some want to reuse the same frame. But the server-window variable and the proposed server-window-alist are about having certain _buffers_ display in certain _windows_. It is not even possible to express the "give me a new frame" preference, because the only frame you can mention in the value is an existing frame, and I very much doubt that "normal" users will know how to express even a specific frame there, with the sole exception of the selected one. So, AFAICT, to support the two varieties you described, users will almost always need to write a function and put it into the alist elements' SERVER-WINDOW slots, is that right? And what will they use for the REGEXP part? are they supposed to know by heart the names of temporary files Git and other VCSes use for editing commit messages? My conclusion is that if we want to support the above workflows, we need a more user-friendly feature, using which users will be able to easily control the server's frame-creation behavior depending on some predictably-deterministic attribute of the connection or the client. One possibility would be to add a new protocol command telling server.el how to create/reuse frames, and then tell users to set $EDITOR and similar variables to invoke that command via the emacsclient command-line arguments. Other ideas are welcome.