Emacs: M-x customize Tutorial

By Xah Lee. Date: . Last updated: .

Emacs has a textual GUI system for setting user preferences . It lets you customize emacs without needing to know emacs lisp.

emacs customize 2016-06-16
M-x customize

Alt+x customize. (that is, press 【Alt+x】 then type “customize”, then Enter.)

Now, try it. You can use mouse to click links or buttons.

Click “Apply” button to make your changes effective immediately.

The “Apply and Save” button will create lisp code and insert to your emacs init file. So that, your preferences will be effective next time you start emacs.

Here's example of the generated lisp code:

(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(abbrev-mode t)
 '(auto-save-default nil)
 '(comment-column 2)
 '(current-language-environment "UTF-8")
 '(default-input-method "latin-1-prefix")
 '(ffap-newfile-prompt t)
 '(font-lock-maximum-decoration 2)
 '(indicate-empty-lines nil)
 '(initial-major-mode (quote text-mode))
 '(initial-scratch-message "")
 ;; )

The init file by default is at ~/.emacs or ~/.emacs.d/init.el. In Windows, see Emacs in Microsoft Windows FAQ.

Take a look.

Reset customize

You can reset your customization by deleting generated code in your emacs init, then restart emacs.

customize-group

emacs 24 custom screenshot 2013-07-02
Emacs textual GUI based Custom system for setting user preference.

Alt+x customize-group to customize a particular mode directly.

For example, Alt+x customize-group, then type “dired”. That page will let you change dired settings.

customize-group is a great way to explore a mode's features.

Custom vs Manual Lisp Code

The Custom system does NOT include all possible variable settings. Also, many emacs customization require lisp code, not just setting variables.

Some emacs users use Custom system whenever possible, but others avoid it completely.

custom-set-faces?

When you use custom, emacs may also generates the following related to font or syntax coloring.

(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(completions-common-part ((t (:inherit default :foreground "red"))))
 '(diredp-compressed-file-suffix ((t (:foreground "#7b68ee"))))
 '(diredp-ignored-file-name ((t (:foreground "#aaaaaa"))))
 '(isearch ((((class color) (min-colors 88) (background light)) (:background "black" :foreground "white"))))
 '(show-paren-match ((((class color) (background light)) (:background "azure2")))))

( thanks to Per Abrahamsen)

Emacs Customization

  1. How to Set Emacs's User Interface
  2. Emacs: How to Install Packages Using ELPA, MELPA
  3. How to Install Emacs Package Manually
  4. Emacs: How to Define Keys
  5. Emacs: M-x customize Tutorial
  6. Emacs: Set File to Open in a Major Mode
  7. Emacs: Organize Init File
  8. Emacs: Byte Compile Elisp Files
  9. Emacs: What's Hook?
  10. Emacs: Set Environment Variables within Emacs
  11. Elisp: Determine OS, Emacs Version, Machine Host Name
  12. Elisp: Check If a {function, variable, feature} is Defined/Loaded
  13. Emacs: Set Default Window (frame) Size
  14. Emacs: Font Setup
  15. Emacs: Set Color Theme
  16. Emacs: Save Cursor Position
  17. Emacs: Turn Off Auto Backup; Set Backups into a Directory; How to Delete Backup Files
  18. Emacs: Stop Cursor Going into Minibuffer Prompt
Like my tutorial? Put $5 at patreon

Or Buy Xah Emacs Tutorial

Or buy a nice keyboard: Best Keyboard for Emacs

Ask me question on patreon