I posted Elisp Functions Described in the Emacs Tutorial on Tuesday, 27 May, 2014

Post emacs elisp tutorial

Elisp Functions Described in the Emacs Tutorial

The other day I talked some sort of nonsense about organizing my notes into some sort of coherent blog post. Heck with that. Life is too short. Instead I will just dump them here and hope somebody finds them useful. Maybe later I can do something with it. For now it’s just supplemental material for the official Emacs tutorial.

Functions in the Emacs Tutorial

FunctionKeybindingDescription
save-buffers-kill-terminalC-x C-cSave and quit Emacs
keyboard-quitC-gCancels entry of a command
scroll-up-commandC-vScroll content up
scroll-down-commandM-vScroll cowntent down
recenter-top-bottomC-lRedraw window cycling point through center/top/bottom of window
previous-lineC-pPut point on previous line
next-lineC-nPut point on next line
backward-charC-bPut point on previous character
forward-charC-fPut point on next character
forward-wordM-fPut point on next word
backward-wordM-bPut point on previous word
move-beginning-of-lineC-aPut point on line start
move-end-of-lineC-ePut point on line end
backward-sentenceM-aPut point on previous sentence start
forward-sentenceM-ePut point on next sentence start
beginning-of-bufferM-<Put point on buffer start
end-of-bufferM→Put point on buffer end
universal-argumentC-uBegin a numeric argument for the following command
delete-other-windowsC-x 1Make window fill its frame
self-insert-command<character>Inserts the character you type
newlineRETURNInsert a newline & move point to next line
delete-backward-charDELDelete characters before point
delete-charC-dDelete characters after point
backward-kill-wordM-DELDelete word before point
kill-wordM-dDelete word after point
kill-lineC-kKill from point to end of line
kill-sentenceM-kKill from point to end of sentence
set-mark-commandC-SPACEStart marking a region for later action
kill-regionC-wCut text in marked region
yankC-yYank (paste) text at point
yank-popM-ycycle through kill ring w/last yank
undoC-/Undo last command
find-fileC-x C-fPrompt in minibuffer to open a file in buffer
save-bufferC-x C-sSave buffer contents to file
list-buffersC-x C-bDisplay a list of existing buffers
switch-to-bufferC-x bMinibuffer prompt switch window view to different buffer
save-some-buffersC-x sPrompt to save each changed buffer
suspend-frameC-z or C-x C-zexit Emacs temporarily
replace-stringM-x replace-stringminibuffer - replace instances of a string in buffer after point
recover-fileM-x recover-fileRevisit buffer using last auto-saved contents
text-modeM-x text-modeMajor mode for editing text for humans to read
describe-modeC-h mShow documentation for current major and minor modes
auto-fill-modeM-x auto-fill-modeToggle automatic line breaking
fill-paragraphM-qFill paragraph at / after point.
isearch-forwardC-sminibuffer - Do incremental search forward
isearch-backwardC-rminibuffer - Do incremental search backward
split-window-belowC-x 2Split selected window horizontally. Selected window becomes top
scroll-other-windowC-M-vScroll next window
other-windowC-x oSelect next window in cyclic window order
delete-other-windowsC-x 1Make selected window fill its frame
find-file-other-windowC-x 4 C-fEdit file in other window
make-frameC-x 5 2Return newly created frame displaying current buffer
delete-frameC-x 5 0Delete selected frame
help-for-helpC-h ?Launches interactive help mode
describe-key-brieflyC-h c <key>Prints name of function invoked by <key>
describe-keyC-h k <key>Display documentation of function invoked by <key>
describe-functionC-h f <function>Display documentation of <function>
describe-variableC-h v <variable>Display documentation of <variable>
apropos-commandC-h a <pattern>Show all commands with names containing <pattern>
infoC-h iEnter the Info documentation browser
info-emacs-manualC-h rDisplay the Emacs manual in Info mode

Notes

I found some things noteworthy while building this list.

Numeric Arguments

  • Digits or minus sign after C-u form the numeric argument.
  • Default is 4
  • Usually treated as numeric argument
  • Sometimes it’s just a flag. The following command changes behavior based on the presence of universal-argument rather than the details of its value
C-u 8 C-fMove forward 8 characters
C-u C-fMove forward 4 characters
C-u 2 C-vScroll screen 2 lines

Disabled Commands

Some commands such as downcase-region C-x C-l are disabled by default in Emacs. They confuse beginners. You get an interactive prompt to try it, enable it, and whatever.

There’s no big list of disabled commands. Instead each command has a hook telling whether it’s disabled or not. The EmacsWiki DisabledCommands page presents functions to list and enable disabled functions.

Inserting and Deleting

Everything you type invokes a function. Most of the alphanumeric keys simply insert the character and move point. Some, like newline and delete-backward-character, trigger functions that relate to behavior users expect when entering those keys.

They take numeric arguments too. C-u 4 * will insert **** into the buffer.

Undo

Undo ignores movement commands, and self-insert-command are lumped into groups of up to 20.

Extending the Command Set

There are only so many keys on the average keyboard. Less common commands get invoked either through an extended keybinding like C-x <character> or direct invocation via M-x <name>.

C-x <character>
Character eXtend
M-x <name>
Named command eXtend (offers tab completion)

Searching

Incremental search is like a minibuffer mode. There are special bindings for the keys and everything.

Multiple Frames

Frames are what what most windowing systems refer to as windows, but Emacs was already using that term.

Frames only work in GUI, because the terminal can only display a single frame at a time. See elscreen for an alternative that works in both terminal and GUI.

Indieweb Social

Did you mention this somewhere? I'd love it if you sent me the link!

disclaimer about timing

Mentions are sent to webmention.io. I fetch the latest mentions when building the site, so I may not see your feedback right away. Especially if my site's broken, which is often the case.

Public replies and mentions might be shared on the site, but I try to do a little quality check first.

Site Links