From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#49057: 28.0.50; windmove-display-in-direction ignores windmove-display-no-select Date: Thu, 17 Jun 2021 10:33:16 +0200 Message-ID: References: <20210616064248.mqqzlt7qyxwqrcfy.ref@Ergus> <20210616064248.mqqzlt7qyxwqrcfy@Ergus> <87fsxitdmt.fsf@mail.linkov.net> <20210616121632.k365bes37rs5m6sl@Ergus> <87mtrpjtkm.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10159"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 49057@debbugs.gnu.org To: Juri Linkov , Ergus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 17 10:34:15 2021 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 1ltnTa-0002Qo-KZ for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 17 Jun 2021 10:34:14 +0200 Original-Received: from localhost ([::1]:39934 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltnTZ-0001EW-L5 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 17 Jun 2021 04:34:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44500) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltnTO-0001Bw-Pu for bug-gnu-emacs@gnu.org; Thu, 17 Jun 2021 04:34:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42232) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ltnTO-00046N-HU for bug-gnu-emacs@gnu.org; Thu, 17 Jun 2021 04:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ltnTO-0007vd-G6 for bug-gnu-emacs@gnu.org; Thu, 17 Jun 2021 04:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 17 Jun 2021 08:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49057 X-GNU-PR-Package: emacs Original-Received: via spool by 49057-submit@debbugs.gnu.org id=B49057.162391880930435 (code B ref 49057); Thu, 17 Jun 2021 08:34:02 +0000 Original-Received: (at 49057) by debbugs.gnu.org; 17 Jun 2021 08:33:29 +0000 Original-Received: from localhost ([127.0.0.1]:53778 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ltnSr-0007uo-2m for submit@debbugs.gnu.org; Thu, 17 Jun 2021 04:33:29 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]:39949) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ltnSp-0007uR-EK for 49057@debbugs.gnu.org; Thu, 17 Jun 2021 04:33:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1623918798; bh=r//FhfCv2+FOh+OFMpSriMtiVFj0XBWzpo3j7nXiOlE=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=hdKwu9i5N1qx4ApkW5tga0CEm36n2xZvIJil/P0sli5+75U/czsb1yBVVeAV6ajsm LrbZA3pZ4qp7nyqe8bzDVmpOU1JSzZFSW65OkSk4hTLviAnUgnjZJvxyPdUzPZrRlE vdkd/R9sLC3IYWXcYFuymeYMVnRvSzrs/U4laROg= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [192.168.1.101] ([212.95.5.8]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MSKuA-1litM60BHU-00SdVd; Thu, 17 Jun 2021 10:33:18 +0200 In-Reply-To: <87mtrpjtkm.fsf@mail.linkov.net> Content-Language: en-US X-Provags-ID: V03:K1:qAEdBH38b+k1jDGKx0UGR75NLibJKTjmWUPGkKu3uATIHpjga8Q J37d+G/sOMrSHB2vJbtHxkmoALsf/npiVSHOARzeZ16iuIDo51wVPQJEMqTf6yNqXXqytJl sjuht7amOjM0n5geQOdJqQjmYtxNZO0KcQvUzO8ia0Vne53WRMiAc9I3e7VfGQYIN/bewvP ZQoZtvytwRrWK1EHbG53Q== X-UI-Out-Filterresults: notjunk:1;V03:K0:/JiX74/8Qrc=:Urpiw7wMrotAoDi9gEWqlB Uz3OlXiUeR39r1lI6pL5FP9x315mSI3pgxWDy+X/5UO4b+JCxVGB4jgH0+y4CFeCQumQqv3lx PoXqaxqW2Aif9AiTDV8x5s5/sQu619dcL/celKpUtDUH+GqKqR+JOgS+XbJ3Soqgf4AsTu+8C FK7M7955kzzPFAXLoi11+HIt4PF4delQwkh828AIixZZRYQwRaUMJQeQ81rjE7rnfhhgW/8Xm qJ5HvSCQFOsWSyld0V3bv1pXX5tvUhipkfNU6St7dEbZTLeK/Db4GiN3zyGf3zMSRK1x8HNEG Rd3zPB1GtUko0lTB/qZK7sLMe8DrBRrnm+Zvxlc+/Jg+P9zFs3snf3Y7StvdDa/WwdxPjo87T 6zyzPJmRkefHrQiqSt1uKcVUdiGpHjd8Rqhvm/f2bDAQiQQ23lMQwer3MR+6TW2I0tZR96xql vWJE7zPFwfnGVn5T7zOs5WhjpqH9G6GgqfoPaX01danNg2ZW/jixQZNswmVoa9xR9liMon3YY TRpl0k5iIuFptfaMvqNP3Fpo1Gej6PtV6KHwTN3J/8ZnuC+vZKddM8yLG1nLn02nyUrsiBYXW OCe1xBvlulT6AOWcRx5g9CTD4dSsyrXWZtXCFRBgBU9Vmya76kuFFfiMTkPTPkHqOv54MJHCI twMbGLlPkcP7ejprQWQ8k8rwA1p44YZQ7jsKhlaHx/ysWwA8c9ZYnCSxPgh9Rjt0+YdZwVoiN xruBjTCZnhz7h6RlxEuEONg4gT53Siz9rh9EsBLiRdl7sLv6Jssj6LN7nmuVXjHGkbWkSJBV 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:208658 Archived-At: > 1. switch-to-buffer calls pop-to-buffer-same-window > 2. pop-to-buffer-same-window calls pop-to-buffer > 3. pop-to-buffer calls display-buffer > 4. display-buffer calls display-buffer-override-next-command > that calls post-function from windmove-display-in-direction > that selects the old window > > 5. but later pop-to-buffer selects the new window, > thus overriding the specified selection of the old window. Conceptually, `pop-to-buffer' has to Display buffer specified by BUFFER-OR-NAME and select its window. so I cannot see anything wrong here. Step 5 must be allowed to override any selection made in step 4 and any expectation derived from having set `windmove-display-no-select' to t is moot here. [BTW, `windmove-display-in-direction' is not a command but its doc-string= talks about If =E2=80=98windmove-display-no-select=E2=80=99 is non-nil, this comma= nd doesn=E2=80=99t select the window with a displayed buffer, and the meaning of the prefix argument is reversed. This should be fixed.] Now we all know that `display-buffer' may or may not select the chosen window. We cannot disallow it when the window shall appear on a new frame because most WMs will "select" the new frame. Even trying to disallow it in such case might be a bad idea because this instance of `display-buffer' might have been triggered by a `pop-to-buffer' like function and we will confuse the hell out of the WM - do not select the new frame as `display-buffer' says, do select it as `pop-to-buffer' or `switch-to-buffer' say ... So maybe we should relax that basic statement of `display-buffer' This command makes BUFFER-OR-NAME appear in some window, without selecting the window or making the buffer current. because it is wrong anyway. Then we could add an additional action alist entry, say 'select' with values like - t (try to select) - nil (avoid to select) and maybe `never' or 'on-new-frame-only' to emphasize whether `display-buffer' is allowed to select the window and make its buffer current. This has the advantage of freeing `display-buffer' from the responsibility to decide whether it may select the chosen window. Then we could also try to use frame parameters like 'no-focus-on-map' and 'no-accept-focus' right away and users do not have to specify them explicitly via `pop-up-frame-parameters'. martin