help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: how to customize `read-passwd' [was: Setting mark in minibuffer prom


From: Whitfield Diffie
Subject: Re: how to customize `read-passwd' [was: Setting mark in minibuffer prompt]
Date: Tue, 10 Jul 2012 21:44:41 -0700

> Please, in general, start a new thread for a new question.

    Will do.  For now, I have accepted yours.

>> Does anyone know how to get the cursor to come out in the
>> right place as I back up down the row of dots that
>> read-passwd echoes?


> What I advise is to look at the code defining `read-passwd', and define your
> function similarly.

    That is of course exactly what I did.  A simplified version that
merely accepts C-f and C-b and moves forward and backward through the
echoed dots is attached.  I have had, however, to insert my own cursor
by hand.  The problem is that the echo of the password is produced by
message and message doesn't seem to call the minibuffer-setup-hook you
taught me about.  (If you enable cursor-in-echo-area, the cursor
appears but sits at the end of the line.)

> What you see there is that `read-key' is called and each key that is read is
> handled with a case analysis.  What you want is to add another case (or 
> cases).

    This is what I did, along with changing the nested ifs to a cond
for readability.


> See how that code currently handles special lists of keys: `stop-keys' and
> `rubout-keys'.  More pertinent perhaps is the treatment of `C-y'.

    Read password doesn't do anything with C-y; it just goes in as an
element of the password.


                                   Whit

Attachment: line-edit-passwd.el
Description: Binary data


reply via email to

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