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: Fri, 18 Oct 2024 13:02:59 +0200 Message-ID: <875xppvfks.fsf@gmx.de> References: <1d3172d5-3704-40c6-92af-8888b0657871@gmx.at> <87v7xxsj4l.fsf@gmx.de> <87wmicqe5a.fsf@gmx.de> <877cacvv0r.fsf@gmx.de> <49fca25a-d5aa-4f14-ae09-52923eb5ce85@gmx.at> <87zfn3w48f.fsf@gmx.de> <87ed4fvtx7.fsf@gmx.de> <012433ab-1fe0-40df-92b8-f263fac7731d@gmx.at> <87cyjxvgm4.fsf@gmx.de> Reply-To: Michael Albinus Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24043"; 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 Fri Oct 18 13:04:02 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 1t1km2-000673-6c for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 18 Oct 2024 13:04:02 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t1klj-0006mD-3d; Fri, 18 Oct 2024 07:03:43 -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 1t1klh-0006lc-16 for bug-gnu-emacs@gnu.org; Fri, 18 Oct 2024 07:03:41 -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 1t1klg-00038J-Ow for bug-gnu-emacs@gnu.org; Fri, 18 Oct 2024 07:03:40 -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=GN3L9mFrt3pydNjbX/K6OfXlqDp+3izpEeuG51t8HCo=; b=klpj9/oFWSuT3OYajg6oqRZcRnhNluGZyBUMARUS09/zDh287kaHjfj/4+8NJayYoybTfEbkh9VOBDL+LRNZ9Re445LlmJlwyHBTTcdRJJerQobCSSIHImZwGwUjpTD14IdO0o9h/Ss7VOB4Ul/G9SprL+KsXo9o4HusL1R7s+ooRCfyv+SVAWBoR75aVNYpAK2wNEU/KGR88Ack9R8ePIqQIrVMBprqayBQWv1JyGNslX/0KTIwMpJLSQi5PT9aafkW7LXox8SDGrftM0WXuzf0MlD5x/0d3fWxM9dxSSWVKKdWWEGqo2Q1vdNzgSfJjSF8CBR7ncON0eevWTTOUg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t1km2-00015s-IO for bug-gnu-emacs@gnu.org; Fri, 18 Oct 2024 07:04: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: Fri, 18 Oct 2024 11:04:02 +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.17292494214165 (code B ref -1); Fri, 18 Oct 2024 11:04:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 18 Oct 2024 11:03:41 +0000 Original-Received: from localhost ([127.0.0.1]:37252 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t1klg-000156-HU for submit@debbugs.gnu.org; Fri, 18 Oct 2024 07:03:41 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:35682) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t1kle-00014y-1s for submit@debbugs.gnu.org; Fri, 18 Oct 2024 07:03:38 -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 1t1klH-0006k8-Gc for bug-gnu-emacs@gnu.org; Fri, 18 Oct 2024 07:03:15 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t1klE-0002xr-Rj for bug-gnu-emacs@gnu.org; Fri, 18 Oct 2024 07:03:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1729249380; x=1729854180; i=michael.albinus@gmx.de; bh=GN3L9mFrt3pydNjbX/K6OfXlqDp+3izpEeuG51t8HCo=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=kijH8HVljUHXX4CA3SFk/R4092M5QC8GhAVyb4+sUsaQ1ZPs0/VAs1DEwTH8TEOA tuTgOS22tcjnlW+YoWQFky2DQxn/eRLLNrMxVL/YGoK0aGCLr4Ws69WMVJ58EaZie FsxoqikBOApPpWIFLUiv5gHctFBZ12U8+hi8oJ1Fa0yjLsH4tGsgd6/eNz6aN4LjU /HESunK+DkRntDD8j0wVWUgCnqYqz7ZW/Hm6V4CggcjSjT80bnnq2qKEy7UJ80S/d iuXKnCg0nXZDBPh4hQej6xeq7PoKqHDyR2Ry3rnoq05mwzzwWQc4G0aAT+rAcgQtK 0xn1IYyFAOMZtnwoeg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from gandalf.gmx.de ([185.89.38.155]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M42jK-1t1kl22n5M-00Cc44; Fri, 18 Oct 2024 13:03:00 +0200 In-Reply-To: <87cyjxvgm4.fsf@gmx.de> (Michael Albinus's message of "Fri, 18 Oct 2024 12:40:35 +0200") X-Provags-ID: V03:K1:17zWs0SDVACc2KnQqXdxXvF8y+t7a/BAV9j104SJACdfawfD+bT 5P+9g+bh6t3E9EOf9qLFEiAv3pZpEcv4DF990iazCqoCS0NvZSlSaJ8s+BA/cIL9hEZ1nK0 gxd1ZSr4IxCGcLjqNzSGiELLggwk/L0s0lFAUMATWjqI9+pL0xRYv9u3QRV2OQGsNuiants YjWGuY4/lN11j1YP+VFLg== UI-OutboundReport: notjunk:1;M01:P0:W2ZxBQXA7LM=;1PFtpi08RimWLIqP0sC0/uepeyN rsmO67Mgfk2BP9wK6etQMeNFTyZcdBK9PcMPjZkp6IkERL5s0WhcY6lJJCKdB0PjD2BA4fW3U xOxpqrXLfQkJ3Wi+NQeQgzcZvQpR8FiE12rnftXDV5K9o0xI1mBJVsEf5K5Ln589ar0LOinRZ AmjDEx2DHsWtMAGFi4u/kg3IOhgXRK0GOLksacVhw7DHWGCDI4TbFRcVEn8rS51KpVZWh7Iwa FkdR36b6sTcPEKPUvXVp/LLKb2YThNk7BZRjhp1p8uVy2kZUTWYBIS3jx9svvvH2i7itjklbl Mu8lQ2mC09xipedG1hvjJ0t7lMNfbJ9s+JJFkaP8a0yGWy3rDL440NbIz4sJoH667ph6c4Qs8 FN14MLKRc6tNWqSsc0XBMankquX6wHQCPI/glhgvNh0e0MFSMoPx0jmMD10DbhcugqSpdittE f552vg4/oNHeCC6jRig61Az+JHjLyx6zp6yAJA56nAxiXW52NMijnTtycU3kEb/CrkOC20Ucm JYrSOzXo26ABU3yEvSPV262MH8DWMfr9tv0OiQUv5s/ViTfsWsYRN8sJnPWw9rC4aGCPfNttl Csima1UhLJ26FuVfsKS+Z9x2j/aEFD3MnS17nJ5Bhvq3gzoqkwsFJzxJlcn6oB+UBpLYjJhmM PYKWnaI2L+T4MpPAMXsRCVA5Mq+q3mPeed0OWpLcFH6IblHAlsTczePYCt2FGEyyK+fKTvyHm u9NZyyncO8h8j+UkPa767EEwC2xm6pajtM05ZpoAiFsH9id6WTe+S5wOnj7qXciGZDqoca2F Received-SPF: pass client-ip=212.227.15.18; envelope-from=michael.albinus@gmx.de; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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:293781 Archived-At: --=-=-= Content-Type: text/plain Michael Albinus writes: Hi Martin, >> One minor problem exists when using a stand-alone minibuffer frame. >> Clicking the icons never works because they appear on another frame and >> when you move the mouse there >> >> (when (minibufferp) >> >> fails. Basically, clicks work now iff the minibuffer window is selected >> and not if the minibuffer window is active as previously. > > I've seen, yes. I have no solution now. I've modified the patch, this case seems to be covered now. > There are further problems like > > emacs -Q --eval '(read-passwd "PWD: ")' > i n p u t TAB > M-: x x x > > The inner minibuffer, showing "xxx", toggles its visibility when > clicking the password icon. I've extended the patch to check for > read-passwd-mode in local-minor-modes. This fix is also included in the patch. Could you pls check whether you see further annoyances? Otherwise, if you give me a go, I'll push to emacs-30. >> martin Best regards, Michael. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment Content-Transfer-Encoding: quoted-printable diff --git a/lisp/auth-source.el b/lisp/auth-source.el index 90b58f560c0..557d360bc6a 100644 =2D-- a/lisp/auth-source.el +++ b/lisp/auth-source.el @@ -2467,14 +2467,11 @@ read-passwd--hide-password-icon :version "30.1" :help-echo "mouse-1: Toggle password visibility") -(defvar read-passwd--mode-line-buffer nil - "Buffer to modify `mode-line-format' for showing/hiding passwords.") - (defvar read-passwd--mode-line-icon nil "Propertized mode line icon for showing/hiding passwords.") (defvar read-passwd--hide-password t - "Toggle whether password should be hidden in minubuffer.") + "Toggle whether password should be hidden in minibuffer.") (defun read-passwd--hide-password () "Make password in minibuffer hidden or visible." @@ -2497,8 +2494,8 @@ read-passwd-toggle-visibility ;; FIXME: In case of a recursive minibuffer, this may select the wron= g ;; mini-buffer. (with-current-buffer (window-buffer win) - (setq read-passwd--hide-password (not read-passwd--hide-password)) - (with-current-buffer read-passwd--mode-line-buffer + (when (memq 'read-passwd-mode local-minor-modes) + (setq read-passwd--hide-password (not read-passwd--hide-password)= ) (setq read-passwd--mode-line-icon `(:propertize ,(if icon-preference @@ -2514,8 +2511,8 @@ read-passwd-toggle-visibility (define-key map [mode-line mouse-1] #'read-passwd-toggle-visibility) map)))) - (force-mode-line-update)) - (read-passwd--hide-password)))) + (force-mode-line-update 'all) + (read-passwd--hide-password))))) (defvar read-passwd-map ;; BEWARE: `defconst' would purecopy it, breaking the sharing with @@ -2534,25 +2531,18 @@ read-passwd-mode :keymap read-passwd-map :version "30.1" - (setq read-passwd--hide-password nil - ;; Stolen from `eldoc-minibuffer-message'. - read-passwd--mode-line-buffer - (window-buffer - (or (window-in-direction 'above (minibuffer-window)) - (minibuffer-selected-window) - (get-largest-window)))) + (setq read-passwd--hide-password nil) + (or global-mode-string (setq global-mode-string '(""))) - (if read-passwd-mode - (with-current-buffer read-passwd--mode-line-buffer + (let ((mode-string '(:eval read-passwd--mode-line-icon))) + (if read-passwd-mode ;; Add `read-passwd--mode-line-icon'. - (when (listp mode-line-format) - (setq mode-line-format - (cons '(:eval read-passwd--mode-line-icon) - mode-line-format)))) - (with-current-buffer read-passwd--mode-line-buffer + (or (member mode-string global-mode-string) + (setq global-mode-string + (append global-mode-string (list mode-string)))) ;; Remove `read-passwd--mode-line-icon'. - (when (listp mode-line-format) - (setq mode-line-format (cdr mode-line-format))))) + (setq global-mode-string + (delete mode-string global-mode-string)))) (when read-passwd-mode (read-passwd-toggle-visibility))) --=-=-=--