Fun with Emacs

By Xah Lee. Date: . Last updated: .

You probably heard that emacs can do lots of things. This page shows some.

emacs learning curve
A comic on emacs's learning curve. 〔Original source appears to be Steve Rowe's blog. 〈A friend of mine put this together〉 @

How to call a command by name?

Emacs has thousands of commands. To call a command by name, type 【Alt+x】.

Emacs Tetris

emacs tetris 49994
M-x tetris.

M-x tetris to start it. Use arrow keys to move the blocks.

Call kill-buffer to close it.

Split Windows

wildly split emacs screen
Wildly split emacs screen. From top to bottom: calendar, Unicode, shell, hexl-mode , html-mode, dired, calculator.

You can split your window into two or more panes, vertically or horizontally.

〔➤see Emacs: Split Windows Basics

View Calendar

To run calendar in emacs, pull the menu 〖Tools ▸ Calendar〗, or call calendar.

emacs calendar
A screenshots of emacs's calendar feature.

To close the calendar pane, type q.


To run a calculator in emacs, call calc.

emacs calculator
Calc mode in emacs.

To quit calculator, type q.

To compute “1+2”, type 【1 Enter ↵ 2 +】. Or, you can type the expression directly by starting with a sinle quote, like this: 【' 1 + 2 Enter ↵】.

Calculator can also be started by going to the menu 〖Tools ▸ Programmable Calculator〗.

Directory Navigation and Managing Files

A Screenshot of emacs's feature of directory navigation.

To start, call dired or pull the menu 〖File ▸ Dired〗, then, give a dir path.

To exit, press 【q】.

For a full tutorial, see: Emacs: File Management, dired Tutorial.

Pretty Colors

To view the colors and their hexadecimal values in RGB model, call list-colors-display. This is very useful when you work in CSS and HTML. 〔➤see Xah HTML Tutorial〕 〔➤see Visual Dictionary of CSS

emacs colors

Command Line Interface (aka Shell)

emacs shell 2014-08-22
Bash shell in emacs. M-x shell.

Call shell to start a shell interface.

For detail, see: Emacs: Run Shell in Emacs.

LISP in Emacs

Sometime you hear that emacs has the artificial intelligence language LISP built-in. That's right. Here's how you can run a short example.

emacs lisp eval 2017 01 04
eval emacs lisp code basics. 〔➤see How to Evaluate Emacs Lisp Code

In emacs, open a file, any file. In the file, type (+ 1 2), then, select the whole text, then call eval-region. You will see the result “3”. CONGRADULATIONS, you've just evaluated a lisp program!

See: Emacs Lisp Basics.

Internet Relay Chat (IRC)

If you don't know already, IRC is Internet Relay Chat. IRC is a public instant messaging forum that allows a groups of people to discuss things together. Typically, irc topics are about programing languages (Perl, Bash, PHP, HTML, OCaml, …) or tools (emacs, ubuntu, git …).

Yes, you can run IRC in emacs if you are running emacs version 22 or later. To see what version of emacs you have, type “emacs --version” in the command line prompt. Or, inside emacs, call version.

To start irc, call irc. Then, you'll be prompted to enter the server name and port and user name, and channel you want to join. For example, use the following:

IRC Server:
IRC Port: 6667
IRC Nick: imrandomjack
Channels: #emacs

then you'll be connected to the #emacs discussion room in the server.

Emacs Kitchen Sink

emacs kitchen sink icon
Emacs Kitchen Sink
Like it? Buy Xah Emacs Tutorial. Thanks.

or, buy something from Best Keyboard for Emacs