Emacs: Universal Argument (prefix arg)

By Xah Lee. Date: . Last updated: .

Emacs has a mechanism for a command to have variant behavior if user calls universal-argumentCtrl+u】 first, before calling the command.

The purpose of universal-argument is:

digit-argument, negative-argument

These are variant of universal-argument.

Keyboard shortcuts for digit-argument

Examples of universal-argument

Type Ctrl+u 60 - to insert hyphen, 60 times.

In dired, dired-copy-filename-as-killw】 copies the file name, but type Ctrl+u 0 first, then w, the copied name is file full path.