Other functionalities

Author

Marie-Hélène Burle

In the previous section, we saw that, besides text editing, Emacs can be used as a file manager. In this section, we will see that Emacs can be used for many other tasks.

Calendar

M-x calendar opens a little calendar that can be navigated and to which events can be added.

Calculator

M-x calculator launches well … a calculator.

Man pages

Man pages can be open in Emacs with M-x man.

Running processes

Emacs can run processes in what are called inferior modes.

Scripting shells and terminals

Emacs can talk to external shells installed on your system (e.g. Bash, Zsh) or play the role of a terminal emulator.

Terminal emulators

If you want to run a terminal emulator directly in Emacs, you can use the pre-installed term (M-x term) or the similar ansi-term (M-x ansi-term).

The package multi-term allows to run multiple terminal buffers at the same time (similar to terminal multiplexers such as tmux).

For a better terminal emulator, you can install vterm.

Shells

Any scripting shell installed on your system can be run directly in Emacs with M-x shell (it’ll use your default shell if you don’t customize it). The documentation will give you the list of kbds.

Or you can run Emacs’ own shell Eshell with M-x eshell.

Eshell doesn’t talk to Bash or Zsh. It is its own shell, written entirely in Emacs Lisp. Consequently, it’ll provide you a Bash-like scripting shell on Windows.

It can also accept commands in Elisp (even mixed in with classic shell commands).

For more information on Eshell, you can read this excellent demo (also available as a lightning talk) or this article of Mastering Emacs.

If you want to run a single shell command, you can use the minibuffer with M-x shell-command or M-!.

REPL and interpreter shells

Programming shells such as Python, R, Julia… can also be run in Emacs. Some come out of the box, while others require specific packages to be installed.

Python runs in Emacs out of the box: M-x run-python.

You can also use Emacs as a fully-fledged IDE for programming languages. See our webinar for use with R, Julia, and Python. Later in this course, we will try it with R.