From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: a bug of read-passwd Date: Fri, 21 Jul 2006 15:08:37 -0400 Message-ID: <874pxau66i.fsf@stupidchicken.com> References: <877j2etda5.fsf@stupidchicken.com> <20060719.094900.73654343.kazu@iij.ad.jp> <20060721.095708.119557783.kazu@iij.ad.jp> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1153508912 21715 80.91.229.2 (21 Jul 2006 19:08:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 21 Jul 2006 19:08:32 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 21 21:08:28 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1G40M6-00057O-UI for ged-emacs-devel@m.gmane.org; Fri, 21 Jul 2006 21:08:11 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G40M6-0001Hv-GP for ged-emacs-devel@m.gmane.org; Fri, 21 Jul 2006 15:08:10 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1G40Lq-0001Da-Sk for emacs-devel@gnu.org; Fri, 21 Jul 2006 15:07:54 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1G40Lp-0001BJ-2y for emacs-devel@gnu.org; Fri, 21 Jul 2006 15:07:54 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G40Lo-0001B2-Sy for emacs-devel@gnu.org; Fri, 21 Jul 2006 15:07:52 -0400 Original-Received: from [18.19.1.138] (helo=cyd) by monty-python.gnu.org with esmtp (Exim 4.52) id 1G40MI-0002NV-6K for emacs-devel@gnu.org; Fri, 21 Jul 2006 15:08:22 -0400 Original-Received: by cyd (Postfix, from userid 1000) id F14E14E2A7; Fri, 21 Jul 2006 15:08:37 -0400 (EDT) Original-To: Kazu Yamamoto (=?utf-8?B?5bGx5pys5ZKM5b2m?=) In-Reply-To: <20060721.095708.119557783.kazu@iij.ad.jp> (Kazu Yamamoto =?utf-8?B?KOWxseacrOWSjOW9pikncw==?= message of "Fri, 21 Jul 2006 09:57:08 +0900 (JST)") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:57436 Archived-At: Kazu Yamamoto (=E5=B1=B1=E6=9C=AC=E5=92=8C=E5=BD=A6) write= s: > 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 minibuff= er >> > > and we cannot input our password. >> > >> > Does the code work if you remove the (discard-input)? >>=20 >> Yes. > > With the current CVS tree, this bug still exists and the answer > changed to "NO".=20 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 `accept-process-output': (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))