From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#73768: 'read-passwd-mode' can clobber user defined mode lines Date: Sun, 13 Oct 2024 16:19:13 +0200 Message-ID: <87wmicqe5a.fsf@gmx.de> References: <1d3172d5-3704-40c6-92af-8888b0657871@gmx.at> <87v7xxsj4l.fsf@gmx.de> Reply-To: Michael Albinus Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16915"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 73768@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 13 16:20:08 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 1szzS4-0004Du-0H for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 13 Oct 2024 16:20:08 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1szzRk-0003mj-VQ; Sun, 13 Oct 2024 10:19:49 -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 1szzRi-0003mN-W7 for bug-gnu-emacs@gnu.org; Sun, 13 Oct 2024 10:19:47 -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 1szzRi-0000Rf-Nn for bug-gnu-emacs@gnu.org; Sun, 13 Oct 2024 10:19:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=4m1HkvTjDwO/MpmmhSy6Gj010LH+WYvZhiT/F81PcYk=; b=LEzFgS1zlOmJ9xTBypjaPBj7bYiKKJd2F+KJVsJRtIMFhs+w02Ags8ATWHiwv1+/tHxMuLmlU2D9LXebhW/G0VJPRaW4VWislvDVLhykC2eIRjge8dKyabQtv4kKYT91Uy1TMQ6fV6lZ+hOwEVtQJw3QTSAG5NtbHCl4G2pPCrin7zvGb2DbWGFGerD0bo5SRn8lhCXWDotgzcE8A8I1l5uGMvG9iLeHAAU3SJzOFWcDT+iAs8RLZKxy9J2fd1I2ncBOucPXn9yBPh5DQXk61l1VS/iEm0inoaqeZYsMeVKTI0eNTgovt4XmW7dHWcAOMXyiwARVN4JGJCCf3DrEbw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1szzRx-0005UM-W1 for bug-gnu-emacs@gnu.org; Sun, 13 Oct 2024 10:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 13 Oct 2024 14:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73768 X-GNU-PR-Package: emacs X-Debbugs-Original-Cc: "martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors" , 73768@debbugs.gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.172882919421077 (code B ref -1); Sun, 13 Oct 2024 14:20:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 13 Oct 2024 14:19:54 +0000 Original-Received: from localhost ([127.0.0.1]:52009 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1szzRq-0005Ts-5X for submit@debbugs.gnu.org; Sun, 13 Oct 2024 10:19:54 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:39874) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1szzRo-0005Tj-CQ for submit@debbugs.gnu.org; Sun, 13 Oct 2024 10:19:53 -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 1szzRY-0003m4-CT for bug-gnu-emacs@gnu.org; Sun, 13 Oct 2024 10:19:36 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1szzRW-0000R3-At for bug-gnu-emacs@gnu.org; Sun, 13 Oct 2024 10:19:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1728829160; x=1729433960; i=michael.albinus@gmx.de; bh=4m1HkvTjDwO/MpmmhSy6Gj010LH+WYvZhiT/F81PcYk=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=HXxl10TByHWrJiNyLtAJEhvbMpbnGMMHiW2AmZrfX8oDNo39MDQ30z/IR2mBiX2G djcB+e5lT0QPzaDycqHND3SPN2XaR5mNAa7ZfQ5qEOA4HpF5+TebZdIe5HgY89Prc iTnGnlS+xBK0Yey804zB49GmjD2z7p47YePqncVDbR0uiInCQWdZfT6TzIsPkxXly Rx8wZaeHLE44hQDl/DhvJwKfq8AXKd8Cu5mPwlnh5AnFVbXtRTH9BvJW1X2lst1nU Lf+zSMw9WhhYUW462J4OA1lBQ4iqmTl+BxTGIkzKJXYQeMxM4oOAPTtHlLvaK9/oS hBT83Jp5oWGRgBWDjw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from gandalf.gmx.de ([185.89.38.155]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MJVHU-1tFKQi0WJk-00Q8Po; Sun, 13 Oct 2024 16:19:20 +0200 In-Reply-To: (martin rudalics's message of "Sun, 13 Oct 2024 11:58:52 +0200") X-Provags-ID: V03:K1:jEe7ZA382NaxGqo/0tZNlbqFz/eZacEQa1Z0JjEvR2ZProfxXiE aJxrdqAlxBkAruLD1dwk2j4nby2xM3QWpJSrVovPefYOXofJugDqOf3E98VPov+c1HRxqz2 oFiJ57+viHUtEft25k1tAnVjLqtgRs+PpHBv8rJAsesNAPdE6RZLXrDVZZcJZlloL1ffrXv WO5tOiZpXLv4UvBf9KYgA== UI-OutboundReport: notjunk:1;M01:P0:Yhm9VL/vCjc=;2f0Ng0YgnTm3iUsxDWvV5jXJ3SI 3sBBQvZdY4f7H0kXwzUEGmI7NjHPq4Ks5TcjSKYZq3ABxR7IKwkvJ1nmnVerlBHxzZ3cZDSLI s4irdMQXpYjpf9sa1Xhkcw3oSYmxdFEB5djNVVUNakeOUiF8ubUo7IEnpUNXERM9f4aCMyCtS iHFQyJkt3bNNMoSDZARB/H8ENRR1qPAWyJIbg3//Rs6SsxA4ZRFaZa5cE69eGqwNQ2bdymyxx vHz7hBEMghbl/otNeuABLezwS+s4hIL2OFAkfyZu7fhMJT05zL1dr2HrD7rKgwmz0rcdmqFze VRkrhn2ziLGhRvwTtFQRTVY4gyqBwdPEYTI3pvOXXuK/PDaG0BeMkwr7Nv0YShUqaRZndnjb9 5NijEVSkRMpovu4a2+TN/e6gRzOxJ7B26n69GrS5YKvEvnz2fyymaY2GDzH9m+119uTFUWUC0 iYwIuGDiV9sL4V5FIbMmM/TzCldMcKek1IGbK0MOyxEDzPuQUwKxikWfwn8lylMzaFy8a2Mlc nYuNKmvHFHWMp/X2vNm5vM1RzQK7KslabaNNQoHX4/yv7VY842uOdJ/CTGqWNlVMDvyHGSbZx SwNZteO5Juon1/uKNgSanDayyZ6mmiWvHnR2TfIHcCupzMbPzLGKcMDjT5zoV17KKBc8/BFhn ay/Pj+wl20ixZmmwhcD4M05Pqmla41+bAN09D925ECReSABqct/tr7m96GBBIFw0NxTUdQTpY BO5faBoygPgF6C6nTOi7L/F0+ZUL0Re7o9Tk0xBv5wKx6Tqc6GF2Fk+Ev35En5WvPwHQQx3L Received-SPF: pass client-ip=212.227.17.20; envelope-from=michael.albinus@gmx.de; helo=mout.gmx.net X-Spam_score_int: -40 X-Spam_score: -4.1 X-Spam_bar: ---- X-Spam_report: (-4.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-1.255, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:293521 Archived-At: martin rudalics writes: Hi Martin, > When in my Emacs with a stand alone minibuffer frame I create a shell > buffer and there do ssh-add, the following happens: > > In the lines below 'wid' stands for the window in direction (nil in the > rows below because a stand alone minibuffer frame has no window above), > 'msw' the minibuffer selected window, 'glw' the largest window (nil in > the first row below because a stand alone minibuffer frame has no > largest window) and 'sw' the selected window. 'add' and 'remove' stand > for adding and removing the icon. 'before' and 'after' stand for whether > we are before or after doing that. These are followed by the value of > 'read-passwd--mode-line-buffer' and the first two elements of that > buffer's mode line string. > > wid .. nil .. msw .. # .. glw .. nil .. sw .. # > add before .. *shell* .. %e .. mode-line-version > add after .. *shell* .. (:eval read-passwd--mode-line-icon) .. %e > wid .. nil .. msw .. nil .. glw .. # .. sw .. # > remove before .. .emacs .. %e .. mode-line-version > remove after .. .emacs .. mode-line-version .. > > So the window chosen for adding the icon is the value of calling > 'minibuffer-selected-window' and everything is OK ('mode-line-version' > is a private variable of mine, ignore it). The icon's buffer is *shell* > and the icon appears correctly. > > But when the icon shall be removed, 'minibuffer-selected-window' returns > nil and the largest window is chosen instead which now happens to show > my init file .emacs. =E2=80=98read-passwd=E2=80=99 leaves the icon in *s= hell* and kills > the mode line of my .emacs file. > > The crucial fact is that the selected window changes from the minibuffer > window to the *shell* window because 'minibuffer-selected-window' is > specified as > > if (minibuf_level > 0 > && MINI_WINDOW_P (XWINDOW (selected_window)) > && WINDOW_LIVE_P (minibuf_selected_window)) > return minibuf_selected_window; > > and *shell* is not a mini window. So 'minibuffer-selected-window' > returns nil in the scenario at hand and the largest window of the > selected window's frame is chosen. And the selected window obviously > changes because 'read-string' (and in further consequence read_minibuf) > restores the window selected before the minibuffer window was selected. > > Concludingly, the current version works when 'window-in-direction' > returns a suitable window and may fail miserably otherwise. I tried to reproduce your recipe, but I couldn't. Likely, I have a too simple minded use of different Emacs windows. And a not customized mode line. Note, that I'm not familiar with the windows machinery in Emacs at all. > The attached patch fixes the problem here. But I still think that the > icon should appear in the prompt of 'read-passwd' itself. Please install your patch (you might ask Eli whether it is good for the emacs-30 branch). And as I said in the other message, the mode line is the place to give information about the active buffer, including the minibu= ffer. Thanks a lot for investigating it! > martin Best regards, Michael.