Took quite a bit of trial and error, but here was the eventual solution:
- Create .authinfo.gpg file in a directory of your choice
- Add the following to the .authinfo.gpg file (for IRC login)
machine irc.freenode.net login <your-irc-nick> port nickserv password <your-irc-pw>
- Add the following to your emacs .init file
Set the dir where .authinfo.gpg exists
(setq auth-sources '((:source "~/.emacs.d/.authinfo.gpg" auth-source-debug t)))
Not sure what this does exactly, but it was required to get things working: https://www.emacswiki.org/emacs/rcircAutoAuthentication
(defadvice rcirc (before rcirc-read-from-authinfo activate) (unless arg (dolist (p (auth-source-search :port '("nickserv") :require '(:port :user :secret))) (let ((secret (plist-get p :secret)) (method (intern (plist-get p :port)))) (add-to-list 'rcirc-authinfo (list (plist-get p :host) method (plist-get p :user) (if (functionp secret) (funcall secret) secret)))))))
This is, more or less, just general rcirc setup which may help you too :)
(setq rcirc-default-nick "<your-nick>" rcirc-default-user-name "<your-nick>" rcirc-auto-authenticate-flag t rcirc-log-flag t rcirc-log-directory "</path/to/irc-logs>" rcirc-track-minor-mode 1 rcirc-server-alist '(("irc.freenode.net" :channels ("#your" "#favorite" "#irc-channels"))))
authinfo/netrcand storing your machine settings in a different location on your hard drive? If yourircstuff is not set-up for that, have a look atget-auth-infowhich uses the built-inauth-sourcelibrary: emacs.stackexchange.com/a/5844/2287 That link is for a different usage, but the concept is the same -- i.e., how to extract authorization credentials from theauthinfo/netrcfile.