: Learning GNU Emacs, 3rd Edition

10.1.3 Customizing with Custom

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.

Figure10-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-5 shows the options you see using the Enter key 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.)

Figure10-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 savedeven just for this sessioncount 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.

: 0.409. /Cache: 3 / 0