Xah Emacs Blog Archive 2011-12 to 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 Replace 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.

“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.

Elisp: 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

Xah's Blogs Reminder

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 F2 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 ProblemEmacs Idolization: Have You Read the Emacs Manual From Cover to Cover?)

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: Convert Image Files in Dired

Updated: Emacs: Regex Tutorial.

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

Like my tutorial? Put $5 at patreon

Or Buy Xah Emacs Tutorial

Or buy a nice keyboard: Best Keyboard for Emacs

Ask me question on patreon