emacs-devel
[Top][All Lists]
Advanced

[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:33:08 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

>> (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)
>>   (while my-check
>>     (sit-for 0.1)
>>     (discard-input)))
>
> I can reproduce this too.  I'll look into it.

The problem here is that the new sit-for calls (read-event) to wait
for new input.  During this time, the process filter takes over, and
that calls (read-passwd).  While the filter is waiting for the
password prompt, the sit-for timer expires, which causes a throw back
to the `sit-for', spoiling the `read-passwd'.

Not sure how to handle this situation (though, as I mentioned earlier,
the proper thing to do in this situation is to run
`accept-process-output').




reply via email to

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