Read a form
November 21, 2026
First, recall
Two days have passed since lesson 1. Answer from memory. Do not open the help reference.
One rule
Emacs Lisp code is made of lists in parentheses. The introduction to Emacs Lisp gives the rule: when Emacs evaluates a list, the first item is a function, and the other items are its arguments.
(+ 2 3)The function is +. The arguments are 2 and 3. The result is 5. In this course, a list that you can evaluate is a form.
Emacs evaluates each argument before it calls the function. What an argument gives depends on its type.
| You write | Emacs gives | Why |
|---|---|---|
16 or "~/org/" | the same number or string | Numbers and strings are their own value. |
scroll-margin | 16 | A name without a quote is a variable. Emacs gives its value. |
'scroll-margin | scroll-margin | The quote says: do not evaluate. Give the name. |
(+ 2 3) | 5 | A list is a call to a function. |
The quote is the part that matters most in a config. With a quote, Lisp takes the text as written and does not run it. You use it when a function needs a name, not the value behind the name.
Two forms from your config
Line 65:
(setq scroll-margin 16)setq gives a value to a variable and returns that value. It is a special case: it does not evaluate the variable name, so you write no quote there. It takes its arguments in pairs. That is why lines 24 and 25 set two fonts in one setq.
Line 35:
(setq doom-theme 'catppuccin)The value has a quote. Without the quote, Emacs would look for a variable with the name catppuccin. The theme is identified by its name, so you pass the name.
Line 179
(add-hook 'rfc-mode-hook #'display-line-numbers-mode 'relative)Read it with the rule. The function is add-hook. There are three arguments.
'rfc-mode-hook: the name of a hook. A hook is a variable that holds a list of functions. Emacs calls them when something occurs, here when a buffer entersrfc-mode.#'display-line-numbers-mode: the name of a function.#'is a quote for functions. It gives the name without evaluation, and it tells Emacs that the name is used as a function.'relative: the namerelative, in the position of the argumentdepth.
The Elisp manual says that depth is a number from -100 to 100 for the position of the function in the hook, and that a symbol there counts as 90. So your line puts the function near the end of the hook. It does not select relative numbers. Line 39 does that for all buffers. The argument is harmless, but it says something that is not true. You will remove it in the drill.
Drill
Use SPC ;. It runs eval-expression: you type one form, and Emacs shows the result at the bottom of the screen (Doom Getting Started). Predict each result first.
- 1Evaluate
(+ 2 3).First, predict: the result. - 2Evaluate
scroll-margin, then evaluate'scroll-margin.First, predict: the two results. They are different. - 3Evaluate
(scroll-margin).First, predict: what Emacs does with the first item of a list. - 4Evaluate
relative, with no quote.First, predict: is there a variable with this name? - 5Evaluate
(setq scroll-margin 2). Scroll in a long file. Then evaluate(setq scroll-margin 16).First, predict: what setq shows, and what changes when you scroll. - 6Open
config.elat line 179. Put the cursor on the space before'relative. Type d t ). Save the file.First, predict: the text that d t ) removes, and the line that stays. - 7Read line 179 aloud in this form: "Call the function ... with the arguments ... and ...". Then do the same for line 35.
Recall
The short form of this lesson is in the Elisp reading reference.