all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#15501: 24.3; usage of read-passwd within format-alist
@ 2013-10-01 12:22 mhoram
  2013-10-04 18:26 ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: mhoram @ 2013-10-01 12:22 UTC (permalink / raw)
  To: 15501

Hello,

read-password does not hide password characters when used within
format-alist during loading of a file.
Version of Emacs is 24.3.

One can reproduce the bug with "emacs -Q" by loading the following
file
--- BEGIN test.el ---
;ttxxtt

(setq format-alist
      (cons (list 'txtins
                  "txtins"
                  "^;ttxxtt"
                  (lambda (x y) "ins"
                    (goto-char (point-min))
                    (insert ";;" (read-passwd "password: ") "\n")
                    (point-max))
                  nil
                  t
                  nil)
            format-alist))
--- END test.el ---

and executing the setq-statement.  When this buffer is killed and loaded
again, one is asked for the password and the password-characters are
shown in plaintext on display.

I would expect that read-passwd always hides the characters.

Emacs Version 23.3 did not contain this bug.

Best wishes
Markus



In GNU Emacs 24.3.1 (i386-mingw-nt6.1.7601)
 of 2013-03-17 on MARVIN
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --with-gcc (4.7) --cflags
 -ID:/devel/emacs/libs/libXpm-3.5.8/include
 -ID:/devel/emacs/libs/libXpm-3.5.8/src
 -ID:/devel/emacs/libs/libpng-dev_1.4.3-1/include
 -ID:/devel/emacs/libs/zlib-dev_1.2.5-2/include
 -ID:/devel/emacs/libs/giflib-4.1.4-1/include
 -ID:/devel/emacs/libs/jpeg-6b-4/include
 -ID:/devel/emacs/libs/tiff-3.8.2-1/include
 -ID:/devel/emacs/libs/gnutls-3.0.9/include
 -ID:/devel/emacs/libs/libiconv-1.13.1-1-dev/include
 -ID:/devel/emacs/libs/libxml2-2.7.8/include/libxml2'

Important settings:
  value of $LANG: DEU
  locale-coding-system: cp1252
  default enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#15501: 24.3; usage of read-passwd within format-alist
  2013-10-01 12:22 bug#15501: 24.3; usage of read-passwd within format-alist mhoram
@ 2013-10-04 18:26 ` Stefan Monnier
  2013-10-07 19:34   ` mhoram
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2013-10-04 18:26 UTC (permalink / raw)
  To: mhoram; +Cc: 15501

> read-password does not hide password characters when used within
> format-alist during loading of a file.

Indeed, read-passwd now relies on after-change-functions to hide the
password characters, but format-insert-file binds
inhibit-modification-hooks before calling the function found in
format-alist.

I installed a patch (see below) which should fix this issue, but I'm
curious: what do you use format-alist for that triggered this problem?


        Stefan


--- lisp/subr.el	2013-10-03 04:41:23 +0000
+++ lisp/subr.el	2013-10-04 18:20:33 +0000
@@ -2104,6 +2104,7 @@
             (setq-local buffer-undo-list t)
             (setq-local select-active-regions nil)
             (use-local-map read-passwd-map)
+            (setq-local inhibit-modification-hooks nil) ;bug#15501.
             (add-hook 'after-change-functions hide-chars-fun nil 'local))
         (unwind-protect
             (let ((enable-recursive-minibuffers t))





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#15501: 24.3; usage of read-passwd within format-alist
  2013-10-04 18:26 ` Stefan Monnier
@ 2013-10-07 19:34   ` mhoram
  0 siblings, 0 replies; 3+ messages in thread
From: mhoram @ 2013-10-07 19:34 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: mhoram, 15501

Hello Stefan,

Am 04.10.2013 20:26, schrieb Stefan Monnier:
> I installed a patch (see below) which should fix this issue, but I'm
> curious: what do you use format-alist for that triggered this problem?

thanks for providing this patch. It solves the problem for me.

My library aes.el https://github.com/gaddhi/aes enables emacs to store
files in an encrypted format. In this library I use format-alist to
recognize encrypted files based on a common file-header and - if
encrypted - decrypt them automatically by asking for the password.

Sorry for the late reply, but I was on vacation.

Best wishes
Markus





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-10-07 19:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-01 12:22 bug#15501: 24.3; usage of read-passwd within format-alist mhoram
2013-10-04 18:26 ` Stefan Monnier
2013-10-07 19:34   ` mhoram

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.