Skip to main content leehalls.net

Dotemacs in Orgmode?

Looking back i think this may have been the better way to start a journey with orgmode and emacs. My dotemacs file was a mess of code i didnt understand, half tried packages and poorly written comments. If you’ve spent any time searching for emacs help and on orgmode/dotemacs etc then i’m sure you will have heard of literate programming.

There is a wealth of information on the subject for example on using python;

http://cachestocaches.com/2018/6/org-literate-programming/

or as to the point of this post;

https://www.reddit.com/r/emacs/comments/83usco/literate_emacs_config_in_orgmode/

I’ve slowly moved my entire config into a single orgmode file and a use-package setup, this has enabled me to have more understanding and a clearer idea of how it all fits together so i can craft an environment with the tools i want and yet still try new modules with minimal impact. The single biggest advantage for me was the simple utilisation of orgmode itself to add tags, headings, todo’s and quite literally and liberally sprinkle hyperlinks to package homepages, stackoverflow answers, reddit and so on.

What this has meant is that when something doesn’t work the way i expected i can easily trace where the idea came from, what i did to implement it and then followup with a check to see if others have suffered the same problems. One thing i did learn whilst transitioning was to delete the .emacs_d folder each time i made a major change for example getting helm to work was not straight forward for me. I’d enable different elements and the behaviour did not reflect what should have happened or it would work on first run but not subsequent. It was only in frustration i deleted the folder and re-started allowing use-package to download everything again when it worked.

So now my dotemacs file is called dotemacs.org and the top level headings resemble;

orgmode code snippet start

- About
- The dotemacs file                                                 :@system:
- Identify system info                                              :@system:
- Personal info
- Define package repositories & use-package setup                   :@system:
- set use-package for verbose mode
- install packages
- Set MOTD                                                           :@system:
- Backups                                                           :@system:
- My functions
- Miscellaneous settings                                               :misc:
- orgmode settings                                                     :@org:
- helm
- DONE yasnippet                                                       :misc:
- Security & encryption                                          :@security:
- things to look into
- Useful or interesting sites

orgmode code snippet end

if i narrow down to one subtree eg orgmode;

orgmode code snippet start

-  orgmode settings                                                    :@org:
-- setup org use-package and major mode as org everywhere
-- org log
-- define the org keys                                                 :keys:
-- set org agenda files
-- remove holidays i'm not interested in                             :agenda:
-- DONE org-super-agenda                                             :agenda:
--- home super-agenda setup                                        :personal:
--- work super-agenda setup                                            :work:
-- org-ql
-- encryption                                                     :@security:
-- org capture                                                      :capture:
--- clocking in/out of capture mode tasks                             :work:
--- personal org-capture templates                                 :personal:
--- work org-capture templates
-- ox-hugo                                                         :hugo:web:
-- org refile
-- org download
-- org publish
-- org-roam
-- ox-clip
-- org-babel

orgmode code snippet end

As you can see choosing literate style for your dotemacs really does pay off.