Книга: Learning GNU Emacs, 3rd Edition
9.4.1 Java Mode
9.4.1 Java Mode
Java mode shares all of the formatting and font features mentioned above, but understands the Java language specifically. You get thrown into Java mode when opening any .java file.
When working in Java mode, you have exactly the same features available as you do in C mode. Syntax highlighting handles Java keywords and syntax when font-lock mode is turned on. You can navigate Java commands using M-a and M-e. When commenting out a region, it uses the C++ style // comments.
You'll notice a small augmentation in the indent alignment commands if you choose to spread your throws or extends clauses over multiple lines. For example, consider the following method declaration:
public Object getNetResource(String host, int port, String resName)
throws IllegalArgumentException,
IOException,
SQLException,
FileNotFoundException
{
If you mark the region and run M-C- to indent the region, it uses a special alignment for the exception list:
public Object getNetResource(String host, int port, String resName)
throws IllegalArgumentException,
IOException,
SQLException,
FileNotFoundException
{
It all works like it is supposed to—just with Java as the language at the core of the action. However, for more than casual Java editing, you should read the next section on the JDEE.
- 1.3 A Word About Modes
- Table B-1. Support for Java, C, and C++ programming
- Выполнение XSLT-преобразований в Java
- 13. Document Object Model
- 14. Лекция: Пакет java.util
- Взаимодействие Xalan с Java
- Листинг 9.3. Пример JavaScript-файла, закрывающего всплывающее окно
- 1.1.4. Model Explorer - навигатор модели
- Глава 12 Краткий курс JavaScript
- Листинг 14.2. Использование параметра XMLWriteMode при сохранении объекта ADO.NET DataSet
- Entering and Exiting PHP Mode
- Справочник по базовому JavaScript