From c6b6c2d59626e3849691eb1ce747b33e43927ef2 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Wed, 9 Jun 2021 16:09:55 +0200 Subject: [PATCH] Use auth-source for user-passwords * (rcirc): Use auth-source is no password was specifed --- lisp/net/rcirc.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index 90b61badf0e..67dcf3e4eaa 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el @@ -44,6 +44,7 @@ (require 'cl-lib) (require 'ring) (require 'time-date) +(require 'auth-source) (eval-when-compile (require 'subr-x)) (defconst rcirc-id-string (concat "rcirc on GNU Emacs " emacs-version)) @@ -500,6 +501,12 @@ If ARG is non-nil, instead prompt for connection parameters." (encryption (plist-get (cdr c) :encryption)) (server-alias (plist-get (cdr c) :server-alias)) contact) + (when-let (((not password)) + (auth (auth-source-search :host server + :user user-name + :port port)) + (fn (plist-get (car auth) :secret))) + (setq password (funcall fn))) (when server (let (connected) (dolist (p (rcirc-process-list)) -- 2.39.2