is Ben Rudgers

Thoughts on Emacs

Regardless of if learning Emacs seems hard, it will always seem there is something else to learn. Not surprising for software that’s been in continuous development for more than 30 years. Anyway, as I have been learning it – and the use of Emacs is a feature of this course [1] as far as I am concerned – I have developed a mental model of Emacs interface layers.

Display layer from top down:

+Frames – which everyone else in the world calls “windows” but because Emacs is so old that it was designed around terminals and text only monitors, the term “windows” had already been used for the next lower layer. Make a new frame with M-x make-frame. Make as many as you want. Cycle the active cursor between frames with C-x 5 o – and I am amazed that I am starting to learn that. In “MicroSoft Windows”, Alt-Tab will switch to and from frames like they are separate applications.

+Windows – are subdivisions of a frame, but would be considered windows on a text only terminal or display. To switch between windows in the same frame use C-x o for other window. Here is the cool part for learning Emacs: You can also use M-x other-window to do the same thing and Emacs will tell you in the mini-buffer “You can run the command ‘other-window’ with C-x 0” because what M-x does is allow you type in the name of any command [including those you write yourself]. That’s exactly what we did to make a frame; make-frame is the name of the Emacs command that makes frames, just like other-window is the command for switching between windows.

If you want to split a window into two horizontal windows: C-x 2. If you want to split a window into two side by side windows use C-x 3. If you want a frame to display a single window use C-x 1.

+Buffers – Are not properly part of the display system. Instead, buffers are the content that windows can display, but a buffer does not have to be displayed and a buffer can be displayed in multiple windows at the same time.

++OR to put it another way: a buffer is available content for display and may be displayed in zero, one, or more than one window and zero, one or more frames.

++OR to put it a third way, a buffer is a “file” which Emacs knows about because Emacs has a copy of it in memory. Some buffers such as Messages and Scratch only exist in memory. Others like “homework1.sml” are copied from a file on disk and can be saved back to that file with C-x C-f.

Some thoughts on the keyboard

One of the things I am currently working on is using both hands to touch type Alt and Ctrl. Breaking my habit of just using my left hand for Alt and Ctrl has been hard [1]


[1] Coursera’s Programming Languages with Dan Grossman https://www.coursera.org/course/proglang

[2] The left hand only for Alt and Ctrl goes back more than 20 years to my first AutoCad job where we used ANSI.SYS to create keyboard shortcuts. They were all organized around the left hand because the right hand was on the digitizer puck.