Rob recently pointed me to rcodetools and its included emacs integration. Specifically, I’ve only had the chance to play with xmpfilter, but so far, I’m very impressed. Let’s use it to annotate lines in a ruby buffer with intermediate results.
Package Faves: rcodetools
July 21st, 2007 by Ryan McGeary · 6 Comments
→ 6 CommentsTags:faves · reviews · ruby
Package Faves: emacs-rails
June 10th, 2007 by Rob Christie · 10 Comments
The emacs-rails package turns emacs into a Ruby on Rails IDE. To put it simply, I love the package. It gets me excited to see this much active development for an emacs mode. The emacs wiki has a laundry list of the functionality that the mode provides. I don’t think a single blog post can do the functionality justice, so I just want to hightlight a few of the features below (and expand on other features in later posts). [Read more →]
→ 10 CommentsTags:faves · rails · reviews · ruby
Quick Tip: delete-blank-lines
June 7th, 2007 by Ryan McGeary · 3 Comments
The delete-blank-lines function is a simple yet handy tool to have in your bag of tricks. It is bound to C-x C-o. There isn’t a whole lot of magic surrounding it’s usage, so I’ll just quote the built-in help directly:
On blank line, delete all surrounding blank lines, leaving just one.
On isolated blank line, delete that one.
On nonblank line, delete any immediately following blank lines.
→ 3 CommentsTags:quick · tips
GNU Emacs 22 Released
June 3rd, 2007 by Rob Christie · 7 Comments
Emacs 22 was officially released yesterday.
Emacs version 22 includes GTK+ toolkit support, enhanced mouse support, a new keyboard macro system, improved Unicode support, and drag-and-drop operation on X, plus many new modes and packages including a graphical user interface to GDB, Python mode, the mathematical tool Calc, the remote file editing system Tramp, and more.
You can get it here.
→ 7 CommentsTags:news
Quick Tip: Managing ChangeLogs
May 29th, 2007 by Ryan McGeary · 1 Comment
Ever wonder how people keep such organized ChangeLog files in the root of their source trees? I’m sure some are just anal enough to manually manage them. I know I’ve done so on smaller projects, but I find it too much of a hassle for anything larger.
So, what do people use on larger projects? Believe it or not, there are actually GNU conventions for styling these files, and emacs includes an add-log package to help adhere to these conventions.
The command add-change-log-entry-other-window (C-x 4 a) automatically adds a new entry to the closest change log file found up the parent directory hierarchy. If none exists, a new change log file is created in your current directory, and the formatting is organized for you:

The command vc-update-change-log (C-x v a) finds the change log file and add entries from the recent version control logs. Apparently, this only works with RCS or CVS. For subversion, you can try vc-comment-to-change-log (Emacs 21) or log-edit-comment-to-change-log (Emacs 22), but this might require some customization to suit you.
To change the email address listed in your change log entries, edit the user-mail-address variable. To change the default change log file name, edit the change-log-default-name variable.
(setq user-mail-address "ryan@example.com") ;; default: user@host (setq change-log-default-name "CHANGELOG") ;; default: ChangeLog
Some might say that keeping a ChangeLog file is defeated by public subversion repositories. I tend to agree for most circumstances, but there are some cases where a local, easily readable ChangeLog file is a good idea. Besides, it’s the cool thing to do.
The emacs manual has more information on change logs.
→ 1 CommentTags:quick · tips
Quick Tip: compilation-skip-threshold
May 22nd, 2007 by Rob Christie · No Comments
compilation-mode has a nice feature so that you can skip over your info and warning level messages and jump right to those nasty errors. Set the variable compilation-skip-threshold to 2 so that M-n and M-p will jump to the next or previous error respectively. The other possible settings for this variable are:
2 — skip anything less than error
1 — skip anything less than warning, or
0 — don’t skip any messages.
Note that all messages not positively identified as warning or info are considered errors.
→ No CommentsTags:java · quick · tips
Package Faves: psvn
May 17th, 2007 by Rob Christie · 6 Comments
If you interact with a Subversion version controlled repository and you use emacs, then you are probably already using this package. However, I use this package every day, and if someone was just starting to use emacs, this would be on my short list of packages that must be installed.
psvn mode is similar to pcl-cvs for the Concurrent Version System (CVS). It is a frontend to the subversion client (svn). M-x svn-status will prompt you for the location of your working directory (or subdirectory). Once it is entered a new buffer, *svn-status* , will open up with a status of all files within that directory and any subdirectories. It essentially runs svn status -v. This view of your working copy of the repository shows the status of the files. You have the option of hiding unchanged files with the command _. You can mark multiple files to be committed, and then commit them with the command c which will in turn bring up an edit window where you can write the comment associated with your commit. Additionally, there are commands for diffing files, editing properties, and just about every other interaction you have with subversion. Be sure to check the following options:
svn-status-verbose– Setting this to nil will makeM-x svn-statusrun without the -v option at the command line.
svn-status-hide-unmodified– Setting this automatically performs the toggle that you can do with_when in the *svn-status* buffer, so that you only see files with a status that has changed in your working directory.
The package and its commands become an extension of the way you work with your files within emacs. It’s one of my favorites because it doesn’t get in the way of your normal process.
→ 6 CommentsTags:faves · newbie · reviews
Emacs Key Bindings in Windows
May 10th, 2007 by Ryan McGeary · 1 Comment
This might be old news to some, but it was new to me.
XKeymacs is a keyboard utility to realize emacs-like usability on all windows applications. With XKeymacs you can use emacs keybindings with any windows application. You can create a keyboard macro and assign any shortcut key too. You also get bash-like command completion in your DOS shell.
This may very well void the need for Emacs Keybindings in MS Word.
I only played with it briefly as I’m no longer Windows-bound, but my initial impressions were good. Here is a more comprehensive review of XKeymacs.
Once you install it, the bindings are global – they work in Windows Explorer, Microsoft Word, Excel, in text-boxes and combo-boxes – everywhere. As for applications that provide their own readline bindings (such as Gnu Emacs on Windows), you must setup key-binding exceptions…
→ 1 CommentTags:misc · reviews · windows
A Little Bit of History
May 4th, 2007 by Rob Christie · No Comments
I just ran across this article. The Church of Emacs is a good read… no it’s not from alt.religion.emacs. The article is more of a history of emacs with some great references as well.
→ No CommentsTags:misc · news
Quick Tip: dos2unix, et al
April 30th, 2007 by Ryan McGeary · 4 Comments
I despise the fact that we live in a world with different end-of-line file formats. Windows/DOS uses CRLF, Unix uses LF, and Mac’s used to use CR1. Thankfully, Mac’s started to adopt the Unix format when OS X was released — if only Windows could do the same.
What I despise even more is that some editors seem to be incapable of determining the difference between a DOS and Unix file. There’s nothing worse than finding a once, perfect Unix file corrupted by a small section of lines with CRLFs while the rest of the file keeps only LFs. Most of the time, the blame can be placed on one’s editor configuration, but I also blame some editor defaults for not at least maintaining the format that the file was opened in. To be fair, most power-editors like emacs, vim, TextMate, etc behave “correctly” by default and keep the format that the file was opened in, but many others (unnamed) do not.
There’s not a whole lot we can do to avoid these problems without hounding our peers, but there are ways to fix these problems after they’re found.
Let’s fix the nastier problem first. When you find a file corrupted with half LFs and half CRLFs, strip out the ^M (CR) characters with a quick search and replace. Run M-% (query-replace) and substitute C-q C-m with nothing. C-q runs quoted-insert and is useful for inserting control characters (e.g. ^M, entered as C-m). Afterwards hit the exclamation point (!) to tell query-replace to replace all matches with no questions.
Other times, you will run into DOS formatted files and will just want to convert them to Unix format for consistency sake. To do this, open the buffer and run C-x <RET> f then enter unix or undecided-unix when prompted for the new coding system. This runs set-buffer-file-coding-system and the result is very similar to running dos2unix myfile.txt at the command line.
1 CR is Carriage Return. LF is Line Feed (aka Newline).