Emacs 23.1 was released earlier this week, and if you haven’t upgraded yet you should. It comes with all sorts of new goodies. I’ve been working off of the emacs-snapshot package for Ubuntu, which has many of these new features, but the final version is much more polished. While I won’t cover all of the new features in this blog, I will cover the ones that seem most interesting to me. For the full list of enhancements, use ‘C-h n’ to view the NEWS file.
The big improvement many people are talking about is the new font antialiasing. If you compile with the Xft library, your emacs fonts will be antialiased, making it much prettier and more readable. Support for internationalization was also increased, with the Emacs character set now having 4 times the space that Unicode does.
Emacs can now also be started as a daemon, with emacs –daemon. This will start emacs in the background and allow you to connect to it with emacsclient for very fast load times without having to load your initializations. While you could run a server in emacs before this, you had to have an open instance of emacs - you coulnd’t have one running in the background like you can now. If you have a fairly stable configuration his would be great - I change mine all the time, sometimes to states that require me to restart, so I’m not sure how much I’ll use it.
Visual-line-mode is a new addition that is set on by default. It is something of a replacement for longlines-mode. It doesn’t insert soft line breaks, so it works better on larger files, and it wraps to whatever your screen is, so if you are using longlines-mode you should switch to using visual-line-mode. C-n and C-p will move by visual lines, which may screw up some macros, but mostly it seems to work quite well.
Transient-mark-mode is now enabled by default. I used to not like this mode, but it’s grown on
me. Transient-mark-mode is a mode that highlights the region between point and mark(most of the time) and has many commands operate on the highlighted region instead of the entire buffer. I think transient-mark-mode being on is a good default, since people new to emacs will be used to their old editors highlighting their selection.
The VC system, which integrates with many different version control systems, now has support for changelists. Previously, each file was checked in individually, which isn’t what you want for systems such as SVN or GIT. I’m going to need to play with this a bit more before I understand quite how it works; I’m working on a few posts about a few different version control systems, so I’ll probably discuss this more then. A new command was also added, vc-dir, which shows you the VC status for the directory and subdirectory. This will tell you which files need updates, which were added, etc.
C-l, which previously just recentered the screen to have the point in the center, has been slightly improved. While C-l once will act the old way, pressing it again will then scroll the buffer so that the point is at the top of the screen, and then C-l a third time will scroll the buffer so that the point is at the bottom of the screen.
Lots of new modes were added to Emacs-23. Doc-view is one useful one, which allows displaying PDF, PS, and DVI files in emacs buffers. You can even search through the pages, although this only gets you to the correct page. While useful, I find this mode suffers from some inherent limitations caused by Emacs’ display system, which requires the PDFs to be converted to PNG files first. This means you can’t select text in it, highlight the actual match for your search, etc. Another cool addition is EasyPG support. A library I used to use for numbering lines, linum.el, is now in Emacs proper. nXML, a very mode for editing and validating XML documents, and ruby-mode are also included. The last mode I’m going to mention is proced, which is like dired for processes. I find it very useful, allowing you to do things like mark arbitrary processes and send a signal to all of them.
Another new feature is directory-local-variables. You could previously have file-local-variables by adding text to your file, but if you wanted many variables applied to everything in a directory you had to implement this on your own. You can now just have a .dir-locals.el, with a specially-formatted list such as:
((nil . ((indent-tabs-mode . t) (fill-column . 80))) (c-mode . ((c-file-style . "BSD"))) (java-mode . ((c-file-style . "BSD"))) ("src/imported" . ((nil . ((change-log-default-name . "ChangeLog.local"))))))
Which is a list specifying that in indent-tabs-mode should be t and fill-column should be 80 in every mode. In c- and java-mode, c-file-style should be “BSD”, and in and that any file in the “src/imported” subdirectory should have the change-log-default-name of “ChangeLog.local”.
Then of course we come to emacs-uptime. It does pretty much what you’d expect: run this function and it tells you how long your Emacs session has been running. Mine’s only at about 14 hours right now, due to having to restart due to some issues when I tried to install ropemacs.
That’s all I’m going to cover in this post, but there is much more that was changed and added to. I highly recommend upgrading to emacs23 and reading the NEWS file to find out all the other changes that you may not know about. You can access this file by using ‘C-h n’.