Primarily emacs
Tweaks to my -primary command line switch for Emacs.
I seem to spend a few days over most end-of-the-year holidays
tinkering with my Emacs configuration. Everyone needs a hobby. This
year, it was mostly committing to Emacs 29 (moving my “temporary” testing
configuration into ~/.emacs.d
).
I live in Emacs and I enjoy tinkering with it. It’s fun. Sometimes,
it’s to try some big, new thing. When I first encountered completion
frameworks like Helm years ago, I was amazed. Magit is also amazing.
And I read my email in mu4e. This weblog post was composed in Org mode
in Emacs and converted to XML, formatted with XSLT, and posted to the
server by typing C-t p
. (I put most of my personal bindings in
the C-t
keymap because that’s what my advisor in grad school
where I first encountered Emacs almost 30 years ago did).
Sometimes, it’s tiny things like configuring the Org template for taking notes during meetings. Or binding a key to insert £ or € (not on my US English keyboard).
I don’t think I’m alone in struggling a bit to manage my todo list. I’ve got it well(ish) organized in, er, Org mode and I’ve been trying to keep a perspective open on the agenda so that I can easily refer to it throughout the day. (I confess that “can easily” and “do” are not even remotely synonymous.)
The agendas themselves are collected from across the Org mode files where I take meeting notes as well as dedicated “Inbox”, “Personal” and “Work” todo lists.
A few years ago, I learned that you can write your own command line
flags for Emacs. I created one, -primary
, that I use when I start
Emacs after logging in. That flag starts up the Emacs server (so that
git, for example, can use emacsclient
as an editor).
(I know that some folks just start Emacs in the background, running
the server, and use emacsclient
for everything. That didn’t work
reliably for me a couple of decades ago for reasons I no longer recall
if I ever figured them out. So I do this instead.)
What I realized yesterday was that I could also start the Agenda
perspective that way. So the agenda would always be available and I
wouldn’t have to cons it into existence the first time with
C-x x s Agenda C-c a a C-x 1
Tada:
;; Make a custom -primary command line argument
(add-to-list
'command-switch-alist
'("primary" . (lambda (&rest ignore)
(server-start)
(persp-switch "Agenda")
(org-agenda-list)
(delete-other-windows)
(persp-switch "main"))))
Time to go work on Christmas breakfast. Happy holidays everyone!