unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#36286: 26.2.90; auth-source-creation-prompts has not effect?
@ 2019-06-19  6:52 Xu Chunyang
  2019-06-20 15:08 ` Noam Postavsky
  0 siblings, 1 reply; 3+ messages in thread
From: Xu Chunyang @ 2019-06-19  6:52 UTC (permalink / raw)
  To: 36286

C-h f auth-source-search provides this example:

  (let ((auth-source-creation-defaults '((user . "defaultUser")
                                          (A    . "default A")))
         (auth-source-creation-prompts
          '((password . "Enter IMAP password for %h:%p: "))))
    (auth-source-search :host '("nonesuch" "twosuch") :type 'netrc :max 1
                        :P "pppp" :Q "qqqq"
                        :create '(A B Q)))

however I don't see any "Enter IMAP password ..." when I run the example
with C-x C-e, instead I see these prompts:

  [any port] user name for nonesuch [defaultUser]:
  [any port] password for defaultUser@nonesuch:
  Enter A (defaultUser@nonesuch:[any port]) [default A]: 

What format auth-source-creation-prompts should be? Its docstring
doesn't say.

By the way I can't help to complain auth-source's API is very difficult
to work with. Its docstring and info documentation is not very
helpful. For example, I can't understand how :require and :create in
auth-source-search works after struggling for 1 hour. And I can't get
auth-source-forget to work.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#36286: 26.2.90; auth-source-creation-prompts has not effect?
  2019-06-19  6:52 bug#36286: 26.2.90; auth-source-creation-prompts has not effect? Xu Chunyang
@ 2019-06-20 15:08 ` Noam Postavsky
  2021-01-30 10:10   ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Noam Postavsky @ 2019-06-20 15:08 UTC (permalink / raw)
  To: Xu Chunyang; +Cc: 36286

Xu Chunyang <mail@xuchunyang.me> writes:

> C-h f auth-source-search provides this example:
>
>   (let ((auth-source-creation-defaults '((user . "defaultUser")
>                                           (A    . "default A")))
>          (auth-source-creation-prompts
>           '((password . "Enter IMAP password for %h:%p: "))))
>     (auth-source-search :host '("nonesuch" "twosuch") :type 'netrc :max 1
>                         :P "pppp" :Q "qqqq"
>                         :create '(A B Q)))
>
> however I don't see any "Enter IMAP password ..." when I run the
> example

Seems to works if I replace `password' with `secret'.

> with C-x C-e, instead I see these prompts:
>
>   [any port] user name for nonesuch [defaultUser]:
>   [any port] password for defaultUser@nonesuch:
>   Enter A (defaultUser@nonesuch:[any port]) [default A]: 
>
> What format auth-source-creation-prompts should be? Its docstring
> doesn't say.

It does actually mention secret in the paragraph above that example:

     If the user, host, or port are missing, the alist
    ‘auth-source-creation-prompts’ will be used to look up the
    prompts IN THAT ORDER (so the ‘user’ prompt will be queried first,
    then ‘host’, then ‘port’, and finally ‘secret’).

But having a broken example doesn't help.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#36286: 26.2.90; auth-source-creation-prompts has not effect?
  2019-06-20 15:08 ` Noam Postavsky
@ 2021-01-30 10:10   ` Lars Ingebrigtsen
  0 siblings, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2021-01-30 10:10 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: Xu Chunyang, 36286

Noam Postavsky <npostavs@gmail.com> writes:

>> C-h f auth-source-search provides this example:
>>
>>   (let ((auth-source-creation-defaults '((user . "defaultUser")
>>                                           (A    . "default A")))
>>          (auth-source-creation-prompts
>>           '((password . "Enter IMAP password for %h:%p: "))))
>>     (auth-source-search :host '("nonesuch" "twosuch") :type 'netrc :max 1
>>                         :P "pppp" :Q "qqqq"
>>                         :create '(A B Q)))
>>
>> however I don't see any "Enter IMAP password ..." when I run the
>> example
>
> Seems to works if I replace `password' with `secret'.

I've now done this in Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-30 10:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-19  6:52 bug#36286: 26.2.90; auth-source-creation-prompts has not effect? Xu Chunyang
2019-06-20 15:08 ` Noam Postavsky
2021-01-30 10:10   ` Lars Ingebrigtsen

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).