From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#42210: Add -other-window variants of project-prefix-map commands Date: Tue, 07 Jul 2020 01:59:25 +0300 Organization: LINKOV.NET Message-ID: <87mu4cs0ly.fsf@linkov.net> References: <87blkw5cd3.fsf@iris.silentflame.com> <87tuymh4k9.fsf@iris.silentflame.com> <87k0zhv6kb.fsf@linkov.net> <87wo3hflqe.fsf@iris.silentflame.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2699"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: 42210@debbugs.gnu.org, dgutov@yandex.ru To: Sean Whitton Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 07 01:17:10 2020 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 1jsaMI-0000cH-6P for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 07 Jul 2020 01:17:10 +0200 Original-Received: from localhost ([::1]:45208 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jsaMH-00061Z-9W for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 Jul 2020 19:17:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59142) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jsaMA-0005xa-Iy for bug-gnu-emacs@gnu.org; Mon, 06 Jul 2020 19:17:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51788) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jsaMA-0004Wy-AH for bug-gnu-emacs@gnu.org; Mon, 06 Jul 2020 19:17:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jsaMA-0004qs-3c for bug-gnu-emacs@gnu.org; Mon, 06 Jul 2020 19:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 06 Jul 2020 23:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42210 X-GNU-PR-Package: emacs Original-Received: via spool by 42210-submit@debbugs.gnu.org id=B42210.159407736418576 (code B ref 42210); Mon, 06 Jul 2020 23:17:02 +0000 Original-Received: (at 42210) by debbugs.gnu.org; 6 Jul 2020 23:16:04 +0000 Original-Received: from localhost ([127.0.0.1]:35101 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jsaLE-0004pY-8p for submit@debbugs.gnu.org; Mon, 06 Jul 2020 19:16:04 -0400 Original-Received: from relay8-d.mail.gandi.net ([217.70.183.201]:56589) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jsaL9-0004on-Os for 42210@debbugs.gnu.org; Mon, 06 Jul 2020 19:16:03 -0400 X-Originating-IP: 91.129.96.187 Original-Received: from mail.gandi.net (m91-129-96-187.cust.tele2.ee [91.129.96.187]) (Authenticated sender: juri@linkov.net) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id E34931BF207; Mon, 6 Jul 2020 23:15:51 +0000 (UTC) In-Reply-To: <87wo3hflqe.fsf@iris.silentflame.com> (Sean Whitton's message of "Sun, 05 Jul 2020 18:58:17 -0700") 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:182773 Archived-At: >> Thanks for the patch. On emacs-devel you said that rather than add >> definitions of project-find-file-other-window, etc. >> display-buffer-override-next-command could be used. But there is no >> display-buffer-override-next-command in your patch, and definitions of >> project-find-file-other-window etc. are still added (with the help of macro). > > Yeah. After thinking about it a bit more I thought that this would be > more consistent with both the way the other C-x 4 commands work and how > the C-x p subcommands work -- i.e., it's just an ordinary keymap. > > Additionally, my approach means that the -other-window functions are > available to be called from lisp, just as switch-to-buffer-other-window > and find-file-other-window already are, which might be useful. Actually, keeping consistency with existing C-x 4 commands is not a requirement. It's quite possible that existing commands will be declared deprecated as currently is discussed on emacs-devel. >> Would it be possible to define the 'C-x 4 p' map the same way as >> 'C-x p p' is defined? There is a patch in https://debbugs.gnu.org/41890#127 >> to use the default project keymap 'C-x p' in 'C-x p p'. You could try to >> use the same keymap in 'C-x 4 p', and wrap the command call with >> display-buffer-override-next-command. > > I could give it a shot, but wouldn't it be less useful, since the > -other-window functions would no longer be available to be called from > lisp? I see it as an advantage that makes the namespace cleaner - there will be no more such useless duplicates as switch-to-buffer switch-to-buffer-other-frame switch-to-buffer-other-tab switch-to-buffer-other-window and similarly for dozens of other commands. When browsing command names e.g. in command completions of M-x or C-h f this will reduce the mess. For a rare case when the users might want to bind an other-window command directly to a non-prefix key in an init file, then maybe it's possible to provide a macro or better a wrapper function that could be used like (global-set-key (kbd "C-x w b") (with-other-window 'switch-to-buffer)) > Maybe you could explain why you think doing it like C-x p p would be > better. Thanks again. Let's see what the emacs-devel discussion will bring, maybe C-x 4 will be bound to a command like C-x p p is implemented in https://debbugs.gnu.org/41890#50