If you are a programmer or if you use text formatters like LATEX , you will create files that are not meant for humans to read, such as object files created by compilers and print files created by text formatters. Ideally, you wouldn't want Emacs to bother with these files when you are doing completion; for example, if you have the files program.c and program.o (object-code output from the compiler), you want Emacs to recognize only the former. Emacs does have a feature that deals with this; indeed, you may already have noticed that in this kind of situation, if you type programand press Tab, Emacs ignores program.o and completes out to program.c . The variable completion-ignored-extensionscontrols this; it is a list of filename suffixes that Emacs ignores during filename completion. By default, the list includes tilde ( ~
) for Emacs backup files, .o for programmers, various suffixes for users, .elc (byte-compiled Emacs Lisp) for Emacs customizers, and others. (Of course, if you really want to look at these files, you can type their names manually.)
You can add your own "ignored" suffix to the list by putting a line of this form in your .emacs file:
(setq completion-ignored-extensions
(cons " suffix " completion-ignored-extensions))
For example, let's say you are doing text processing with a printer that prints PostScript, and your text processor produces print files with the suffix .ps . If you don't want to look at these files, put the following line in your .emacs file:
(setq completion-ignored-extensions
(cons ".ps" completion-ignored-extensions))
Finally, you can tell Emacs to ignore case distinctions when doing completion by setting the variable completion-ignore-caseto t(or any value other than nil). Its default value is nil, meaning that Emacs respects case distinctions.
Appendix A. Emacs Variables
This appendix lists some Emacs variables. We chose them for their general usefulness and for their applicability to subjects in this book.
The variables below are grouped by category, and their default values are shown (where practical to do so). For more details on specific variables, see the chapters referred to at the beginning of each table. For information on variables used in programming language modes, see Chapter 9.
Table A-1. Backups, auto-save, and versioning
Table A-1. Backups, auto-save, and versioning ( Chapter 2, Chapter 12)
Variable |
Default |
Description |
make-backup-files |
t |
If t, create a backup version of the current file before saving it for the first time. |
backup-by-copying |
nil |
If t, create backup files by copying rather than renaming the file being saved to a backup version. The default is renaming, which is more efficient. Copying can yield different results, especially when you're editing files owned by another user, and in operating systems that allow "hard links" to files (alternate names that are associated with the physical file). There are a raft of variables that can tweak this behavior based on context; check the online help for make-backup-filesfor the details. |
version-control |
nil |
If t, create numbered versions of files as backups (with names of the form filename~N~ ). If nil, only do this for files that have numbered versions already. If ' never(note the leading single quote), never make numbered versions. |
kept-new-versions |
2 |
Number of latest versions of a file to keep when a new numbered backup is made. |
kept-old-versions |
2 |
Number of oldest versions of a file to keep when a new numbered backup is made. |
delete-old-versions |
nil |
If t, delete excess versions (not those kept according to the above variables) without asking for confirmation first. If nil, ask for confirmation first. If any other value, don't delete excess versions. |
auto-save-default |
t |
If t, do auto-saving of every file visited. |
auto-save-visited-file-name |
nil |
If t, auto-save to the file being visited rather than to a special auto-save file. |
auto-save-interval |
300 |
Number of keystrokes between auto-saving; if 0, turn off auto-saving. |
auto-save-timeout |
30 |
Length of time of inactivity after which Emacs auto-saves. If nilor 0, turn off this feature. |
delete-auto-save-files |
t |
Non- nilmeans delete auto-save files whenever the "real" file is saved. |
buffer-offer-save |
nil |
Non- nilmeans offer to save the current buffer when exiting Emacs, even if the buffer is not a file. |
vc-handled-backends |
(RCS CVS SVN SCCS Arch MCVS) |
Version control systems used with the vcpackage. The order in which they appear in this list controls the order in which they will be attempted when working with a new file. |
vc-display-status |
t |
If non- nil, display the version number and the locked state in the mode line. |
vc-keep-workfiles |
t |
If non- nil, do not delete work files after you register changes with the version control system. |
vc-mistrust-permissions |
nil |
If non- nil, do not assume that a file's owner ID and permission flags reflect version control system's idea of file's ownership and permission; get this information directly from version control system. |
vc-suppress-confirm |
nil |
If non- nil, do not ask for confirmation before performing version control actions. |
vc-initial-comment |
nil |
If non- nil, prompt for an initial comment when registering a file with version control system. |
vc-make-backup-files |
nil |
If non- nil, make standard Emacs backups of files registered with version control. |
diff-switches |
-c |
Command-line switches used to control the format of change reports by VC as well as diff.el . |
Table A-2. Searching and replacing
Table A-2. Searching and replacing ( 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.
)
Читать дальше