Archive for the 'Emacs' Category
I knew it was a bad idea to upgrade my OS during NaNoWriMo, since every sub-point release tends to do bad things to Emacs. So instead of waiting for December, I waited for the weekend. The Mac is up to 10.4.3 and emacs is now the Nov. 05 Carbon Emacs Package. It’s slow and flaky, but good enough for NaNo use.
[Update] I cleaned most of the crud out of the site-lisp directory inside the package, and that sped emacs up a lot. I kept the mac, psgml and html stuff, plus subdirs.el. The files site-start.el, site-start.elc, and site-start.d/carbon-emacs-builtin-aspell.el are vital; don’t delete them or stuff will break when you least expect it.
The real location of site-lisp is inside the Emacs.app package (control-click and choose Show Package Contents) in Contents/Resources/share/emacs/22.0.50/site-lisp.
[Update #2] Canned Emacs slowed to a crawl, so in the end I gave up, checked the emacs project out from savannah.org again, and built my own emacs. There was only one problem: no more mac-command-key-is-meta variable. I’ve become so addicted to Emacs with my special mac-ified command key shortcuts that the real Emacs was completely unusable.
Fortunately, a bit of googling showed me the new way to make the command key alt and the alt key meta:
(setq mac-command-modifier 'alt) (setq mac-option-modifier 'meta)
Other allowed options are ‘ctrl and ‘hyper. I confess, I don’t know what hyper is.
You may recall that I downloaded a new prefab Emacs a couple of weeks ago after a few of my builds from CVS failed. Emacs turned flakey on me today, so I checked the Apple downloads section and found out that a second build was released just a few days after I got mine: Carbon Emacs, Sept ‘05, v2. Download and enjoy.
Remember, it’s not just a text editor—it’s a way of life!
Filk of the day: Hope Eyrie by Leslie Fish (1975)
I just downloaded a free preference panel called Textpander. I had been using Quicksilver for some simple text insertion (especially a hrefs), but it annoyed me to no end because it used the clipboard to paste in the html code, nuking the URL I had saved in the clipboard to put into the hyperlink. Textpander (optionally) gives you your clipboard contents back again.
Update: Either Textpander or the latest security/QuickTime update (2005-008/7.0.2, respectively) killed Emacs. I tried reinstalling–no luck. So I checked out the latest from cvs and rebuilt. (I’m still building the self-contained installer, just to be safe.) After a long, long build, Emacs is back, if a little funky on the font settings. Whew!
Update #2: Some days are good CVS days, some days are bad CVS days. My home-built emacs turned out to be funkier than I thought (lots of issues with tex-verbatim, so I downloaded a pre-built emacs from Japan. So far, so good.
After much experimentation, I got Emacs to build and run on Tiger. I ran mac/make-package instead of the usual configure/make/install cycle, as advised by Stefan Tilkov. That built an installer instead of the usual Emacs.app, but the installer worked fine. (I started with a clean checkout, but make-package wouldn’t bootstrap so I just copied a bootstrapped lisp directory over from one of my failed attempts and that worked.)
So it seems that something is messed up in the main emacs configure script in CVS, since I saw someone else suggest commenting out the link to fink. I may have lost ispell, but at least I have Emacs back.
As I mentioned last night, I had to rebuild emacs for both MacOS 10.4.0 and 10.4.1. The second build failed, and then I screwed up my CVS (that is, my copy of the emacs source code) by trying to check out an older version. Let that be a lesson to you young’uns: Always Google first!
Google tells me I’m not alone in my emacs difficulties. I shouldn’t have been able to build Emacs for 10.4.0 and now my luck has run out. I could check out the source tree again and try a patch, but it will probably be easier to download one of the Tiger binaries that are floating around:
- Aquamacs claims to work with Tiger.
- John Wiseman’s build is hosted by a friend.
- This mystery build which you can also download from Apple is probably your best bet.
Of course, you could skip them all and use the built-in terminal emacs, but I prefer the GUI.
[Update] I should have downloaded Aquamacs, because the other two didn’t work. I’m trying some hacks now, but they’re not going well.
Warning: Geeking ahead!
So I’ve been trying to reproduce a real operating system on Windows. The very first thing I did, of course, was install Emacs. Today I noticed that Emacs wasn’t finding RCS (my favorite version control system) even though I have Cygwin installed. I found the answer in noniq’s .emacs file:
Fic of the day: Wherever You Roam (SG-1, PG, AU), a short sequel to “A White Dove.”
I’ve always wondered why Emacs didn’t highlight my PHP code automagically. Today I was working on a site and decided enough was enough—I would find a way to get pretty PHP.
Fortunately, there’s a website devoted to this very issue: k-fish.de: Emacs & PHP. He said his favorite was the SourceForge PHP mode for Emacs project so I went with that. Here’s the .emacs code to autoload it:
(autoload 'php-mode "php-mode" "Yay PHP" t) (setq auto-mode-alist (cons '(".php$" . php-mode) auto-mode-alist)) (setq auto-mode-alist (cons '(".phps$" . php-mode) auto-mode-alist))
The emacs extension of the day is tabbar.el. I was feeling jealous of cool new Mac text editors like TextMate with their drawers and their clickable tab-like buttons. How I wished that emacs had a pop-out drawer, or at the very least, tabs.
Although it is documented, tabbar has no handy start-up guide for beginners. With the help of Zhou Chen’s Emacs Tools page, I figured out that I needed to add
(require 'tabbar) (tabbar-mode)
to my .emacs file just to get the tab bar to show up.
Next, I wanted to do a keybinding to get emacs to switch tabs with command-shift-left-arrow and command-shift-right-arrow, the way Safari and iTerm do. With the help of the emacs function keys info node, I found the right combination for my .emacs file:
(global-set-key [A-S-left] 'tabbar-backward) (global-set-key [A-S-right] 'tabbar-forward)
[The above may depend on (setq mac-command-key-is-meta nil). If you don’t have that setting, then try M-S-left and M-S-right instead.] You can also assign ‘tabbar-backward-group and ‘tabbar-forward-group the same way, but ‘tabbar-backward and ‘tabbar-forward will scroll through groups as well so I didn’t bother.
I didn’t like the way tabbar assigned my buffers to groups, so I wrote my own version of the tabbar-buffer-groups function and put it in my .emacs file, too.