O'Reilly logo

GNU Emacs Pocket Reference by Debra Cameron

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

1.5. Emacs as a Work Environment

1.5.1. Shell Mode

Shell mode lets you access the UNIX shell without leaving Emacs. A rule of thumb in shell mode is that you preface all ordinary control sequences with C-c. For example, to interrupt a command, type C-c C-c.

To Keystrokes Command Name
Enter shell mode ESC x shell,
Interrupt current job; equivalent to C-c in UNIX shells C-c C-c comint-interrupt-subjob
Delete a character; if at end of buffer send an EOF character C-d comint-delchar-or- maybe-eof
Send EOF character C-c C-d comint-send-eof
Erase current line; C-u> in UNIX shells C-c C-u comint-kill-input
Suspend or stop a job; C-z in UNIX shells C-c C-z comint-stop-subjob
Display previous command; repeat to display earlier commands ESC p comint-previous-input
Display subsequent commands; repeat to display more recent commands ESC n comint-next-input
Execute command on current line RETURN comint-send-input
Complete command, filename, or variable name TAB comint-dynamic- complete
Delete output from last command C-c C-o comint-kill-output
Move last line of output to bottom of window C-c C-e comint-show-maximum- output

1.5.2. Working with Dired

Dired is Emacs's directory editor. It provides a convenient way to manage files and directories.

To Keystrokes Command Name
Start Dired C-x d dired
Copy C dired-do-copy
Flag for deletion d dired-flag-file-deletion
Delete immediately D dired-do-delete
Open file or directory e or f dired-find-file ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required