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.

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 "")
 ;; )

Now, look at your emacs init file.

[see Emacs: Init File Tutorial]

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 at https://plus.google.com/105607129061953936165/posts )

Emacs Customization

  1. Emacs init file
  2. Install Packages
  3. Install Package Manually
  4. Define Keys
  5. M-x customize
  6. What's Major Mode?
  7. What's Minor Mode?
  8. Set File to Open in a Major Mode
  9. Organize Init File
  10. Byte Compile Elisp
  11. What's Hook?
  12. Environment Variables in Emacs
  13. Set Default Window Size
  14. Font Setup
  15. Set Color Theme
  16. Turn Off Auto Backup; Set Backups into a Directory; How to Delete Backup Files
  17. Elisp: Determine OS, Emacs Version, Machine Host Name
  18. Elisp: Check If a {function, variable, feature} is Defined/Loaded
Patreon me $5 patreon

Or Buy Xah Emacs Tutorial

Or buy a nice keyboard: Best Keyboard for Emacs

Patreon me $5. Ask me question on patreon