I was happy using Spacemacs and I had gotten all the packages and settings just the way I liked them. But Spacemacs still didn’t feel like it “just worked”, for me. Since I had been using Doom Molokai theme in Spacemacs I decided to try Doom.
I really like the fact that Doom is FAST, but I mean FAST!! But I ran into some issues with installing packages. To be fair the issues were not with Doom but more with my lack of understanding Emacs or elisp. Doom has a very specific way of installing packages to help keep things speedy. So it was hard for me to wrap my brain around how to install packages.
I read the wiki and I sort of understood how to install a package. Again my lack of knowledge in elisp or Emacs was my barrier. Luckily I was able to install the one package that I needed org2blog
. But setting up the org2blog
configurations was the most confusing part.
Like I mentioned Doom has very specific ways of doing things and if you don’t follow the rules you won’t get to play. Anyways, I had to figure out
- How Doom managed configurations for installed packages.
- How to configure
org2blog
to work inauth-source
inside Doom.
I had auth-sources
working in Spacemacs mainly because I was able to follow along other peoples blog posts. There were a few good resources that helped me build the correct configuration in Spacemacs but for Doom well there were basically none.
My guess was that there weren’t that many people using org2blog
in Doom so there was very little information online about people setups. So I had to jump between the org2blog
wiki, Doom wiki, and various examples.
So I started by looking through the Doom wiki and trying to figure out how Doom managed configurations for packages. Doom uses +XYZ.el
(XYZ can be named anything) files were a user places all the configurations for “X” packages. I figured this out when I was able to suceessfully figure out how to change the default theme to the Molokai theme.
I installed the org2blog
package and created a file called +blog.el
to manage it’s configurations. I started with the basic org2blog
configurations just to get started and see if it just worked.
Here is the code snippet in the org2blog
wiki. I changed the values for my own and for only one of my blogs.
(setq org2blog/wp-blog-alist '(("wordpress" :url "https://username.wordpress.com/xmlrpc.php" :username "username" :password "superssecretpassword" :default-title "Hello World" :default-categories ("org2blog" "emacs") :tags-as-categories nil))
I ran org2blog
and it was able to log me in successfully. And I was able to post and update to my personal blog. So I knew I was on the right track, I just needed to get auth-sources
working to secure my configurations.
This is were I had the most problems, because I knew very little about getting this to work. So I started with the basics, just get auth-sources
to provide details for one of my blogs. Below is what I came up with after a whole day of troubleshooting.
(setq auth-source-debug t) (setq auth-sources '("~/.authinfo")) ;;--- org2blog settings --- (setq credentials-blog1 (auth-source-user-and-password "Blog1")) (setq org2blog/wp-blog-alist `(("Blog1" :url "https://randomblog1.com/xmlrpc.php" :username ,(nth 0 (auth-source-user-and-password "Blog1")) :password ,(nth 1 (auth-source-user-and-password "Blog1")) :default-categories ("org2blog" "emacs") :tags-as-categories nil))
My former configurations did not work at all in Doom. But they did help me because I knew they worked I just needed to tweak them a bit. The majority of these configurations look similar to my congigurations in Spacemacs. Especially the parts with auth-source-user-and-password
. But notice that in the auth-sources
section I’m using .authinfo
. This is an unencrypted file, meaning my setup is not secure. But I was able to log in successfully and I knew how to get the .authinfo
file encrypted. Plus I needed to add all of my blogs to wp-blog-alist
.
So after a total of 14 hours of tweaking and troubleshooting I was finally able to come up with the following configurations that work!
;;(setq auth-source-debug t) (setq auth-sources '("~/.authinfo.gpg")) ;;--- org2blog settings --- (setq credentials-blog1 (auth-source-user-and-password "Blog1")) (setq credentials-blog2 (auth-source-user-and-password "Blog2")) (setq credentials-blog3 (auth-source-user-and-password "Blog3")) (setq org2blog/wp-blog-alist `(("Blog1" :url "https://randomblog1.com/xmlrpc.php" :username ,(nth 0 (auth-source-user-and-password "Blog1")) :password ,(nth 1 (auth-source-user-and-password "Blog1")) :default-categories ("org2blog" "emacs") :tags-as-categories nil) ("Blog2" :url "https://randomblog2.com/xmlrpc.php" :username ,(nth 0 (auth-source-user-and-password "Blog2")) :password ,(nth 1 (auth-source-user-and-password "Blog2")) :default-categories ("org2blog")) ("Blog3" :url "https://randomblog3.com/xmlrpc.php" :username ,(nth 0 (auth-source-user-and-password "Blog3")) :password ,(nth 1 (auth-source-user-and-password "Blog3")) :default-categories ("org2blog"))))
So yes after much trouble I was finally able to get org2blog
to work. I am able to log into all my blogs and post from Doom! I’m glad I made the switch because Doom is so FAST! It has my favorite theme preinstalled and now I have one of my favorite packages installed and correctly configured.