07/09/2008
Google Region
Somehow, this didn't occur to me until today: it would be really great to select some text and enter a key command to search for that text on google. It may have taken me a long time to realize I wanted something like that, but I've used it today more times than I'd like to admit.
Anyways, here's how to make that happen in emacs, complete with a "control-c g" shortcut.
;; google-region (defun google-region (&optional flags) "Google the selected region" (interactive) (let ((query (buffer-substring (region-beginning) (region-end)))) (browse-url (concat "http://www.google.com/search?ie=utf-8&oe=utf-8&q=" query)))) ;; press control-c g to google the selected region (global-set-key (kbd "C-c g") 'google-region)
06/28/2008
Shifd from emacs
I made a little extension for emacs so that I could shifd things directly from inside the editor. Here's a video of it in action. If you're interested in the extension, let me know. I can make it available.
Emacs and Shifd from Ted Roden on Vimeo.
03/06/2008
goto-minibuffer
I almost posted this yesterday, but I got stuck trying to explain when it's useful. Every example that I came up with seemed to have a perfectly acceptable workaround.
However, after another day of emacs usage, I decided that there are indeed times when you need to move the focus to the minibuffer window. Sometimes that is easier said than done. It's especially hard if you have a lot of windows open in one frame and move around a lot, particularly when you do that in the middle of entering a command in the minibuffer.
I couldn't find anything built in that would do that. So I wrote a tiny function to handle it. Without further ado, here is some elisp to move the focus directly to the minibuffer.
(defun teds-goto-minibuffer () "Move cursor to minibuffer window" (interactive) (select-window (minibuffer-window))) (global-set-key (kbd "C-c m") 'teds-goto-minibuffer)
If you know of a simpler1 way of doing this, please let me know.
1. Hitting control-o a bunch of times doesn't count as simple. We're talking about when you have a bunch of windows open.
03/03/2008
Soxiam's Testimonial
Sox has long been my personal motivational speaker. His geek cred has recently gone through the roof; he's quoted directly on the aquamacs-devel mailing list.
![]() |
| Grow Your Manhood |
02/25/2008
Aquamacs 1.3
After several long nights and weekends, I'm happy to say the new Aquamacs.org site has launched. This also happens to coincide (more or less) with the release of Aquamacs 1.3, so you should probably upgrade.
Around Christmas, I decided that I should try to time pushing the new site with the next release of the actual software. So I spent some time redesigning the site during my holiday break. After my initial mockups, I spent a lot of time on the development list finalizing the design and working out most of the quirks.
I didn't save a lot of the iterations, but here's how it looked along the way. (Click for bigger images).
| This is how the site looked initially. |
| My first mockup. |
| The final version. |
02/18/2008
Uptimes
When I restart emacs (aquamacs) for whatever reason, I'm always curious to see how long it's been running. I've included the list of uptimes1 below. My record for this computer seems to be 15 and a half days. I'm sure I can do better on other computers, but that's pretty good for a laptop that I abuse pretty regularly.
![]() |
| Uptimes |
1. If you have uptimes.el, and (require uptimes.el) in your .emacs file, meta-x uptimes will show you the uptimes screen.
12/12/2007
Emacs Spreadsheet
I'm constantly finding myself in situations where I need to do something on my computer, but I can't do in Emacs. Like, filling out text boxes on the web. Or posting to my blog. Or just using a shell.
Of course, time after time, I find out that I can use Emacs for these problems. For example, with It's all text, I can edit form fields with Emacs. Muse mode and a couple of scripts allows me to edit and post to my blog. And eshell has changed my life as far as using the command line goes.
The latest problem I faced was that I needed to use a spreadsheet. I'm not a spreadsheet power-user, I just needed something to help me visualize a few simple calculations. I wanted to tweak a number here, a percent there and see all the numbers change. Perfect job for a spreadsheet. But how the heck do you do it in Emacs? Simple, ses-mode. It does everything I need for a basic spreadsheet, and it's in Emacs. Either you know why this is a good thing, or you totally don't. There is very little middle-ground.
With ses-mode, you can deal with ranges of cells, do all kinds of calculations and if you install the right modes, you can even graph it with pretty charts. I haven't tried that, but it sounds awesome.
Anyways, here's a screen shot of an example spreadsheet inside Emacs. You can even see the cell's formula in the mini-buffer, in lisp. So cool!
![]() |
| "I'm a business man, I need a spreadsheet" |
12/01/2007
Writing a book
A few months ago, I decided I needed to write a book. I've never written a book before, but I haven't done a lot of things before, so why should never having done it stop me. So I got started. I researched companies, figured out how many books I'd need to sell to make it worth my while, realized that I could do that, and got started. I wrote... about 3 or 4 chapters.
Then I found out someone whose blog that I read was writing a very similar book. Too similar in fact. I mean, if I read someone's blog, doesn't that mean that others read it too? Well, I decided that I have enough on my plate, and that I'd rather read the book than write it. So I haven't touched it since then. (Despite, having those chapters written, they're solid gold I tell you! GOLD!)
I'm super happy to know a book like it is getting written. If it isn't as good as I can do, then I'll write it myself, otherwise I can't wait to read it. So, I'm officially putting in my notice that I am going to pre-order it.
11/27/2007
Aquamacs File System Coding
At work I'm always downloading strange file formats, or creating files with weird names to test our system. Doing this, I noticed that aquamacs was having trouble with some of them and I couldn't figure out why. Until today! Previously, one of my test files was pretty messed up via dired and eshell, take a look:
![]() |
| Bad! |
But all it takes is a quick addition to your .emacs file and it's fixed! You just need to specify the "file name system coding," and there is even one included with aquamacs that is designed for the mac file system. Just add the following line to your .emacs file and you're all set:
(set-file-name-coding-system 'utf-8m)
After that, everything is rosy.
![]() |
| Good! |
11/26/2007
Prying Eyes Privacy
When you spend your days inside emacs, you tend to do just about everything from there. Natrually, emacs is a good place to create lists of things, and around the holidays it's a good place to draft lists of gifts you're thinking about giving. Chances are, you've created these lists before.
As an emacs user, I'm going to guess that you are the teensiest bit concerned about security. In this case, you don't want a lot of hassle. You just want to ensure that if someone opens the file, they won't know what you're planning on buying for them. So, instead of hiding your file somewhere of deep in your hard drive or insisting that your significant other doesn't touch your computer until after the New Year, you can probably just use what I'm calling Prying Eyes Privacy.
All you need to do is "encrypt" it with rot13. For those who don't know, that means you need to look at each letter and rotate 13 places in the alphabet. So A becomes N, B becomes O, L becomes Y, and so on. Normally, this would involve writing perl script, C# app1 or something similar. It isn't hard to decrypt this type of file, but you probably can't look at a file encrypted this way and figure out what it says. It's perfect for a gift list. And it's super easy to do in emacs.
So, start your list in emacs. You can use org-mode, outline-mode, or whatever you please. It doesn't matter. But before you save it, do this:
- Select the whole buffer (control-x h, or with you mouse)
- meta-x rot13-region
That will turn the phrase "I think the lady wants a stuffed moose" into "V guvax gur ynql jnagf n fghssrq zbbfr."
Next time you open the file up, you can just do those steps again and it will magically reappear. Now, whoever you're buying gifts for can open this file up whenever they want. Unless he/she has some kind of amazing alphabet arithmetic abilities (unlikely) or can use emacs (even less likely) you'll be in the clear. If your significant other can use emacs, this probably isn't going to cut it.
1. Just before I got my current job, I found a job posting for a C# programmer. In order to submit your resume, you had to write a C# program to "decrypt" an email address via rot 13 and send along your source. I had never used C# and had the day off, so I decided to give it a try. I spent longer downloading and installing a complier than I did writing the code. But, I sent in my solution along with a terribly outdated resume and within minutes they got back to me saying they had to speak with me. I thought that was a bad sign. If you can learn enough of a language in just a few minutes to impress the tech people at a company (this wasn't a recruiter), you don't want to work there.




