[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: a bug of read-passwd

From: Chong Yidong
Subject: Re: a bug of read-passwd
Date: Fri, 21 Jul 2006 15:08:37 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Kazu Yamamoto (山本和彦) <address@hidden> writes:

> Hello,
>> > > Recent changes of Emacs introduces a new bug to read-passwd.  If
>> > > read-passwd is called a filter of an asynchronous process and the
>> > > parent code executes sit-for, the cursor goes away from the minibuffer
>> > > and we cannot input our password.
>> >
>> > Does the code work if you remove the (discard-input)?
>> Yes.
> With the current CVS tree, this bug still exists and the answer
> changed to "NO". 

I can reproduce this too.  I'll look into it.  Clearly, the
read-passwd in the asynchronous filter function is interfering with
the sit-for.

BTW, probably the cleaner thing to do for your purposes is to use

(defvar my-check nil)

(defun my-filter (process string)
  (set-buffer (process-buffer process))
  (read-passwd "Password: ")
  (setq my-check nil))

(let ((pro (start-process "*sh*" (current-buffer) "/bin/sh")))
  (setq my-check t)
  (set-process-filter pro 'my-filter)
  (accept-process-output pro)
  (kill-process pro))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]