Three important distinctions in Emacs
In his Nicomachean Ethocs Aristotle the great philosopher said that "the majority of people are unable to make distinctions." He was correct, and yet it is a fundamental mark of human intelligence to be able to do so.
Distinctions are also important in Emacs and today I explore three.
The difference between the minibuffer and the echo area
An Emacs novice may wonder where the minibuffer and echo area are. They are both regions in the Emacs interface that serve distinct purposes.
Minibuffer is the space at the bottom of the Emacs window where Emacs prompts for input after the invocation of M-x. Emacs will wait for your further input. If you invoke M-: instead, you can enter expressions into the minibuffer for evaluation.
The echo area is where Emacs flashes messages such as evaluations, warnings, and error messages.
The echo area is usually located in the same space as the minibuffer, but the two regions serve different functions. When the minibuffer is not active (i.e., not in use for command input), messages will be displayed in the echo area.
So the two areas occupy the same physical space on the Emacs interface, but they are conceptually distinct.
Difference between point and mark
In Emacs Lisp, point is an integer. Point is the current location of the cursor in a buffer. Or is it? Point is not exactly the place where the cursor is, but the place between it. The default cursor in Emacs gives the (wrong) impression that point is the block covering a character or space. To find out more accurately what point is evaluate this expression:
(setq-default cursor-type 'bar)
To get it back:
(setq-default cursor-type 'box)
If you are at the very beginning of the buffer, point is 1. If at the end of a buffer containing N characters, the point is N+1.
Do not confuse point with line number and column number. These are a two-dimensional coordinate, providing a human-readable way of understanding the cursor's position in terms of rows (lines) and columns, as you might see them on the screen.
To determine the value of point:
M-x : (point)
The "mark" is another position in the buffer; its value can be set with a command such as C-<SPC>
. The portion of the buffer between mark and point is called the region. You move between mark and point using C-x C-x
Diff between frame and a window
In Emacs, a "frame" is what you might traditionally think of as a "window" in a desktop environment. A frame is the entire area occupied by Emacs, including all its contents, including its windows, menu bar, toolbar, scroll bar, etc. A window by contrast is a viewport onto a buffer. A window is not just the whitespace demarcated within a frame but also includes the modeline, fringe, scroll bar etc. of that window.
You create a new frame in Emacs by invoking M-x make-frame
You create a new window by invoking C-x 2
or C-x 3
. C-x 0
deletes the current window. C-x 1
deletes all other windows.