unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Ted Zlatanov <tzz@lifelogs.com>
Cc: bug-gnu-emacs@gnu.org
Subject: bug#8050: Gnus does not connect to my IMAP server any more
Date: Tue, 08 Mar 2011 16:34:53 -0500	[thread overview]
Message-ID: <jwvfwqxcnpr.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87lj0ptv9y.fsf@lifelogs.com> (Ted Zlatanov's message of "Tue, 08 Mar 2011 10:46:33 -0600")

>                          (case r
>                            ('secret "%p password for user %u, host %h: ")
>                            ('user "%p user name: ")
>                            ('host "%p host name for user %u: ")
>                            ('port "%p port for user %u and host %h: "))
>                          (format "Enter %s (%%u@%%h:%%p): " r)))

> Can you please propose specific replacements?

         (case r
           (secret "%p password for %u@%h: ")
           (user "%p user name for %h: ")
           (host "%p host name for user %u: ")
           (port "%p port for %u@%h: "))
         (format "Enter %s (%%u@%%h:%%p): " r)))

Notes:
- I added the host name to the user prompt (usually the user name
  may be different in different hosts for the same user, so most such
  prompts do include a hostname/realm).
- I left the user name in the host prompt, even though that sounds
  backward to me (kind of like choosing the street number before the
  street name).
- I removed the quotes which just made each of the branches be
  acceptable when `r' has value `quote'.
         
> I'll put something in.  This makes sense but is extra work for the
> auth-source API users, unfortunately.

I know, but the difference in user experience is enormous.

>>> I'm not sure about that one, I'm just using `read-passwd'.

SM> No, you misread: I'm talking about the prompt to save the password
SM> (i.e. the one with y/n/N/e/?), not the prompt to read the password.

> It uses:
>         (while (not done)
>           (message "%s" prompt)
>           (setq k (read-char))
>           ...)

And that leads to an absence of cursor in the minibuffer, even though
it's fundamentally a prompt.  Why not copy y-or-n-p from subr.el as
a starting point?
If you can factor out the commonality, I'd be happy to provide
a "prompt-maker" function and then define y-or-n-p in terms of that
prompt-maker.

SM> Two things:
SM> 1- then make it look nice, like "Saved password for foo@bar into <file>".
SM> The current text really looks like debug output.
> All the output from auth-source starts with the function name.

I call that debug output and is not OK for normal messages.

> The line you mention can be put in the background in favor of the
> output you specified.  But, again, auth-source does NOT just save
> passwords, and there's no guarantee that a host or a port were
> specified.  So the message will look different.

The case where a user and host were specified is likely to be the main
one for most users, so it's worth handling it specially.

SM> 2- I just replied "n" before, so I did *not* want it saved (tho I do
SM> want it saved for the session), so it is not a rare event at all.
> OK, I'll show it only when the data is saved.

Good, thank you.


        Stefan





  parent reply	other threads:[~2011-03-08 21:34 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-16  1:54 bug#8050: Gnus does not connect to my IMAP server any more Stefan Monnier
2011-02-24  1:03 ` Stefan Monnier
     [not found] ` <mailman.0.1298509609.2066.bug-gnu-emacs@gnu.org>
2011-02-24 12:50   ` Ted Zlatanov
     [not found]   ` <87y655bnr4.fsf@lifelogs.com>
2011-02-24 15:22     ` Stefan Monnier
2011-02-24 16:29       ` Ted Zlatanov
2011-02-25  4:29     ` Lars Magne Ingebrigtsen
     [not found]     ` <87wrkobutr.fsf@gnus.org>
2011-02-25 11:21       ` Ted Zlatanov
2011-02-25 11:50         ` Ted Zlatanov
2011-03-05 12:17         ` Lars Magne Ingebrigtsen
2011-02-25 17:27 ` Ted Zlatanov
2011-03-05 20:13 ` Stefan Monnier
     [not found] ` <mailman.17.1299357452.24947.bug-gnu-emacs@gnu.org>
2011-03-07 18:23   ` Ted Zlatanov
2011-03-07 23:10     ` Stefan Monnier
     [not found]     ` <mailman.2.1299548219.4111.bug-gnu-emacs@gnu.org>
2011-03-08 16:46       ` Ted Zlatanov
2011-03-08 19:49         ` Ted Zlatanov
2011-03-08 21:34         ` Stefan Monnier [this message]
     [not found]         ` <mailman.12.1299620228.21372.bug-gnu-emacs@gnu.org>
2011-03-08 21:57           ` Ted Zlatanov
2011-03-09  3:04             ` Stefan Monnier
     [not found]             ` <mailman.4.1299640020.25099.bug-gnu-emacs@gnu.org>
2011-03-09 11:20               ` Ted Zlatanov
2011-03-09 18:34                 ` Stefan Monnier
     [not found]                 ` <mailman.4.1299703021.13037.bug-gnu-emacs@gnu.org>
2011-03-09 21:34                   ` Ted Zlatanov
2011-03-10  2:16                     ` Stefan Monnier
2011-03-12  3:43                       ` Stefan Monnier
     [not found]                       ` <mailman.1.1299902822.7270.bug-gnu-emacs@gnu.org>
2011-03-12 18:08                         ` Ted Zlatanov
2011-03-14 13:58                           ` Stefan Monnier
2011-03-08 18:33     ` Ted Zlatanov
     [not found] <mailman.12.1297821996.25725.bug-gnu-emacs@gnu.org>
2011-02-16 18:29 ` Ted Zlatanov
     [not found] ` <874o836dfv.fsf@lifelogs.com>
2011-02-16 21:22   ` Stefan Monnier
2011-02-16 21:34     ` Michael Albinus
2011-02-16 22:08     ` Ted Zlatanov
2011-02-18  0:24       ` Lars Ingebrigtsen
2011-02-18  2:37         ` Stefan Monnier
2011-02-18  8:19           ` Lars Ingebrigtsen
2011-02-18 20:16           ` Ted Zlatanov
2011-02-18 22:43             ` Stefan Monnier
2011-02-22 21:51               ` Ted Zlatanov
2011-02-18 23:04             ` Lars Ingebrigtsen
2011-02-22 22:46               ` Stefan Monnier
     [not found]               ` <mailman.4.1298416010.11499.bug-gnu-emacs@gnu.org>
2011-02-22 23:47                 ` Ted Zlatanov
2011-02-16 21:26   ` Lars Magne Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvfwqxcnpr.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=bug-gnu-emacs@gnu.org \
    --cc=tzz@lifelogs.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).