Emacs: M-x customize Tutorial
Emacs has a textual GUI system for setting user preferences . It lets you customize emacs without needing to know emacs lisp.
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
In Windows, see Emacs in Microsoft Windows FAQ.
Take a look.
You can reset your customization by deleting generated code in your emacs init, then restart emacs.
customize-group to customize a particular mode directly.
For example, call
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.
- Advantage of custom system: simple and easier to use than manually maintain basic preferences.
- Disadvantage of custom system: all variables are together in alphabetical order, not categorized by mode or purpose. Also, personal hooks and other settings cannot be grouped there.
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 Customize Topic
- How to Set Emacs's User Interface
- Emacs: How to Install Packages Using ELPA, MELPA
- How to Install Emacs Package Manually
- Emacs: How to Define Keys
- Emacs: M-x customize Tutorial
- Emacs: Set File to Open in a Major Mode
- Organize Emacs Init File in 5 Minutes
- Emacs: Byte Compile Elisp Files
- Emacs: What's Hook?
- Emacs: Set Environment Variables within Emacs