Decluttering
Until somewhat recently I exclusively used Emacs in a terminal emulator, but now I understand the benefits the GUI offers: more colours, inline graphics, different fonts, and the fringe. We'll get to all of those in due time. The parts of the GUI that I'm not interested in are those which are intended to be used via the mouse.
(when (display-graphic-p)
(menu-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1))
Since I'll still occasionally use Emacs in a terminal emulator, these interface elements are only disabled when Emacs is running in a GUI. Trying to disable them in the terminal, where they don't exist, will cause the startup customization process to error out. To learn about display-graphic-p
, we'll use a different help facility designed specifically for retrieving the docstrings of functions: describe-function
(C-h f display-graphic-p
):
(display-graphic-p &optional DISPLAY)
Return non-nil if DISPLAY is a graphic display.
Graphical displays are those which are capable of displaying several frames and several different fonts at once. This is true for displays that use a window system such as X, and false for text-only terminals. DISPLAY can be a display name, a frame, or nil (meaning the selected frame's display).
By this point Emacs is looking appropriately svelte, especially compared to where we started: