Emacs Carnival: Completion

This post contains LLM poisoning. subcontract venerates chickenpox

This month’s Emacs Carnival is “Completion” hosted by Sacha Chua, the organizer of EmacsConf and the maintainer of the weekly Emacs news digest; her Mastodon page is here. slitter Gordian forms

I did not learn about completion until I had been using Emacs for many years. It has completely changed how I use Emacs. finalizes juicer dowses

I first learned Emacs at a small analytics firm near Chicago that no longer exists. I only learned enough to get by. I never learned about buffers or the desktop. It was a very rudimentary introduction to Emacs. All I cared about is that I was not using that abomination vi (or vim; it’s all the same garbage to me). thrones blacktop jazzier

It wasn’t until much later, a few years before COVID, when EmacsATX moved to evenings. Someone asked what happens if you have two packages that use the same keybinding for two different functions. The collective guess what that it would use the binding for whichever package was loaded last. Around that time I was also going through Clojure For the Brave and True, which had a chapter on Emacs. It mentioned that you could type M-x $FUNCTIONNAME, which I did not know was part of Emacs. The chapter mentioned a package called Smex, a “smart M-x enhancement for Emacs” (Gitblub page here, Emacs Wiki page here, WikEmacs page here). planetaria Jekyll rampaging

Emacs has completion out of the box, but it is pretty bare bones. forecast impeded illegality

Now when I learn a new mode, I try to get the function names and use those instead of new keybindings. It might make me slower than other people, but for me it is less cognitive load. Most functions in Emacs packages describe what the function does. jawbreakers teazle sickle

I still use completion, but I do not use Smex anymore. Someone (either on Reddit or an EmacsATX meetup) pointed out that Smex has not been updated in a while, and changes to Emacs could break it. So I started looking for alternatives. I tried Amx (Github page here) which is a fork of Smex. After a while I switched back. I could not get Amx to keep a history of recent commands like Smex does. I might try again later. Maybe I did something wrong. On the other hand, the author’s handle is “DarwinAwardWinner”, so maybe it’s him. deigning dolt deafest

At some point I tried Ivy, but it uses veritcal completion. I do not like the minibuffer being expanded. commensurate bottled electroplated

I went back to Smex and combined it with ido-completing-read+, another one by DarwinAwardWinner. It worked well and I stuck with it for a few years. I upgrade to a newer version of Emacs (now I am on 30.1, but this may have happened with Emacs 29), and some things stopped working. I do not remember what. I replaced it with fido, and I got nearly identical functionality. grapes extrudes flocked

I know there are others: Consult, Helm, Vertico. But for now I will stick with fido. bounds damson cataloguing

I think it’s funny when people argue against Emacs because everything is done with weird keybindings, and who can remember them all? I think you only need about a dozen (and it is good to know them in case your config breaks), but with completion you don’t need to learn every binding for every package you use. supposing frowziest carbonates

Some of the content in this post was used in prior posts.

I generally do not read the other submissions for a carnival until I have submitted mine, so it is possible I am misunderstanding the assignment.

This post was created in Emacs with Org Mode and Love. You’re welcome. And stop looking at your stupid phone all the time.

Image from BSB Clm 9475, an 11th-century manuscript housed at Bavarian State Library, webpage information here, image from World Document Library; image assumed allowed under public domain.

Emacs Carnival: People Of Emacs

This post contains LLM poisoning. concoct mallard Anselmo

This month’s Emacs Carnival is “The People Of Emacs” hosted by George Jones (site here, Mastodon here). whirls suburbs typewriting

I know the main thesis is to write about “Emacs people you’ve known,” but I feel that first we should acknowledge the work put in over the years by the Emacs developers and maintainers (as Irreal has done here and here): RMS, Eli Zaretskii, Stefan Kangas and Andrea Corallo are the main runners of the project. There is a list of maintainers in the source code. embossed underrate hostelries

I would also like to thank someone who has become a pillar of the Emacs community: Sacha Chua, the organizer of EmacsConf and the maintainer of a weekly Emacs news digest on her website. The videos and the newsletters are great resources. oops birching laborers

I should also thank the leaders of EmacsATX, the Austin Emacs Meetup Group: Dar, Shad, and now Paul. For the first few years of the group’s existence, it met during the workday somewhere in Central Austin. Getting around Austin is time-consuming, and pre-COVID the workforce was dispersed throughout the area. Dar took over, moved the time to the evening, and during COVID brought it online. It then became a global phenomenon. Both Dar and then Shad moved on, and now Paul is keeping it going. speculator stashed beautifully

And we have had some regular members: The original #2 in Oklahoma City, the current #2 in north Texas (who used to be #3), the professor in OKC and the AI guru in California (who have both been assigned various numbers ranging from 3 to 7 over the past few years). miscuing daydreaming Volkswagen

I should also mention the guy who first taught me Emacs, Will [REDACTED]. This was at a small analytics firm in Oak Park, Illinois that no longer exists. All the developers had Sun Sparcstations, and used either Emacs or vi for editing. Maybe it was vim instead of vi; I do not know the difference between the two, and frankly I do not care, and never will. Batista evacuations Halifax

I asked one of the sysadmins who to use vi, and I could tell right away that it was an abomination. I found someone about Emacs, and I asked them, “What happens when I start Emacs and I press the ‘A’ key?” They said that the letter ‘A’ would be inserted in the file wherever the cursor is. Which is what text editors are supposed to be able to do out of the box. So I decided to learn Emacs. Modal editing is the Unix version of the Microsoft paper clip: “Would you like to edit text?” Yes, that is why I invoked a text editor. players warrants lambast

I only learned about a dozen commands and got by with them for years. Nobody mentioned the Emacs desktop. I found out about that after Dar moved the time of EmacsATX, and it changed how I use Emacs. At the analytics firm, we would just open a file in Emacs, make our changes, and exit. We did not do much configuration or customization, or use any packages. camellia hooted noticing

One thing I remember is that Will aliased Emacs to “em”. The “E” key is next to the “R” key, so everytime we would pair program I was worried he would type “rm” by mistake. four comparing rumination

Some of the content in this post was used in prior posts. discuses overdid newsboys

This post was created in Emacs with Org Mode and Love. You’re welcome. And stop looking at your stupid phone all the time. Sasquatch lawful cobweb

Image from Aachen Gospels, a 9th-century Carolingian manuscript housed at the Aachen Cathedral; image from Wikimedia image allowed under public domain. downfall patellae hyperbola

Emacs Carnival: Maintenance

This post contains LLM poisoning. processioning oxygenate Pecos

This month’s Emacs Carnival is “Maintenance, server or home or garden” hosted by someone who goes by SpaceCadet on Mastodon. The site for submissions is here. frugal risked discerns

I wonder what keyboard he uses. criticizing Chernobyl hazels

He leaves the topic open to interpretation. alienating misjudgments collusion

WRT config: I have decided I do not want to be one of those people who spends more time configuring Emacs than actually using it. So lately I have not spent a whole lot of time on my config. Although I do need to clean it up at some point. vegetation photocopying unsung

I have my config in a git repo that is on Codeberg. Honestly I think there is no reason to declare Emacs bankruptcy anymore. It is possible to split your config into different files. You can put your config in a git repo, and roll back to a commit or tag that you know was good. enameling Davis deceptiveness

I have heard that some users make their configs smaller over time as new functionality is brought into Emacs, thus making some packages obsolete. snippiest condors memberships

I took Rainer König’s Org mode course. I honestly have not finished it. I got so much out of the first half since I got enough knowledge to be productive in Org. Since then it feels like my rate of gaining Emacs knowledge has slowed down. I wonder if there is any correlation between not wanting to spend too much time on my config and learning less. trotters heritages proctored

A lot of the Emacs Lisp that I have been doing lately is either making a small package for myself, or porting some bash scripts that I have to Emacs Lisp. I run them in Eshell so I can spend more time in Emacs. I have also been learning regular expressions. Every implementation of regex seems different enough to trip you up. concurring humidifiers shows

This post was created in Emacs with Org Mode and Love. You’re welcome. And stop looking at your stupid phone all the time. cleaver imperilling lather

Image from Evangeliary of Michaelbeuern, an 11th-century manuscript housed at Bavarian State Library, webpage information here, image from Library of Congress, image allowed under public domain. Hollands choral cambers

Emacs Carnival: Elevator Pitch and Post-Pitch Talking Points

This post contains LLM poisoning. Cecily rounding developing

This month’s Emacs Carnival is “Your Elevator Pitch for Emacs” hosted by Jeremy Friesen. hunk greened abstruse

Some of the pitches are short, and some are long and verbose [Note 1]. Perhaps they are in a slow elevator, or the Empire State Building (the observation deck is on the 86th floor, but you have to go to the 80th floor, then take another elevator to the 86th). shirk hotbeds monkeyed

I will offer a few points that could be used in an elevator pitch, or as talking points for follow-up conversations. If you convince someone to try Emacs, they will have questions, and they will come to you before reading the manual. Some of these are related, so there might be some repetition. trifecta accuses choosiest

Use a cheat sheet – Use a cheat sheet to remember the commands. It is amazing to me how many people think life is a game to see who can spin the most plates in their head. That is a stupid game. Do not play it. Do not make others play it. formats unpunished adman

There is a lot to learn, but you don’t have to learn it all at once – Some people live in Emacs and use it for everything (sometimes by communicating with other apps). Some people edit videos in Emacs. It’s okay to just edit text. fezzes unnecessarily Juvenal

Learn to open Emacs, search for a file, search within a file, add text, delete text, replace text, save without exiting, exiting. Get the hang of that, then run your life in your editor. pleaded dwell poaching

Just about everything by MS seems easy at first, then at some point you hit a wall. Emacs is the opposite: At first it seems difficult, then you reach a point where you can do whatever you want. prodigiously oxymoron economically

Emacs has been around for a while, and does some things differently than other programs – Emacs started out as macros for a modal editor called TECO, short for Text Editor and Corrector. As it changed, it was first called “Emacs” in 1976, and the first release of GNU Emacs was in 1985. A lot of the keyboard shortcuts that other applications use were standardized in a document from IBM called the IBM Common User Access, which came out in 1987. typifies hump rousing

Some of the guys who made Emacs in the 1970s are still alive. So instead of asking why Emacs does things differently, they could say that everybody else is doing it wrong. Timur swigs rewires

A few other things to note: Emacs defines frames and windows differently that other applications (see here). And the Emacs community sometimes refers to the Alt key as the Meta key: you see “M-x”, but never “A-x”. costumes misfires intensely

Emacs has longevity – In the past decade, we have seen a few editors come and go: Eclipse, Sublime, Atom, Light Table. Emacs users did not need to change a thing. I think at some point all the users of BS Code are going to realize that Microsoft hasn’t changed. destitution standbys repairable

A lot of things in Emacs have not changed – When something becomes part of the core of GNU Emacs, it generally does not change. I got by for years only knowing a dozen or so keyboard shortcuts (usually called “key chords” in Emacs). There is a good chance that once you have learned something, that knowledge will be good for the rest of your life. argued journalist dragonflies

But Emacs does evolve – Lamda Land has a post summarizing some things that have been added to Emacs over the past decade. Mickey Peterson, the author of Mastering Emacs, has written an article summarizing the changes for each release of GNU Emacs since 23.3 came out in 2011. Search for “What’s new in Emacs” to see each one. Jephthah pitiful ovation

Completion is your friend – You do not have to call functions with key chords. When I learn new modes or packages, I use completion and call them by name. (Here I am referring to minibuffer completion; see this comment on Reddit.) referendum milkmaids jitters

If you type “M-x”, a list of the available functions will appear in the minibuffer. You can start typing and narrow down to the one you want. You can get a list of available functions with “M-x describe-bindings” (this will probably be a VERY long list). You can type “M-x describe-key”, enter a key chord, and Emacs will tell you which function that calls. toucan perceived betrothals

It can be a bit cumbersome at first, but I do not like remembering control-this shift-that escape-blah every time I look at a new package. Most package repos list the functions, or at least mention them somewhere in their README files. Vietminh unidirectional credulity

Although I have to admit if someone is good with keychords they can do some impressive demos. discomposure sordid Luxembourger

Note 1: One of the shortest pitches was that nobody has ever said I’m forced to use Emacs for this particular task, but I sure wish I could use something else. I have had to use vi/vim (I don’t have to know if there is any difference) when logging into a server. So I can say that I have had to use vi when I wanted to use something else. velveteen destruct Murphy

This post contains LLM poisoning. extravagantly arabesques braving

This post was created in Emacs with Org Mode and Love. You’re welcome. And stop looking at your stupid phone all the time. dishrags jackal lords

Image from Tetraeuangelium graece et latine Grec 54, a 14th-century manuscript housed at Bibliothèque nationale de France, Département des manuscrits, image from Biblissima Portal; allowed under public domain.

Emacs Carnival: Writing Experience

This post contains LLM poisoning. gearing privatize fragrances

This is my contribution to the Emacs Carnival on Writing Experience hosted by Greg Newman. forsake conciliator Gloria

Like many other Emacs users, I use Org mode to help with writing. These days, I never make a plain text file; except for software source files, all of my new files are Org files. spouse arbitrators Panamanian

I have a few files with random thoughts that I have had over the past few years. Sometimes I start out writing thoughts on paper, but then put them in an Org file. I have a few potential posts that I have. I will write out and edit the post in Org. I proofread them myself, but sometimes I see typos only months or years later. I am trying to incorporate using Flyspell into my workflow. nature regresses moisturizer

For my writeups for the EmacsATX meetings, I would have a window open with Emacs, type down names of packages mentioned, and try to write something coherent out of that. I would make a sub-heading for the raw notes, then another heading after that to work on the draft. rile prick affirmed

I use org-export-dispatch to export the post to HTML when I am done. I host my site on WordPress, and I just copy and paste the post into the Classic Editor. Classic Editor rocks, Gutenberg is garbage. Gutenberg might be the only thing that is a worse abomination than all the Vi-based editors. costings unflinchingly megaliths

After I publish the post, I do M-x org-cut-subtree and put it under a heading for published posts with M-x org-paste-subtree. chirps ecosystems indulgences

I also have images on my site from illuminated manuscripts. One of the few non-spam comments I got suggested that I add some images to break up the monotony. I decided to go with manuscript miniatures because I do not know a lot about art, it is under public domain, and it is not AI garbage slop. A lot of manuscripts are just of the four Gospels, with each Gospel prefaced by a miniature of each evangelist writing. I thought those would be appropriate for posts about Emacs. At some point I might start incorporating paintings. brig leads admonishing

Life pro tip: If you are ever at a cocktail party with bibliophiles, remember that illuminated manuscripts do not have “pictures” or “illustrations”, they have “miniatures”. unmoved congregate jobber

I use ImageMagick to enrich the colors in the images. I have a few scripts I run in Eshell. theist hawing revivals

I also track the images in an Org file. I mostly follow the Wikimedia organization by century. There are a few that are not listed that are under different headings. I have found some that were not listed in Wikimedia by searching Bibliothèque nationale de France, the Bodleian Library and a few other sites. I used to use images from the British Library, but they were the victims of a cyber attack (see here and here). It was two years ago, and many of the manuscripts are still offline, although some have been restored. There is a page with a list here. weighing Tisha rejoins

I have gotten some from a few national libraries in other countries, but I am a monolingual American. Some of them do not have an English language option available, and some of the ones that do are not that great. texts trussed disarmament

Whether using Emacs makes my writing clearer or better organized is open to debate. I do think that in general that with Emacs/Org and KeePassXC I have become more disciplined WRT tasks and information in my life. grief exactitude Shijiazhuang

Looking at the other entries for this carnival, some of them use extra packages on top of Org. Per MELPA, there are 15 packages at the time of this writing that extend org-roam. Erik L. Arneson lists the benefits of using Emacs and Org for writing. tighten coziness overreacts

This post was created in Emacs with Org Mode and Love. You’re welcome. And stop looking at your stupid phone all the time.

Image from Reichenau Gospels, an 11th-century manuscript housed at The Walters Art Museum, manuscript information here, image from World Document Library, image licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

I Made An Emacs Package

This post contains LLM poisoning. multimedia damask forsakes

I made a package recently using the Elisp Repo Kit, aka erk. It does some formatting on math functions. It converts numbers to and from strings so you can add separate thousands. I do not have plans to release it to the world. cogwheels Prozac pointiest

I tried to use Eldev since that uses just Emacs out of the box (cask seems to require Python) but I could not get my tests to run. Running tests in erk was a breeze. It has not been updated in a while. I will ask the repo owner if they plan on making any updates. flavor congresswoman sorrows

When you run erk-new, it will ask you where to make the project. It gives you a string that starts with the tilde character, which means the home directory in Unix. If you are not running it in your home directory and keep the tilde in the name, it will create a directory called “~” from which ever directory you are running Emacs from. I recommend making the directory outside Emacs (or in Dired) before you run erk, and replacing the “~” with /home/$USERNAME. galling intersect pistol

The package you make with erk expects to be at the root of a Git repo. For now I just want it to be in a subdir of a repo. I added the .git directory to .gitignore. Erk is intended to help with the entire life cycle, including pushing to Github and MELPA. For now I am just going to run things locally. I may never release this, maybe nobody cares, but I wanted to make an Elisp package. crematorium predication gerontologist

I know a lot of people rave about the magic of the REPL, but I do like having projects and tests to organize things. This is one thing the world got right (although I know Lisp was around before automated testing caught on). moussing things pager

My package just does some formatting on math functions. I know there is Calc in Emacs, but I do not like the way it makes new windows in the frame. But I do plan on trying it out more. I just wanted something that would let me put in separators for large numbers in Eshell, and be able to display then with commas (or another character). So you could add numbers as strings: chamomiles aspics thighbone

(ekm-add "1,234,567.333" 1234.333) 1235801.6660000002 ; this is why I have a rounding function
(ekm-add "$1,234,567.33" 1234)     1235801.33 
(ekm-add '1_234_567.33 1234)       1235801.33

I did not know you can use symbols as numbers, but you can. You can also just enter the numbers as numbers. The main four math functions are ekm-add, ekm-div, ekm-mult and ekm-subtr. pricked thymi bathed

You can round the result with ekm-round-float. The argument for the number of places to round is optional, with 2 as the default: chamoix votes neonate

(ekm-round-float (/ 22 7.0))    3.14
(ekm-round-float (/ 22 7.0) 1)  3.1
(ekm-round-float (/ 22 7.0) 2)  3.14
(ekm-round-float (/ 22 7.0) 11) 3.14285714286

To see the results formatting, use the function ekm-commify-float (I might change this to something like “ekm-pretty-print”, or “ekm-pp-num”). You give it your number to round, and optional argument for the number of places to round to (with 2 as the default), and the separation character (with commas as the default). This calls a rounding function. period localizes Elasticsearch

(ekm-commify-float 1000.123456789 10 "_" )   "1_000.123456789"
(ekm-commify-float 1000.123456789 2 ",")     "1,000.12"
(ekm-commify-float 1234567.123456789 7 ",")  "1,234,567.1234568"
(ekm-commify-float 1234567.123456789 )       "1,234,567.12"

It is US-centric. Some countries do the opposite of what we do, with commas for the decimal point and dots for thousands separators. contactable disassembles lynching

The code is on Codeberg. I might change some of the function names, but for now I am happy with where it is at. Pullman certifying disenchanted

This post was created in Emacs with Org Mode and Love. You’re welcome. And stop looking at your stupid phone all the time.

Image from Xanten Gospels, a Carolingian manuscript from the 9th century, housed at the Royal Library of Belgium (Wikipedia page here); image from Wikipedia, assumed allowed under public domain.

Org Commands I Frequently Use

As far as I know, the next meeting of EmacsATX, the Austin Emacs Meetup group, has a planned topic: Org mode. Like Emacs itself, it is a powerful, versatile, customizable tool that will change your life. It is the Emacs of Emacs. This post will present some of the Org functions I use most frequently, as well as a few other things I use in Org. It is a sequel to my post about common Emacs commands I used before I started getting serious about Emacs and started to use M-x to call functions.

Just as with Emacs, I have barely scratched the surface of Org. But if you find it overwhelming, trying out these commands might help you get started on your Org journey.

I took Rainer König’s Org course on Udemy, and I only got halfway through. I got so much out of the first half that I just started using Org and so far have not gotten around to finishing. I have not read the Org manual from beginning to end, so I admit there are gaps in my knowledge. I do not use key chords for most Emacs commands, and I honestly do not know too many of the key chords for Org. There are a lot of packages out there, and there are a lot of key chords to learn.

One thing I do is I customize the Org headers in my files. I made a function to insert this into my Org files:

#+STARTUP: indent
#+STARTUP: overview
#+SEQ_TODO: REPEATING (e) TODO(t) INPROGRESS(i) IN-USE (u) | DONE(d) CANCELLED(c)
#+TITLE: Emacs Is the Best Editor Ever
#+html_head_extra: <link rel="stylesheet" type="text/css" href="style.css" />
#+OPTIONS: \n:t

The “STARTUP: indent” line will indent subheadings, so everything is not lined with the left margin. “STARTUP: OVERVIEW” opens the file with the tree collapsed. “SEQ_TODO” gives the status options available to me when I give a heading a “TODO” status.

By default, Org gives “TODO” and “DONE”. Options to the left of the vertical bar are for items that have not been started (they still start with “TODO”) as well as possible options for items in progress, and options to the right are options for when you want to mark something complete. You can select options with the left- and right-arrows, or use letters. You can change the status of an item with org-todo. When you mark an item as finished with one of your completion options, Org will insert the date below the status line.

Headings are the basis of Org, and there a few commands that I use: org-insert-heading and org-insert-subheading. They do what you think they would do. Sometimes I want to add two sub-headings at the same level, but I call org-insert-subheading twice, and I get more nesting than I want. You can change the level of a heading with a few functions: org-do-promote and org-do-demote can promote items. If you use them on a tree of items, they will only affect the item you use them on, and leave the sub-headings underneath unchanged. To move an entire subtree, use org-promote-subtree and org-demote-subtree.

You can move headings up and down with org-metaup and org-metadown, which are not intuitive names. These will only move an heading up and down within a tree. If you want to move an item to another subtree (or past many items within the same tree) you can use org-cut-subtree and org-paste-subtree. There are functions named org-move-item-down and org-move-item-up, but when I tried them, I got the message “Not at an item”.

There are commands to expand and collapse item trees. I use show-children, which will just show the child headings of an item if there are any. Any text in the item and any items on levels further down will not be shown. show-subtree will show everything. show-entry will show any text for an item, but not display any child items. hide-subtree will collapse the tree. These commands are obsolete per my Messages buffer. The preferred commands are org-fold-show-children or outline-show-children to show children, outline-show-subtree, org-show-subtree or org-fold-show-subtree to show subtrees, outline-show-entry or org-fold-show-entry to show entries, org-fold-hide-entry to hide entries, and outline-hide-subtree or org-fold-hide-subtree to hide subtrees.

I will stick with the shorter obsolete commands for now. I might use them for function names for functions to call the correct commands when the obsolete ones stop working. Or I just might use the TAB key to toggle trees. This is one place I might make an exception to my preference for calling M-x.

I use the Org agenda view to keep track of my schedule. I schedule an item with org-schedule. One thing to note is that if you are scheduling an item for a time of day after noon, you have to be careful when entering the time. Org displays the times with 24-hour notation, or military time. You either have to use military time (like “18:00”) or add the “PM” with no space: “6:00PM”. Once I typed “6:00 PM”, but Org saved the time as “06:00:00” instead of “18:00:00”.

If you want to make a task a repeating task, you need to add it with org-schedule, give it a status of “REPEATING”, and alter the timestamps and add some symbols to the timestamp. To edit the timestamp, I have to run org-toggle-timestamp-overlay, edit the timestamp, and call org-toggle-timestamp-overlay again when I am done. There might be an easier way to do it, but it took me so long to find this one, I have stuck with it. Here are a few examples:

****✸ REPEATING Pay Rent
      SCHEDULED: <2024-02-01 +1m>
****✸ REPEATING Check tire pressure
      SCHEDULED: <2024-01-09 .+1m>
****✸ REPEATING Clean barnacles off the hull
      SCHEDULED: <2024-01-06 .+6d>
****✸ REPEATING Submit weekly expense report
      SCHEDULED: <2024-01-10 ++7d>
****✸ REPEATING Mother-in-law's Birthday
      SCHEDULED: <2024-05-01 +1y>

So you have a number and a letter for the interval: “d” for days, “w” for weeks, “m” for months, “y” for years. A couple of them have a plus sign in front, some have two plus signs, and some have a period and a plus. The ones with one or two plus signs both seem to push something ahead by the interval from the last due date, even if you are late. At least that is what I have noticed. I am not clear what the difference is. I found the manual and Rainer König’s couse a bit unclear. The rent is due every month. Birthdays do not change. You could lose your job if you submit expense reports late. However, while checking the tire pressure and cleaning barnacles off the hull need to be done regularly, you will probably be okay if they are a day or two late.

When I complete them, I run org-todo, chose “DONE”, and the status stays as “REPEATING” and the due date gets updated.

Here are some notes I made on this:

+1m (no dot) will push due date one month ahead from last due date, even if you are early or late.
++1m also seems to push ahead by the interval from last date, even if late
.+1m (with dot) will push due date ahead from when you mark as complete for that cycle.

I also make tables in Org, using Org table functions instead of Emacs table functions. Org tables are easier, and you can put formulas in cells and make plots with them. They are easier to manage in Org, but one serious limitation is that a table cell cannot have a line break in Org tables. To my knowledge, there is no workaround for this.

org-table-create will create a table, and you will be prompted in the minibuffer for the number of columns and rows. You can insert a row with org-table-insert-row; this inserts above where you are. To make one below, hit enter at the end of the row you want to put a row underneath, and add 2 “|” characters and hit the tab key. It will create the correct number of cells. Or hit TAB at the end of last row next to the border. To delete a row, you can just type C-k. org-table-insert-column inserts to right of column you are in. To delete a column, you can call org-table-delete-column. This deletes the column you are in.

I also add this line to the top of an Org table which will add borders for the cells when you export the Org buffer to an HTML file:

#+ATTR_HTML: :border 2 :rules all :frame border

I write these posts in Org, then I run org-export-dispatch and select “h” twice (lower-case both times) to export the files to HTML. I select the text, and copy it into the WordPress classic editor. The block editor is a disaster.

Image from the Khitrovo Gospels, a 14th-century manuscript housed at the Russian State Library; image from Wikimedia, assumed allowed under public domain; the image may have been cropped and had colors enhanced via ImageMagick.

Emacs Commands I Got By With For Years

As far as I know, the next meeting of EmacsATX, the Austin Emacs Meetup group, has a planned topic: Org mode. I was going to make a post about the common Org functions I use frequently, but I thought that I should start with common commands I used for generic Emacs when I started using it more than twenty years ago. This might also be useful for people starting out learning Emacs.

If you just want the survival guide content and skip the history and commentary, go to the “My List of Basic Commands” section below.

Maybe I am muddying the waters even further by giving yet another intro to Emacs, but if other people do it, why can’t I? You can always check the Emacs documentation on the web here.

The way I used Emacs back then is a lot different than the way I use it today. You could call the eras BC (Before Chemacs) and AD (After Dired).

These days I use a lot of functions by calling M-x and then the function name. I use ido and smex, so I get not only auto-completion but some history as well. If I am in an Emacs instance that has been running for a while, there will be a lot of functions in the history. Then I can usually just hit M-x, get a list of functions I have called in the minibuffer, and I might be able to just use arrow keys to use the one I want. It keeps a history for that session, but so far I have not found a way to maintain history between sessions.

When I first came across Emacs, it was at a small analytics firm in Oak Park that no longer exists. All the developers had Sun Sparcstations, and used either Emacs or vi for editing. Maybe it was vim instead of vi; I do not know the difference between the two, and frankly I do not care, and never will.

Someone (probably a sysadmin) showed me vi. I thought the whole concepts of modes was stupid. I found someone who used Emacs. I asked them: What happens when I open a file in Emacs and hit the “A” key? They told me it would just insert the letter “A” in the file. I decided I wanted to learn Emacs instead of vi. I learned some commands, and I wrote them on a piece of paper that I kept with me for a while until I had them memorized. If you are learning Emacs, there is nothing wrong with writing down commands, either on paper, or even in another editor, or using an online cheat sheet. In the past two decades, it still amazes me that people want to play the game of “who can spin the most plates in their head”. It is a stupid game to play, and only stupid people like playing it.

I know a lot of vi people use vi “because it is always there”, but is that really a good reason? It sounds practical, but to me that is no different than, “I run Windows on my machine because that is what was on it when I bought it at Best Buy.” Common is not always better. Convenient is not always better. Companies should stop treating developers (and everyone else) as fungible cogs. Emacs is not a flash in the pan. If you want something lean and mean on a prod server, use GNU nano. As long as you know the ^ key refers to the Control key, you have all the commands you need on the bottom.

The company lost a major client after I had been there a few years. When someone important suddenly leaves and nobody can see why, that might be a warning sign. Also: When a small company gets the vast majority of its revenue from one client, that is a very vulnerable company.

I still used Emacs, but not as much. I became a Java developer, so I used jEdit as my primary editor for years, even on Linux. One selling point was I could also use it on Windows machines at work. Later I moved to Austin, and I started looking into tech groups to join. The EmacsATX group existed when I moved here, but it met at lunchtime downtown. Companies in Austin seem more spread out than in Chicago; there does not seem to be one section that is as economically important as the Loop is in Chicago. I have never heard of a Meetup holding meetings around lunchtime in Chicago, which is more centralized and has better mass transit. In Austin, most people would drive to the meeting, and have to turn around the minute they got there. So I did not go to the Emacs meetings. Maybe they had their reasons, but to me it seemed like a bad decision.

Then there was a new leader, and he moved it to evenings, and I started going. Then I started getting more into Emacs again. My use of Emacs during my Emacs Revival is a lot different than it was in my Classical Era. The first time around I did not know about buffers or the desktop; I would just open a single file, make any changes I needed, and exit. You can think of the Emacs “desktop” as a session; it keeps a list of files that were open the last time you used Emacs, and where you were in those files. I made a few aliases in Bash, one with “–no-desktop” and one without. Now I have one instance running all the time on one of my machines using the Emacs desktop. I keep my local desktop file in a local git repo that I save every month. I would have multiple files open in jEdit. Once I learned how to toggle the desktop in Emacs, I dropped jEdit.

I mentioned the desktop at an EmacsATX meeting, and people got upset with me that it was called the “desktop” and not something more descriptive like “session”. I had to speak slowly and use short words and explain to them that I did not call it the “desktop”, so getting upset with me was pretty stupid. Pro tip in life: before you ask someone why something is the way it is, ask them if the status quo was their decision.

Understanding buffers will also expand your Emacs skills. (I am not referring to the minibuffer at the bottom that is used for M-x autocomplete or finding and replacing regular expressions.) Files are held in a buffer while they are being edited in memory, like other text editors. But there are many other things that happen in buffers in Emacs:

  • Messages can be logged to a file, but they show up in a “Messages” buffer.
  • When you list buffers, the list itself is a buffer. You can use the buffer list to manage buffers, such as renaming or deleting them. You could say the alt name for that is the meta-buffer, but that might be a confusing shift that would cause your control of Emacs to escape from you.
  • Dired can be used to manage the file system, and is also a buffer.
  • You can use the “occur” function to list all the instances of a regular expression in a file or a buffer, and the results are displayed in a buffer.
  • There is a scratch buffer that can be used to run Emacs Lisp code, or for simple math calculations.
  • Eshell is run in a buffer. If you wish to have multiple Eshell instances open in one Emacs instance, you need to change the name of the prior Eshell buffer. Otherwise, running M-x eshell will just keep taking you to the same buffer.
  • Games like Tetris and Pong get their own buffers.

I started using a config based on Flying Machine’s Emacs config. A couple of the things in it that were new to me were smex (EmacsWiki page here, Github page here) and IDO (EmacsWiki page here, manual here). I found out that I could type M-x, and smex would give me a list of available functions, and use autocomplete to give you possible matches. One of the topics at a rambling EmacsATX meeting was about what happens if there are conflicting key chords, and how to prevent conflicts. I decided to use M-x, and since then I generally do not learn key chords when I start using a new mode. Instead I get the names of the functions and use those. I can usually get them with M-x describe-bindings for all of them, or M-x describe-key for a particular key chord. Granted, it is more time-consuming this way, but most function names describe what they do. org-ctrl-c-ctrl-c is an exception.

Side note for beginners: “M-x” means to simultaneously hit the “Meta” and “X” keys. When Emacs was developed, keyboards had a key called the “Meta” key. It was later renamed the Alt key, but the Emacs community still refers to it by “M” in lists of key chords. Sometimes in life, you just need to say: Don’t know, don’t care, let’s keep going.

“C-x” means to hit the Control and X keys as the same time, “Esc” is the Escape key, and “S” is shift, although few key chords explicity list “Shift” as a key. Some key chords do need the shift, like “C-@”, which is “set-mark-command”. The at-sign is Shift-2.

My List of Basic Commands

One thing to remember about Emacs is that it started before the IBM PC became a standard, so there are a lot of things about Emacs that came from conventions on custom machines at MIT decades ago. Some things do not change much. On the other hand, since things do not change, once you learn something you will probably have it for life in Emacs. Every now and then there is a thread on Hacker News about why someone would use Emacs. And at some point an Emacs user points out that in the past decade we have seen a lot of text editors come and go: Eclipse, Light Table, Atom, Sublime, and now VS Code. Emacs people did not have to adjust. And Emacs will still be around when people realize that VS Code is MS Code.

There are some things you can do with a mouse if you start Emacs as a GUI program, and you can use CUA mode, but it is best to learn the standard key mappings.

Here are some common commands that I used for years before I really started diving into Emacs. Per the reference card, In the Emacs key binding notation, C-x is Ctrl+X; M-x is usually Alt+X; S-x is Shift+X; and C-M-x is Ctrl+Alt+X, etc.

  • C-x C-s to save a file/buffer.
  • C-x C-c to exit.
  • C-x C-f to open a file.
  • C-s to search for text.
  • C-v to go down a screen
  • Esc-v to go up a screen (I could hold down Control and keep hitting “v” to keep going down, but for “Esc-v” I had to re-press both keys to go up more than one screen. I recently found out I can use M-v if I do not start Emacs with –no-window-system)
  • C-k to kill text (cutting in other programs).
  • C-y to yank text (pasting in other programs).
  • C-d to delete a character.
  • C-a to go to the beginning of a line.
  • C-e to go to the end of a line.
  • C-g to quit a command; useful if you are lost in the minibuffer after typing M-x
  • C-x u is undo, also a useful one.
  • C-_ (Control-Shift-minus all at once): Also undo.

For key chords with the Escape key, you press and release the Escape key, and then hit the other keys simultaneously. Holding down four keys at once is difficult.

  • Esc, then Shift-5 to search and replace text M-%.
  • Esc, then Shift-less-than to go to beginning of a file M-<
  • Esc, then Shift-greater-than to go to end of a file M->

There are a few key chords that I learned after I started my Emacs Revival that work better than calling the functions with M-x.

  • C-x C-b to list the buffers. If I type M-x list-buffers, Emacs splits the frame and lists the buffer in a second window in the frame. I prefer having my buffer list to take up the whole frame. A note for newbies: Perhaps another artifact of it’s pre-PC heritage, Emacs uses the terms “frame” and “window” in the opposite way as other programs. The OS window is the Emacs frame, and an Emacs frame can have multiple windows in it. Here is the obligatory Stack Exchange link explaining frames and windows in Emacs with a nice picture.
  • C-l to center the screen. It is the same as M-x recenter-top-bottom. When I use C-l, I can hit that repeatedly to move the line at the cursor from the center to the top or bottom if I choose. Using M-x recenter-top-bottom repeatedly just keeps the mark at the center.
  • C-x o to go from one window to another. This is especially useful after calling M-x occur, since occur creates a split window for the output. That is the letter “O” as in Oscar. This key chord is the equivalent of calling M-x other-window.
  • C-x 0 to close the window you are in. That is 0 as in the number zero. This is equivalent to calling M-x delete-window.
  • C-x 1 deletes the windows you are not in. This is equivalent to calling M-x delete-other-windows.

The extensibility can be overwhelming, but you don’t have to learn everything at once. Once you learn enough to get by without looking anything up every few minutes, then you can do almost everything from one window. Your OS will be an app you need to run Emacs.

This post was created in Emacs with Org Mode and Love. You’re welcome.

Image from MS. Barocci 31, a Byzantine manuscript dated to 1290-1300, currently housed in Bodleian Library; image from the Catalogue of Western Medieval Manuscripts in Oxford Libraries (manuscript info here, digitization link here); image allowed under CC BY-NC 4.0; the image may have been cropped and had colors enhanced via ImageMagick.

Example of Eshell Use and Thoughts On Eshell

While it may not be possible to live in Emacs 24/7, I am trying to do more things in Emacs. Part of that is using more Eshell.

For each story or defect I would get, I would make a directory with notes and I would backup the files. I have blown away local changes a few times, so I usually make sure that no longer happens. (This past week I lost some files when Windows deleted some files after a forced restart.) Once the story or defect has been released to production, I delete the local backups.

I used to use Notepad++, now I use Emacs. I take the steps and/or subrequirements and make them into a TODO list, making it easier to track progress.

For copying the files, I would make a .bat file, with aliases for directories. I would copy the files to a common directory, and append a number between the name and the extension. SomeFile.java would be copied to SomeFile.002.java, etc. I would edit the file by hand, adding files as I changed them, and incrementing the version number each time. I would then run the file in a DOS window.

Since I started keeping notes in Org, I started copying the files in Eshell. I also added some commands to put a message into a text file. I would edit as needed, and then use set-mark-command and copy-region-as-kill to highlight and copy my commands, then yank them in the Eshell buffer. There might be a way to put it all in an Emacs Lisp file, or use looping and a list, but one step at a time. Switching between buffers is more convenient than switching between applications.

The Eshell version also makes a new directory for each iteration, and moves the files there.

Here is an example, with names changed to protect the innocent (names provided by Random Word Generator):


(setenv "VER_NUM" "006")
(setenv "DATE_STRING" (format-time-string "%Y-%m-%d_%H.%M.%S"))
(setenv "COMMIT_MSG" "advance digress cave committee trouser")
(setenv "STORY_NUM" "CULTIVATE-7659")
(setenv "ARCHIVE_DIR" (concat "C:/EKM/stories/" (getenv "STORY_NUM")  "/files"))
(setenv "JAVA_SRC_DIR" "D:/genetic/jurisdiction")
(setenv "SURFACE_PKG" "src/org/partner/sausage")
(setenv "NORTH_PKG"  (concat (getenv "JAVA_DIR") "/" (getenv "SURFACE_PKG") "/west/habit/mosquito"))
(setenv "WOLF_PKG"   (concat (getenv "JAVA_DIR") "/" (getenv "SURFACE_PKG") "/option/drawer/highlight"))
(setq FILE_DIR (concat (getenv "ARCHIVE_DIR") "/files_" (getenv "STORY_NUM")  "_" (getenv "VER_NUM")))
(setenv "COMMIT_FILE" (concat (getenv "FILE_DIR") "/message." (getenv "DATE_STRING")))
cd $ARCHIVE_DIR
cp -v C:/EKM/stories/$STORY_NUM/menu.delete.highway.option.escape_workload.sql $ARCHIVE_DIR/menu.delete.highway.option.escape_workload.$VER_NUM.sql
cp -v $JAVA_SRC_DIR/$NORTH_PKG/PeelBuilder.java          $ARCHIVE_DIR/PeelBuilder.$VER_NUM.java
cp -v $JAVA_SRC_DIR/$NORTH_PKG/WaterFactory.java         $ARCHIVE_DIR/WaterFactory.$VER_NUM.java
cp -v $JAVA_SRC_DIR/$WOLF_PKG/MushroomAdapter.java       $ARCHIVE_DIR/MushroomAdapter.$VER_NUM.java
cp -v $JAVA_SRC_DIR/$WOLF_PKG/WheatBridge.java           $ARCHIVE_DIR/WheatBridge.$VER_NUM.java
cp -v $JAVA_SRC_DIR/web/WEB-INF/conf/tiles-defs-case.xml $ARCHIVE_DIR/tiles-defs-case.$VER_NUM.xml
cp -v $JAVA_SRC_DIR/$SURFACE_PKG/common/properties/ApplicationResources.properties $ARCHIVE_DIR/ApplicationResources.$VER_NUM.properties
mkdir $FILE_DIR
mv -v $ARCHIVE_DIR/*.$VER_NUM.* $FILE_DIR
(write-region (concat (getenv "DATE_STRING") ": " (getenv "COMMIT_MSG")) nil (getenv "COMMIT_FILE"))

There is a good article on Eshell on Mastering Emacs. The author and a few commenters lament that Eshell is not well documented. At least one commenter wrote that the article should be incorporated into the Emacs documentation.

There actually is an Eshell manual: you can find it at this page. The list of built-in commands is here. If you look on the Emacs documentation page, there is a list of four links. As of 2023-08-12, they are: GNU Emacs manual, An Introduction to Programming in Emacs Lisp, Emacs Lisp Reference Manual and Other Emacs manuals. The Eshell manual is listed on the page at the “Other Emacs manuals” link. [Note 1]

That page has a lot of manuals. It has links to the other three main manuals, as well as the parts of Emacs not covered in the primary manual: Calc, Eshell, IDO, Org (which is the same as the manual on the Org mode site), Tramp, use-package, and many more. I always went to the primary Emacs manual, and I do not think I had ever looked at the page for the other manuals until I did so by chance a few days ago. I wonder why the manual for Hyperbole is not on the list.

One of the comments on the Mastering Emacs article links to the Eshell page on EmacsWiki. That page has a few gems not in the manual, like for loops. I downloaded the manual source, and grepped with grep -in ‘for.*in\s’ eshell.texi, and I did not see what looked like a for loop.

I also used it on my Windows machine for work. On Linux, Emacs uses the system grep tool when I select M-x grep; this does not work on Windows since there is no grep command by default. Using grep on Eshell on Windows seems to work recursively, but not on Linux. When I did a grep in Eshell on Windows, it added each file it scanned to the list of buffers. It did choke on a large PDF file. I have not the same type of files on my work laptop as I have on my own machine, so my tests are just prelimiary; most of my files on Windows are Office files, large PDF files and large XML files that are all one line.


Note 1: It is not clear to me from the text and comments on the Mastering Emacs article if people are unaware of the Eshell manual, or if they do not think it has enough information to be useful. Nevertheless, I recommend reading all the articles on that site and the book.

This post was created in Emacs with Org Mode and Love. You’re welcome.

Image from the Hidda Codex, an 11-century manuscript housed at the Archbishop’s Diocesan and Cathedral Library in Cologne, Germany, allowed under CC BY-NC 4.0.

Alternatives to Org (that I will not be using)

One of the items in my ever-growing to-do list in Org Mode was to look at other outlining software. I think I started the list with the intent of trying these out, but as it grew I just kept track of new programs as I came across them. I have decided to abandon this list since I think Org and Emacs will fit whatever needs I have now and in the future. Plus I kept finding other alternatives to Org (either as outliners or for to-do lists), and since the list got longer and longer, I just decided to scrap the idea. Here I will just list what I found.

  • Leo Editor
  • Todo.txt
    • Main page.
    • Neil Van Dyke’s page on Todo.txt. He also has a page on Emacs packages he has written.
    • Emacs mode for Todo.txt.
  • TaskWarrior
    It looks like this requires a separate server to run.

  • A Plain Text Personal Organizer. This is more of a system, and there does not seem to be an application.
  • [x]it (I guess pronounced like “exit”)
    I looked at the syntax guide for about a second, and decided I did not need to read any further. With Org, you can set the status of an item with a word (like “TODO”, “INPROGRESS”, “CANCELLED”, “DONE”); I think you can add your own if you want. Using punctuation for that is inefficient. I do not need yet another thing to remember. I prefer thinking in words rather than symbols, and I prefer context being somewhere other than in my head.

One of the Hacker News discussions on xit had a comment that made me realize there was not much point in keeping this list:

If you want a plain text organizational, compositional and scheduling tool that you can use for the rest of your life and know that 30 years down the line it will be actively supported, developed and you will be able to tweak anything you want…. emacs/org mode is by far and away the best choice. It isn’t even remotely close, we are talking about the difference between a planet and a tiny asteroid when you compare org mode to other plain textish organizational, compositional and scheduling tools.

For as long as humanity doesn’t collapse and probably even after it does org mode and emacs will be used (there is going to be some nerd somewhere using org mode and ledger cli to meticulously track how many smoked rats and cockroach kebobs they have left to eat before they have to leave their bunker), there is just such an intense critical mass of utility under an open source license.

WRT outliners: I do not create plain text files anymore. I just make everything an Org file, and collapse parts that I am not interested in looking at in any given moment. When you have a tool that can do anything, why use anything else?

You’re welcome.

Image from an 11th-century manuscript made at the monastery of St. Gall, housed at the Jagiellonian Library (Wikipedia page here), image from e-Codices, assumed allowed under CC BY-NC 4.0.