To activate one of these buttons, click on the button with the mouse or position your cursor inside its borders and press Enter. Figure 10-1highlights these options.
Figure 10-1. Custom button activation using the mouse cursor (top) and the keyboard cursor (bottom) (Mac OS X)
When you finish looking at a screen, if you are not interested in changing anything, you can type C-x kto kill the current buffer and go back to the previous screen. You can also activate the Finish button in the common header set discussed next.
At the top of each page in Custom is a common set of buttons shown in Figure 10-2. These options affect the entire buffer.
Figure 10-2. The actions common to all pages in Custom (Mac OS X)
From here you can perform any of the following tasks:
Set for Current Session
Make immediate changes that last for the duration of this session but will be reset the next time you start Emacs.
Save for Future Sessions
Make immediate changes that last for the duration of this session and will also be in place the next time you start Emacs. These changes are stored in your .emacs file.
Reset
Switch back to the previous values (previous to your current changes, anyway).
Reset to Saved
Switch back to the previously saved values. In this case, "saved" means saved for future sessions. If you haven't made (and subsequently saved) any customizations to a variable, this option has no effect.
Erase Customization
This option pretty much does what it says. Any customizations made by Custom, whether for this or future sessions, are removed. Your own personal entries in your .emacs file should remain intact, but it's always a good idea to make a backup before deleting any information.
Finish
Close this buffer and return to the previous customization buffer or back to the buffer from which you launched Custom. Note that you can also press the qkey to activate Finish from anywhere in a Custom buffer.
These options are useful when you modify more than one option on a page and want to save them all at once (and in the same way).
Custom corrals options into customization groups, which are set up in a hierarchy of parent and child groups. To go to the parent group for the group you're looking at, choose the button for the parent group in question following the Go to parent group:
prompt. To make it easier to find things, a group might have more than one parent. For example, the I18n (internationalization) group has two parents, Environment
and Editing
, as shown in Figure 10-3.
Figure 10-3. Custom's Go to parent group prompt
Choosing Go to parent group
is much like choosing Finish but without closing the buffer. It's a useful option if you're just poking around looking for related variables. We'll show you better ways to find particular features to customize later in this chapter.
10.1.3 Customizing with Custom
After you learn your way around, you can tackle customizing Emacs. Each screen of Custom lists variables and other settings. You can edit the value of any variable in the grey text field to the right of variable's name. The current value should be listed. Just delete the current value and type the new value.
Changing a value, however, is not the last step you have to take. You need to save the change before it will take effect. You use the State button to save the change (as mentioned earlier, to save all the values on a page in the same way, you can use the options near the top of the screen). As with other parts of Custom, you can use your mouse or the keyboard. Clicking the left mouse button on State should bring up the list shown in Figure 10-4. Depending on the variable and the change you made (if any), you may or may not have all of the options available.
Figure 10-4. Using the mouse to save or reset an option (Mac OS X)
Of course, you can also activate the State button by placing your cursor on it and pressing Enter. That should create a second window with effectively the same options you get when using the mouse. Figure 10-5shows the options you see using the Enterkey to select State. This list is dynamic, showing only options that are available to you. (It won't show any options if you haven't changed anything yet, but it beeps with an error.)
Figure 10-5. Using the keyboard to save or reset an option (Mac OS X)
When using the mouse, simply select the desired choice from the list. When using the text approach, type the number (or other character) corresponding to your desired choice. The options available are similar to those that apply to the entire buffer. You'll see the familiar save and reset options along with a few new ones:
Set for Current Session
Same as the global option. Saves the new value for the duration of this session.
Save for Future Sessions
Same as the global option. Applies this value immediately and updates your .emacs file so the new value is used whenever you start Emacs.
Reset to Current
Goes back to the current value for the variable. Any unsaved changes are thrown out, but changes saved—even just for this session—count as "current" changes.
Erase Customization
Same as the global option. Any changes to the variable are removed and .emacs is updated if needed.
Use Backup Value
Goes back to the value saved before the "current" value was set. In other words, revert to the value replaced by the most recent save.
Add Comment
You can add your own comments to the variable to help you remember why you made this change. Comments last as long as the saved change. Changes made only for the current session keep the comment only for the current session (not often useful). Comments added to changes that you save for future sessions show up on this screen in those future sessions. Erasing the customized value also erases comments.
If you make a mistake or supply a value that is not appropriate for the variable, you get a brief error message in the minibuffer. As with other utilities that grew up in the world of Unix, no news is good news. If you don't see any error messages, your change was successfully saved.
10.1.4 An Abbrev Mode Example
Word abbreviation mode is a wonderful way to correct typos on the fly. But it can't work that way unless it is turned on. Let's use Custom to turn on word abbreviation mode (discussed in Chapter 3 Chapter 3. Search and Replace The commands we discussed in the first two chapters are enough to get you started, but they're certainly not enough to do any serious editing. If you're using Emacs for anything longer than a few paragraphs, you'll want the support this chapter describes. In this chapter, we cover the various ways that Emacs lets you search for and replace text. Emacs provides the traditional search and replace facilities you would expect in any editor; it also provides several important variants, including incremental searches, regular expression searches, and query-replace. We also cover spell-checking here, because it is a type of replacement (errors are sought and replaced with corrections). Finally, we cover word abbreviation mode; this feature is a type of automatic replacement that can be a real timesaver.
).
Type: M-x custom Enter

Читать дальше