Xah Emacs Blog Archive 2015-03

Discovered some cheap numerical keypads. $10 or $15. See Programable Keypads

For how, see Keyboard: How to set Number Keypad as Function Keys for Windows, Linux, Mac (major rewrite)

For why, see: Keyboard: Increase Productivity Using Function Keys (major rewrite)

History of Key Shortcuts: Emacs, vim, WASD, Etc (minor update)

ELisp: Exit Loop or Function (throw, catch) (minor update)

Evolution of Laptop Keyboard (and the relation to keybinding design) (complete rewrite)

Emacs: Move Cursor to Bracket 🚀 (updated code for xah-backward-quote, xah-forward-quote )

also updated: Emacs: Move Cursor to Punctuation 🚀

The move by bracket command is very useful. In my own key/command system, it ranks higher than save-buffer, see:

For all major modes:

 401940   21.98%  self-insert-command
 154128    8.43%  next-line
 108513    5.93%  previous-line
  95666    5.23%  xah-beginning-of-line-or-block
  84774    4.64%  xah-end-of-line-or-block
  53126    2.91%  backward-word
  52823    2.89%  forward-word
  45963    2.51%  xfk-command-mode-activate
  45463    2.49%  isearch-printing-char
  41233    2.26%  mwheel-scroll
  36823    2.01%  xfk-insert-mode-activate
  32211    1.76%  xah-close-current-buffer
  31340    1.71%  subword-forward
  31294    1.71%  yank
  25881    1.42%  subword-backward
  25596    1.40%  delete-backward-char
  25236    1.38%  newline
  25194    1.38%  xah-backward-left-bracket
  23900    1.31%  handle-switch-frame
  20477    1.12%  save-buffer
  18314    1.00%  backward-char

see also Emacs: Command Frequency Statistics

Completely revamped. All you ever need to know about setting keys in linux. Linux: Keyboard Software Guide ⌨

for Mac and Microsoft Windows, see:

new finding, cheap ergonomic mouse. Ergonomic Mouse, Vertical Mouse

How to Add/Change Firefox Keyboard Shortcuts (minor update)

Linux: How to Swap Mouse Buttons

the extract URL code i posted 10 days ago has a major bug. It misses some URL. Fixed now. Emacs: HTML, Extract URL 🚀

Linux: How to Set F2 F3 F4 to Cut Copy Paste Globally ⌨

Now you can buy the Truly Ergonomic Keyboard on amazon. See the amazon links in Truly Ergonomic Keyboard

more update on the Happy Hacking Keyboard. Model type-s, and Japanese layout.

ELisp: HTML Amazon URL Linkify (updated. old article.)

every year, i must recommend this for uber operational efficiency: Mouse Hover to Auto-Raise Window

and ban double-click: Single-click Open File

Google Code Shutting Down, Future of ErgoEmacs

Google announced that they are going to shut down Google Code. See http://google-opensource.blogspot.com/2015/03/farewell-to-google-code.html

ErgoEmacs is hosted on Google Code. https://code.google.com/p/ergoemacs/. What to do?

ErgoEmacs started in 2008. The goal was to create a binary usable emacs for Microsoft Windows, Mac. Note: a binary, that anyone who never heard of emacs can download and immediatly be productive like a notepad. No tech talk, but dense tech info available for those who look. Not some “welcome to the powerful editor emacs you must have heard, welcome to the elite hacker commu, now git clone this and that and unix then make, and set env var bash linux and open source be with you happy hacking fuck”

Thanks to David Capello [https://davidcapello.com/]'s work over the years, the Windows binary became a reality and served its purpose well for a number of years. However, Mac version never came about.

Since about 2012, ErgoEmacs became largely dormant. David got other things to do, and i also got busy with other things. I still work on lots elisp code, but the last Microsoft Windows binary is in .

During these years, a number of things has happened. Emacs now has a package system. So, installing third-party software becomes easier and coherent. (but still require experienced emacs knowledge and programer know-how.)

Matthew L Fidler, took over the ErgoEmacs keybinding part (aka “ergoemacs-mode”), which is the main part of ErgoEmacs. Matthew has brought ergoemacs-mode to a new level, and is now released as a independent package at https://ergoemacs.github.io/, and it's also made into FSF's Elpa repository, as well as on MELPA repository.

ergoemacs-mode is the bulk of ErgoEmacs.

So, now, what should we do with ErgoEmacs? I sure don't have time to lead in building binaries. A downloadable binary that people can use right away is still lacking in the emacs community. But, i can't do it.

I'm thinking, i'll just use Google's provided tool to “migrate” to github, and just leave it there. Since 2012 ErgoEmacs binary for Microsoft Windows might still be useful for some.


spent the whole day in LXDE today. Truly love the UI. Simple, 100% purely Functional. Unfortunately, am abandoning it now, because its window manager, the OpenBox, doesn't support display composition. I wouldn't care, except, in practice, it screws display, that is, slow update sometimes or trails or broken window. Am back to XFCE.

see also: Master Linux in 1 Week

new. Linux Keybinding Tutorial Index

Linux: 「wmctrl」 Add Keyboard Shortcuts to Switch to App ⌨ (new, on its own page)

Linux: LXDE: How to Change/Add Keyboard Shortcuts ⌨

after some 3 years of Linux desktop, I've discovered the dream key system in Linux, and that's LXDE. It has a well-documented config file, and allows you to have key sequences, and also app-dependent keyset.

First tutorial: Linux: LXDE Set Key Repeat Rate ⌨

Much more will follow.

Lots mouse from China are making inroads in USA market. For a 18-buttons mouse, this is half the price than Logitech or Razer. Redragon Perdition 18-Buttons Mouse 红龙 灭世 鼠标

I don't use a mouse when in emacs. However, when using a computer, switching apps, browser, switching tabs/windows/apps, closing tab/windows, inter-operation among programs, i require at least a 7-buttons mouse. It's just much more efficient.

Emacs: HTML, Extract URL 🚀 (complete rewrite. Now no longer depends on a lib.)

new commands xah-dired-show-metadata and xah-dired-remove-all-metadata. Emacs: Xah Dired Mode (xah-dired.el)

Command to Delete EXIF Data in Image Files


Cooler Master Storm Recon Mouse. Added a photo gallery and review.

If you are looking for a keyboard with tiny space bar, which gives you more thumb keys, now you can buy them cheap. See updated: Should You Type Space After Comma? and Tiny Space Bar on Japanese Keyboards

Emacs: Delete Whitespace around Cursor 🚀

fixed a command behavior that i wanted for years. Before, if current line has character, after calling this command twice will remove all whitespace around cursor, but will not remove blank links before or after. (you have to delete char forward or backward to do so) Now this command will do so.

here's illustration. Suppose you have:



Before, if you call the command, it'll do nothing. Because the current line (liney)'s cursor neighbor already don't have any whitespaces.

now, it'll remove neighbor blank lines, to this:


and if called again, it becomes:


Emacs Keys: Layout Diagram (old post. repost)

yasnippet or not yasnippet

do you use yasnippet mode?

it should be ban'd the hell out of this earth.

back in 2010, i fell for it. Thinking it is most easy-to-use, no elisp required, template system for emacs.

well, it is, but emacs built-in abbrev is much better. And learning a little emacs lisp is far more powerful.

practically speaking, you don't need yasnippet. You can just use emacs abbrev to create any templates anytimes you want, in any mode, and have full control, and interactively too.

i may have a tutorial about how to create a major-mode-specific abbrev set coming up.

for now, you can read

by the way, yasnippet came up because of the TextMate editor. TextMate was hot during 2009, and it has a template system. So, emacs hackers copied it. (it was a Chinese emacs hacker who goes by the name of PlusKid) (and, by the way, before yasnippet, there's other templates systems, skeletons and several others.)

yasnippet is fine. The “problem” is that it creates another redundant layer that doesn't do much. The time you learn yasnippet you can learn about emacs abbrev system and elisp, and be far more powerful.

emacs: show last keystrokes

suppose you typed some keybinding, and emacs did something you don't understand. You can view what's your last few keystrokes.

Alt+x view-lossage to show last keystrokes.

Here's typical mine:

emacs view lossage xah fly keys 2015-03-01
emacs view-lossage

Note, no Ctrl or Alt keys. This is Emacs: Xah Fly Keys.

see also Ban Key Chords

a new version of Emacs LSL Mode (xlsl-mode) for Linden Scripting Language

this is for Second Life's scripting language, for a 3D virtual world. Quite interesting. See: Xah's Second Life Linden Scripting Language (LSL) Tutorial

For Second Life, see Xah Second Life