Figure 10-7. Editing a list entry in Custom (Mac OS X)
If you don't use DVI documents, you can get rid of that association using the DEL button shown in Figure 10-8.
Figure 10-8. Deleting a list entry in Custom (Mac OS X)
You can also add new document types and viewers by clicking on any of the INS buttons. (The order of the associations isn't important for this particular variable, but it might matter for other lists.) To insert a new association before the PDF entry, activate the INS button to the left of the PDF entry.
Click on INS to the left of the PDF entry.

The first step in adding a new item to a list in Custom (Windows).
Now you can add an association for playing MP3 files on a PC by editing both the Regexp
and String
lines. Note that you'd have to supply a path to your helper application (winamp in this example) that matched your system. As mentioned earlier, if winamp was already the default helper application for MP3s, you could simply type %sfor the String
instead of the complete path to winamp.
Type [.]mp3\' for the Regexp
and c:\apps\media\winamp.exe %sfor the String
:

The second step in adding a new item (Windows).
You may have noticed the Save Changes option in the Options menu. This menu item saves changes you make through the Options menu. For example, you can modify such settings as whether or not the toolbar is visible or the Save Place in Files between Sessions option. It does not save changes you have made through Custom—even if you launched Custom from one of the Options → Customize Emacs submenu items. You'll still need to use the normal Custom options to save those changes.
For our Dired variable example, then, you'll need to select one of the Save options available. In this case, we'll save it for the current session only.
Click on Set for Current Session

Saving changes for this session only (Windows).
When you're done saving your changes, you can exit the buffer as usual by clicking the Finish button, typing q, or typing C-x kto kill the buffer.
10.1.7 But Where Is the Variable I Want?
One of the biggest stumbling blocks to using Custom is knowing where a particular variable is located. Custom has a lot of groups and subgroups—and they aren't always intuitive. There are two quick ways to "search" for a specific variable. You can press Tabto use the completion feature in the minibuffer or you can browse through the entire Custom hierarchy.
To use the completion approach, type M-x customize-optionor select Options → Customize Emacs → Specific Option. You'll see Customize Option:
in the minibuffer. You can type a string like font and then hit the Tabkey to see what variables start with that string.
You can also create a custom buffer with options matching a regular expression with M-x customize-apropos(or Options → Customize Emacs → Options Matching Regexp). You can type in a regular expression (or a simple string) and Custom builds a new buffer with all groups containing matching options.
If you want to browse the hierarchy to see the related groups of variables in a reasonably compact view, select Options → Customize Emacs → Browse Customization Groups. That should land you on a screen similar to Figure 10-9.
Figure 10-9. Browsing customization groups (Mac OS X)
You can activate the [+] and [-] buttons just like you do other Custom buttons (click on them with your mouse or move the keyboard cursor to them and press Enter.) This allows you to browse the entire set of Custom groups and subgroups. After you find the variable you're looking for, click on the Option button next to the variable or click on the Group button for the variable's parent group if you want to edit multiple variables in the group.
10.2 Modifying the .emacs File Directly
It's possible to customize Emacs in just about any way you can imagine. Almost everything you see on the screen, every command, keystroke, message, and so on, can be changed. As you may imagine, most customizations involve the Emacs startup file .emacs .
10.2.1 Custom Versus .emacs
The previous section discussed the interactive customization tool, Custom, but left out some of the details on what happens any time you "save for future sessions." Custom places the configuration information in your .emacs file. Some things simply cannot be done through Custom (yet). Once you get familiar with the types of statements that go into your .emacs file, you may also just find it easier to add a line or two directly.
We should emphasize that using Custom or editing .emacs by hand is not an either-or proposition. When you save options via Custom, it adds its settings to the end of your .emacs file and warns you not to edit them by hand. Despite this prohibition, you can easily add your own customizations to the beginning of that file. To illustrate this, Example 10-1shows a sample .emacs file for Mac OS X that shows edits made directly by the user as well as sections added by Custom (shown in bold)
Example 10-1. A .emacs file for Mac OS X with lines added by the user and by Custom
(setq mac-command-key-is-meta nil)
(diary)
(setq load-path (cons "~/elisp" load-path))
(autoload 'html-helper-mode "html-helper-mode" "Yay HTML" t)
(setq html-helper-build-new-buffer t)
(setq auto-mode-alist (cons '("\.html$" . html-helper-mode) auto-mode-alist))
(setq-default indent-tabs-mode nil)
(setq-default tab-width 15)
(setq-default abbrev-mode t)
(read-abbrev-file "~/.abbrev_defs")
(setq save-abbrevs t)
(fset 'boldword
[?\C- escape ?f ?\C-x ?\C-x ?< ?b ?> ?\C-x ?\C-x ?< ?/ ?b ?>])
(fset 'italword
[?\C- escape ?f ?\C-x ?\C-x ?< ?e ?m backspace backspace ?i ?>
?\C-x ?\C-x ?< ?/ ?i ?>])
(global-set-key "\C-x\C-kI" 'italword)
(setq shell-file-name "/bin/zsh")
(add-hook 'comint-output-filter-functions
'comint-watch-for-password-prompt)
(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.
'(global-font-lock-mode t nil (font-core))
'(text-mode-hook (quote (turn-on-auto-fill text-mode-hook-identify))))
(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.
Читать дальше