September 26, 2024

Trek to the mountainTrek to the mountain

Part Five of My Battles with Emacs

Still climbing this mountain.

The result: Stubbornness and joy.

Emacs is billed as the text editor which you can configure to your needs. It is undoubtedly configurable. I try to add some feature to it and everything goes to hell. It gives you the most cryptic error messages which I don’t understand. I go back to the previous version of the configuration or try some tweak and try it again. Sometimes it works. I dance around like a mad baboon with joy. Most of the time though I delete the section I added or set it to not tangle and leave a note for myself. They bug me. This is the only text editor I have ever tried where I find myself in bed at night contemplating the things I can try to make some addition work. I get up from bed. Go to the computer and try out the new tweak that I hope will work. It doesn’t. I am losing hair. My cat Squirrelly is not happy with me. My sleep habits are suffering. But I keep at it. That is stubbornness on my part.

I am 63 years old. I can still learn new things, I tell myself. I keep plugging away.

Decisions

I am going to violate one of the fundamental maxims of Emacs usage. I am not going to tweak my configuration for a while. There is a lot here and I don’t know most of it. The text editor works and I am going to use it. Try to learn what is already installed and some of the stock features which are available. Get familiar with the basics and then consider tweaking. For instance, I have given up my quest for typewriter scrolling in Emacs. I discovered that C-l brings my cursor and the text surrounding it to the middle of the screen. I will learn to live with that for the time being.

In no particular order, these are the other things I have done:

  • Dumped Denote. I have a file-naming convention which works for me. Not going to change that.
  • Tried out HOWM. Dumped that too. Too fiddly.
  • I am trying out Avy. Irreal recommends it and I wanted to see what that is about.
  • Tried out a package called Hydra. Made a nice little setup for Markdown. General.el does a good job for assigning keyboard commands to often repeated tasks in both Markdown and Org-mode and I don’t need Hydra to duplicate that. It is in the :tangle no zone at this stage. If I run into a compelling reason to come back to it, I might.
  • Wanted something that auto-saved documents when my focus moved away from Emacs. Found this worked:

#+begin_src emacs-lisp
(add-hook 'focus-out-hook (lambda () (interactive) (save-some-buffers t)))
#+end_src

#+begin_src emacs-lisp
(use-package osx-dictionary)
;; Key bindings
(global-set-key (kbd "C-c d") 'osx-dictionary-search-word-at-point)
(global-set-key (kbd "C-c i") 'osx-dictionary-search-input)
#+end_src

  • Sometimes I change my mind. I look at a section I have written and don’t think it fits or is right. I am using Palimpsest to move it to the bottom of the file. It keeps me from deleting sections I have written and gives me the opportunity to reuse it if I change my mind.

#+begin_src emacs-lisp
(use-package palimpsest)
(add-hook 'text-mode-hook 'palimpsest-mode)
#+end_src

This is the relevant keybinding: C-c C-r. Sends selected text to bottom of buffer.

  • Using simpleclip to get back the usual macOS keyboard commands for Cut, Copy and Paste. This bypasses the Emacs kill-ring but it is not a problem for me since it is incorporated in the Alfred clipboard I use.

Realizations

  • I used to write exclusively in Markdown. The markdown package for Emacs is fantastic. If I wanted to, I could stick to Markdown and let this package make my life easier. I wouldn’t miss much.
  • I am enjoying writing in Org-mode. I barely scratch the surface of all that it is capable of, but it is fun to write in and the process is virtually pain-free. It is scratching my itch or love for outlines. I love it so far.

Thanks

A reader who is in my age range wrote to me and commented on how he is using Emacs after a brain injury. He is making good progress into incorporating Emacs into his workflow. He provided the impetus to stick to this journey. Thank you.

Sticking closer to stock, finally made emacs click showed me that my frustration is shared. It made it seem less overwhelming to realize that there is light at the other end of the tunnel.

I will keep documenting this journey for a while and see how far I go with it.

macosxguru at the gmail thingie.

Thanks also to:

Photo by Sebastian Palomino


emacs


Previous post
Part Four of My Battles with Emacs It is not my fault. I blame Jack Baty for this. He goes on and on about how Org-mode has improved his sex life and given him purpose and direction.