by Sacha Chua

Emacs 22 pre-release: Goodies galore

News
Nov 14, 20065 mins

The classic full-featured text editor now blends into the desktop environment better, and offers not just powerful development features such as IDE-like syntax checking on the fly, but also tools that administrators will appreciate, such as transparent editing of files on SSH-reachable hosts.

After six years of development, Emacs 22 is in prerelease – and it’s now available for Cygwin, FreeBSD/Alpha, GNU/Linux on S390, GNU/Linux on X86-64, and MacOS X, too.

After six years of development, Emacs 22 is in prerelease – and it’s now available for Cygwin, FreeBSD/Alpha, GNU/Linux on S390, GNU/Linux on X86-64 and MacOS X, too. So many features are packed into Emacs 22, proving once again that Emacs is more than a programmer’s text editor, it’s a way of life.

Emacs is getting better at fitting in with other applications on your system. Emacs 22 can be built with GTK+ widgets to match the rest of your desktop. The menu option “Open File…” has been divided into “New File…” and “Open File…”. You can drag-and-drop files and text into windows or directory buffers from X11. Emacs 22 also includes a complete emulation of the standard keybindings in Microsoft Windows, Macintosh, GNOME and KDE. If Ctrl-X for Cut is hardwired into your fingers, give cua-mode a try.

Developers: Check syntax on the fly

Compilation modes now differentiate errors and warnings by color. “Next error follow minor mode” speeds up browsing through errors in your source code.

But don’t wait for a compile to find out that you’ve misspelled an identifier. Find out with Flymake, on-the-fly syntax checking of C, C++, C#, XML, HTML, Perl, Java, LaTeX, and IDL files. Flymake supports the Make and Ant build tools, too.

Edit remote files

If you edit remote files, check out Transparent Remote Access, Multiple Protocol (TRAMP), now part of Emacs 22. TRAMP allows you to open and edit files over SSH, RSH, Telnet, FTP, Rsync, Kerberos or Samba (for Common Internet File System servers and Microsoft Windows shares). When you save the file, the remote copy is automatically updated. No more fiddling around with FTP clients or repetitive scp commands! Edit files as other users with su and sudo, too.

Multihop methods allow you to chain together as many methods as you want, so you can easily edit a file that you can only reach by SSHing to a host, sshing to another host, and then sudo-ing to a different user. TRAMP handles all of the back-end negotiations. If you set this up with passwordless authentication, such as SSH key authentication, you might even forget that you’re editing files four hops away.

TRAMP also works with the Emacs directory editor, Dired. You can open remote directories and edit them just like any other directory on your local system. For example, C-x C-f /ssh:webhost:~/public_html/ gets me a directory listing.

Need to change a lot of files, links or permissions? Switch to wdired-mode (also new in Emacs 22) and edit the directory buffer like a text file, with all the convenience of search and replace and keyboard macros. This works remotely, too.

Emacs as a way of life: Work with text-based spreadsheets

While everyone’s abuzz over Google’s assimilation of word processing and spreadsheets, Emacs 22 quietly sneaks in some office functionality. The Simple Emacs Spreadsheet (SES) can import and export tab-separated values, sort values, format values for display, and calculate cell formulas using Emacs Lisp.

For other calculations, you’ve never had a desk calculator like Emacs Calc. Here’s a partial list from the manual: “Arithmetic on rational numbers, complex numbers (rectangular and polar), error forms with standard deviations, open and closed intervals, vectors and matrices, dates and times, infinities, sets, quantities with units, and algebraic formulas.”

And that’s just arithmetic. Wait until you try out its features for programming, financial calculations, prime factorization, symbolic calculus, and plotting with GNUPlot. It can even intelligently evaluate formulas and insert the result as pretty-printed text.

Chat on the Internet

Internet Relay Chat (IRC) has been called a great time-waster, but it can be useful when you need a quick answer to a question or a way to get your mind out of a rut. Emacs 22 includes not one but two ways to connect to your favorite channels, whether it’s hanging out on irc.freenode.net #emacs or connecting to the Bitlbee instant messaging gateway so that you can chat with friends on Yahoo Messenger, AIM, MSN, ICQ and Jabber. RCIRC is a bare-bones IRC client, while Emacs Relay Chat contains a bucketload of features including (of all things) Morse code support.

Deal with information overload

Org-mode is an outline-based organizer for keeping track of tasks, deadlines and notes. Everything can be hyperlinked to Web sites, e-mail, Usenet messages, Big Brother Database contact records, and any files. Speaking of organizers: tumme.el makes it easier to manage images. You can view all the images in a directory as thumbnails, and you can tag or manipulate them using the same commands you already use for your files.

Addicted to RSS and ATOM feeds? Check out Newsticker, which retrieves and displays headlines from your favorite news sites and blogs. You can quickly open headlined stories in your favorite browser, or write functions to automatically process the headlines.

Deep Emacs hackery

Emacs hackers, rejoice! Emacs 22 comes with nifty features to make Emacs programming much easier. The new kmacro.el package cuts down on the number of keystrokes you need to make keyboard macros. ? in regular expression replacements allow you to interactively query for the replacement string. Not only that, but a lot of commands have been updated to work with transient-mark-mode, limiting their effect to the current region.

Testcover.el covers Emacs Lisp code with splotches of colors indicating how well they’ve been tested. New benchmarking support makes it easier to find bottlenecks in your code. New buttons and tree widgets enrich the user interface.