Emacs

Emacs is a free and open source editor which is part of the GNU project. We can customise almost every aspect of the editor in its Lisp variant (Emacs Lisp, with the extension .el) such as 202206121523#, 202206131443# and 202206151006#. It consists of buffer, mode line and echo area by default.

The editor maintains several buffers for various information. *Messages* buffer contains previous messages in the minibuffer or echo area. *Buffer List* displays a list of currently opened buffers. *info* buffer is used for viewing manuals.

In the left most area of the mode line, unsaved change(s) will be indicated by **. By default, it will maintain the previous state of the file under the name ~{filename} if changes happened to the file. Emacs will also auto-save files to with a name #{filename}#. You can recover to the autosave file using the command recover-this-file.

Emacs uses the concept of major mode and minor mode for each filetype in order to have accords or desired behaviours and features. There can be only one major mode exist for a buffer, but it is allowed to have multiple minor modes for a single buffer. You may treat these minor modes as the modification or enhancement to the major mode. Switching major mode can be done via M-x {major-mode-name}.

Note: If you’ve entered recursive editing levels or encountered something strange, just type <ESC> three times. It will save your sanity.

Links to this page
  • The Pragmatic Programmer
  • Emacs Keyboard Macro

    We can record #keystrokes combination into a single macro and to be called later in #202206121637. Emacs store macros recorded into a single ring, much like the kill ring. However, the macro ring will only be available for its corresponding buffer, meaning it can’t be called in other windows or buffers.

  • Emacs Keybinding

    #202206121637 has a complicated set of keybindings that user could take advantage of to manipulate lines, buffers, files etc. We can customise the keybindings in respect to our own preference by defining them in Emacs #lisp. Additionally, it can be recorded using 202208061214# to execute complicated keystrokes combination for several times.

  • Emacs Default Commands

    You can access all commands in #202206121637 either from default package or imported plugins by the keybind M-x. The following sections will describe only commands that are from the default package.

  • Dired

    Dired is the default #Emacs file explorer and manager. One can enter it with the command# M-x dired. It is one of the default major modes provided by the editor. There are several default keybindings available for us to manipulate files and directories.

#emacs #lisp