Xah Emacs Blog Archive 2011-12

ErgoEmacs Hit Hacker News

ErgoEmacs hits Hacker News last week. See Emacs for the rest of us: ErgoEmacs @ Source news.ycombinator.com

Thanks to “Macro Lapse” (aka macco) for posting.

Here's a review of ErgoEmacs Keybinding.

Ergonomic Emacs Keybindings By Jeff Pace. At http://jpace.wordpress.com/2011/12/30/ergonomic-emacs-keybindings/

Updated: Emacs: Cycle Space Hyphen Underscore

Updated: Emacs Lisp Text Processing: find-file vs with-temp-buffer.

In my previous report, the timing difference is by a factor of 45. That's because i had stuff in my init file. (i have hooks for both find-file and html-mode, and that probably caused the major slowdown.) Now, the factor is actually just about 5.

You should still use with-temp-buffer instead of find-file besides speed, because find-file has quite some side effects.

Big thanks to [Trey Jackson https://plus.google.com/116944459982600529677/about].

“Truly Ergonomic Keyboard” has Docked!

Truly Ergonomic Keyboard Review

Updated: Computer Keyboard Design Flaws.

Updated. The ultimate emacs keyboard: μTRON Keyboard. Well, one of the ultimate.

Emacs Lisp: Convert Lisp Form to XML Form

Jon Snader (jcs) wrote a series of nice tutorial about how to transform text in the form of lisp expression into XML form, with a focus on making each head of lisp expression a executable function itself (as opposed to just parsing a input text and spit out XML form). In the last article, he proposed a little challenge for readers to solve. See:

If you got stuck, check out his previous articles (linked in his article), which shows you how.

Emacs Lisp Text Processing: find-file vs with-temp-buffer

Emacs: How to Turn Major/Minor Mode on/off?

This is a frequently confusing point someone just asked again in gnu.emacs.help. How to turn a mode on/off? Is it a function or variable? Is it {1, 0} or {t, nil}? See:

Updated: Emacs Menu Usability Problem.

How to Choose a Keyboard with Good Function Keys

see Why Function Keys F1 to F12 Are Useful

Fixing Emacs's Scratch Buffer

Emacs's scratch buffer has lots of problems. This is a controversial issue, because the scratch buffer is one of those things that serves as a identity of emacs. Any criticism on it is like attacking emacs.

But i tell you, dear readers, frankly and directly, this is a emacs cult problem and i've wrote about often. (See: Emacs Undo and Emacs Cult Problem (2011)Emacs: Have You Read Emacs Manual? (2010))

For a detailed description of scratch buffer problems, see: Emacs: Problems of the Scratch Buffer.

If you are a user of ErgoEmacs Keybinding, the problem is already fixed for you. Simply press Ctrl+n and new scratch will be created for you, and when you close a modified unsaved buffer, it'll prompt you for save.

In ErgoEmacs keybinding, it's implemented by 2 commands: {new-empty-buffer, close-current-buffer}. The “new-empty-buffer” simply creates a new buffer, titled “untitled”, “untitled<2>”, etc. The code for “close-current-buffer” is a bit more involved. It kills the current buffer, but check if it is modified, but also, add the closed file into a list, so that people can re-open the last closed file, much like web browser's Ctrl+Shift+t (supported by Firefox, IE9, Chrome, Opera, except Safari.). The key is the same. The key to close current file is also the browser standard Ctrl+w.

If you really want to stick with GNU emacs's keys, but want these convenient functions, you can download and copy/modify the code from ErgoEmacs keybinding. Or, J V Toups provided a implementation for persistent scratch buffer. See:

Emacs: Xah Dired Mode (xah-dired.el)

Updated: Emacs: Regular Expression.

Note: last week's exercise about writing “latitude-longitude-decimalize” will be coming up.