If grep -nis run on only one file, it just prints line numbers; Emacs forces it to print the filename as well in this case by appending the dummy file /dev/null to the grepcommand.
Actually, there is a limit to how far back (in characters) Emacs searches for a matching open parenthesis: this is the value of the variable blink-matching-paren-distance, which defaults to 25,600. The duration of the "flash" is also configurable: it's the value (in seconds) of blink-matching-delay, whose default value is 1.
The key binding is mnemonic for Lisp programmers because comments in Lisp start with semicolons.
etagsis also a platform-specific feature. The etagsfacility is available on Unix platforms, including Mac OS X.
We know! There is no M-x cc-mode. It can be confusing. Just try to remember that the modes are named directly after the language they support.
The function commands have "defun" in their names because they are actually adaptations of analogous commands in Lisp mode; a defun is a function definition in Lisp.
These emulate electric-c-modein the old Gosling Emacs.
Before we take you through the installation process, we should mention two caveats. XEmacs has the JDEE built-in, though it is often out-of-date. TEI-Emacs, an add-on for Linux and Windows described in Chapter 8, also includes the JDEE.
For Mac OS X users, the classes normally found in tools.jar are already a permanent part of the standard classes.jar so they are always available—even though tools.jar isn't in any of the library locations.
The indentation style is bound up in the Emacs Lisp code for Lisp mode. If you are an experienced Lisp hacker, you can examine the code for lisp-mode.elin the Emacs Lisp directory and determine how to customize indentation the way you wish. A good place to start looking is the function lisp-indent-line.
This key binding may not work on all platforms. If it is intercepted by the operating system (as it is on Red Hat Linux), type Esc Tabinstead (remember to release Escbefore you press Tab).
This Lisp mode command ( run-lisp) was designed to run with the franz Lisp system on BSD Unix systems, though it should work with other Lisp interpreters.
You can use Metain place of Esc, but the bindings are still stored in the esc-map.
There is a better way of dealing with this situation, which we will cover in the next chapter.
Lisp programmers will understand that there are other ways to add to auto-mode-alist, such as append.
We recommend Lisp by Patrick Henry Winston and Berthold Klaus Paul Horn (Addison Wesley).
Experienced Lisp programmers should note that Emacs Lisp most closely resembles MacLisp, with a few Common Lisp features added. More complete Common Lisp emulation can be had by loading the package cl
(see Appendix B).
Integers are also allowed where characters are expected. The ASCII code is used on most machines. For example, the number 65 is interpreted as the character A on such a machine.
We hope that Lisp purists will forgive us for calling setqa function, for the sake of simplicity, rather than a form , which it technically is.
Statement blocks are actually optional; some programmers like to omit the final statement block, leaving the final "condition" as an "otherwise" clause to be executed if all of the preceding conditions evaluate to nil
. If the statement block is omitted, the value returned by cond
is simply the value of the condition.
Emacs uses ASCII codes (on most machines) to build ranges, but you shouldn't depend on this fact; it is better to stick to dependable things, like all-lowercase or all-uppercase alphabet subsets or [0-9]for digits, and avoid potentially nonportable items, like [A-z]and ranges involving punctuation characters.
The version presented in this example is simplified for reasons of space and clarity. The full version, which adds the ability to insert templates for function definitions and process arbitrary Emacs Lisp functions within template files, is also available for download.
Unfortunately, because such variables are defined before they are made local to the mode, there is still a problem with name clashes with global variables. Therefore, it is still important to use names that aren't already used for global variables. A good strategy for avoiding this is to use variable names that start with the name of the mode.
Experienced Lisp programmers should note that Emacs Lisp does not supply standard contractions like cadr
, cdar
, and so on.
APL programmers will recognize these as variations of that language's "scan" operators.
The second argument to re-search-forward—and other search functions—gives a bound to the search: if given an integer value n
don't search past character position n
. A value of nil
, the default, means don't give the search a bound.
There is also the option "-f function-name "
which causes Emacs to run the function function-name
at startup, with no arguments.
You don't need to have registered a file from VC to use VC on it. VC works just fine on a preexisting tree of version-controlled files.
Minor tricky detail: your very first vc-next-actionon a new work file normally takes you from "unregistered" through "registered, unlocked," and then to "locked, editable." Why make you do two commands for those two steps when one will cover the typical case? If you want to register a file but not check it out, use C-x v i(for vc-register). With the advent of CVS, this point becomes largely moot as you'll see in Figure 12-2.
This is a slight oversimplification. VC actually has its own script as a wrapper around SCCS's sccsdiff, in order to give it a calling sequence more like RCS's rcsdiff.
Depending on your system and its permissions, you may have to switch to the root user using suto install Emacs. In that case, you won't need to preface the final makecommand with sudo.
One of the authors was not able to see the splash screen, but the install worked fine nonetheless. We say forge ahead even if you don't see it.
Читать дальше