Emacs (3)

auth-source issues with .authinfo.gpg and org2blog

November 23, 2021Blog

Of course, Emacs has its idiosyncrasies. In my latest case of “let’s waste some time after a complete reinstall”, I enjoyed discovering that Emacs I needed to add this line in my doom config.


Otherwise, the returned value of (auth-source-user-and-password) was (nil nil nil). Why? Because apparently, the epa package wasn’t enabled. Why? I don’t know…

And the more you know…

Solving Doom void-function auth-sources-user-and-password error at launch

March 20, 2021Blog

I use Emacs both on my laptop (a Mac) and on my desktop (a Linux). Recently, when launching emacs on my mac, I had the following error:

Error in private config: config.el, (void-function auth-source-user-and-password)

Being an emacs noob, I was a bit puzzled. From what I understood, auth-source is a default package, and this function should be available. I joined the Doom Discord server where I found help in just a few minutes.

From what I understand, Doom optimizes Emacs a lot by lazy loading packages. This is why it is so quick to launch (and a joy to use). In my config.el file, I was calling the auth-source-user-and-password directly. This was the source of the problem. When configuring packages in Doom, make sure you use hooks such as after! which will run the code once a package has loaded. In my case, it looked like that in the end:

(after! auth-source
    (setq foobar-credentials (auth-source-user-and-password "foobar"))

This solved the error at launch and let me use the credential in my configuration.

Blogging from Emacs

February 28, 2021Blog

To my very own surprise, after a decade of being a vim user, I have become a doom emacs user. This is the best of both worlds. I can keep my vim bindings (which I love in a Stockholm syndrome way), and I get to have the amazing Emacs operating system at hands. Look at me now, blogging from org2blog using my vim muscular memory on my WordPress instance.

Doom Emacs is insanely great. It takes a bit of time to get used to it but it’s a very rewarding thing to do. Org Mode is simply great and deserves to have more user.