GNU bug report logs - #73768
'read-passwd-mode' can clobber user defined mode lines

Previous Next

Package: emacs;

Reported by: martin rudalics <rudalics <at> gmx.at>

Date: Sat, 12 Oct 2024 09:27:02 UTC

Severity: normal

Fixed in version 30.1

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#73768: closed ('read-passwd-mode' can clobber user defined
 mode lines)
Date: Sat, 19 Oct 2024 10:45:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sat, 19 Oct 2024 12:44:13 +0200
with message-id <87bjzgnzia.fsf <at> gmx.de>
and subject line Re: bug#73768: 'read-passwd-mode' can clobber user defined mode lines
has caused the debbugs.gnu.org bug report #73768,
regarding 'read-passwd-mode' can clobber user defined mode lines
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
73768: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=73768
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: martin rudalics <rudalics <at> gmx.at>
To: Bug-Gnu-Emacs <bug-gnu-emacs <at> gnu.org>
Subject: 'read-passwd-mode' can clobber user defined mode lines
Date: Sat, 12 Oct 2024 11:26:31 +0200
After reading a password here I sometimes end up with seeing one or two
eye icons in mode lines of buffers.  Other buffers may get a blank mode
line.  I suppose the culprit is

    (with-current-buffer read-passwd--mode-line-buffer
      ;; Remove `read-passwd--mode-line-icon'.
      (when (listp mode-line-format)
        (setq mode-line-format (cdr mode-line-format)))))

which can do something arbitrary to user defined mode lines which I use.
Eventually, I have to kill or revert all involved buffers every time
I've read a password.

At the very least the code should try to identify the item it added
earlier, remove the car only if it matches that item and restore the
previous mode line format in case the items don't match.  Also it should
check whether 'read-passwd--mode-line-buffer' still exists.

In either case, it would be nice to make showing the eye icon
customizable by the user.  I found no way to do that.

Thanks, martin

In GNU Emacs 31.0.50 (build 13, x86_64-pc-linux-gnu, GTK+ Version
 3.24.38, cairo version 1.16.0) of 2024-10-12 built on restno
Repository revision: 6e80509099e27e237787186f4e8731bfdfb9b00d
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101007
System Description: Debian GNU/Linux 12 (bookworm)

Configured using:
 'configure --with-gif=ifavailable --with-tiff=ifavailable
 --with-gnutls=no --without-pop 'CFLAGS=-O3 -g3 -no-pie''

Configured features:
CAIRO DBUS FREETYPE GIF GLIB GSETTINGS HARFBUZZ JPEG LIBSELINUX MODULES
NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF
TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB

Important settings:
  value of $LANG: de_AT.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: ELisp/d

Minor modes in effect:
  pop-up-mini-mode: t
  scroll-restore-mode: t
  regexp-lock-mode: t
  eldoc-tooltip-mode: t
  tooltip-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  context-menu-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  minibuffer-regexp-mode: t
  column-number-mode: t
  line-number-mode: t
  auto-fill-function: my-lisp-mode-auto-fill
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  temp-buffer-resize-mode: t

Load-path shadows:
None found.

Features:
(shadow mail-extr warnings emacsbug message mailcap yank-media puny
rfc822 mml mml-sec password-cache epa epg rfc6068 epg-config gnus-util
time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils cc-mode cc-fonts cc-guess cc-menus cc-cmds
cc-styles cc-align cc-engine cc-vars cc-defs vc-git files-x
vc-dispatcher elp vc-hg diff-mode track-changes ediff-vers ediff
ediff-merg ediff-mult ediff-wind ediff-diff ediff-help ediff-init
ediff-util local-tags goto-last-change speck pop-up-mini info-look
find-func srt-mode derived elinfo-support elinfo texinfo
texinfo-loaddefs info shell pcomplete comint subr-x ansi-osc ansi-color
sidebar bookmark text-property-search sort m&d scroll-restore
regexp-lock time-stamp cl-macs eldoc-tooltip pcase easy-mmode etags
fileloop generator xref project byte-opt bytecomp byte-compile ring
find-dired dired dired-loaddefs cus-edit pp cus-load icons wid-edit
cl-loaddefs cl-lib jka-compr ls-lisp gv rmc iso-transl tooltip cconv
eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type
elisp-mode mwheel term/x-win x-win term/common-win x-dnd touch-screen
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock
font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq
simple cl-generic indonesian philippine cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite emoji-zwj charscript charprop case-table
epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button
loaddefs theme-loaddefs faces cus-face macroexp files window
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget keymap hashtable-print-readable backquote threads dbusbind
inotify dynamic-setting system-font-setting font-render-setting cairo
gtk x-toolkit xinput2 x multi-tty move-toolbar make-network-process
emacs)

Memory information:
((conses 16 271421 29959) (symbols 48 16095 0) (strings 32 44610 3502)
 (string-bytes 1 1330220) (vectors 16 24496)
 (vector-slots 8 277397 25280) (floats 8 109 1037)
 (intervals 56 9458 42) (buffers 984 34))


[Message part 3 (message/rfc822, inline)]
From: Michael Albinus <michael.albinus <at> gmx.de>
To: martin rudalics <rudalics <at> gmx.at>
Cc: "martin rudalics via Bug reports for GNU Emacs,
 the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>,
 73768-done <at> debbugs.gnu.org
Subject: Re: bug#73768: 'read-passwd-mode' can clobber user defined mode lines
Date: Sat, 19 Oct 2024 12:44:13 +0200
Version: 30.1

Michael Albinus <michael.albinus <at> gmx.de> writes:

Hi Martin,

>> entering 'read-passwd' does
>>
>>             (add-hook 'post-command-hook #'read-passwd--hide-password nil t))
>>
>> while exiting still does
>>
>>               ;; Not sure why but it seems that there might be cases where the
>>               ;; minibuffer is not always properly reset later on, so undo
>>               ;; whatever we've done here (bug#11392).
>>               (remove-hook 'after-change-functions
>>                            #'read-passwd--hide-password 'local)
>>
>> If that fix of Bug#11392 (or Bug#11397) were really needed, then we
>> should remove read-password--hide-password from 'post-command-hook' now.
>> But there were no bug reports in the last four years so probably that
>> bug was fixed by other means.  In either case the current 'remove-hook'
>> is a noop now.
>
> Hmm, yes. While adding read-passwd-mode, I didn't check all settings in
> read-passwd. Likely these settings are superfluous now. I will check in
> master once the other patch has arrived it.

Finally, I've done as you proposed: Remove `read-password--hide-password'
from `post-command-hook'. While playing with the recipe of bug#11397,
sometimes (not always) the minibuffer was corrupted as hiding the
text. So I believe this is the safest change.

Pushed to emacs-30. And closing this bug, now. Thanks again for your
patient discussion the issue!

>> martin

Best regards, Michael.


This bug report was last modified 308 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.