emacs's cua-mode naming problems

Perm url with updates: http://xahlee.org/emacs/modernization_cua-mode.html

Emacs cua-mode Problems

Xah Lee, 2010-06-19

This page discuss some issues about emacs cua-mode. In particular, problems in naming.

On 2010-06-18 const451 <const...@gmail.com> wrote:

Is there a plugin that uses standard key shortcuts for text manipulation such as Ctrl-C, Ctrl-V, Ctrl-Z, etc.? I think they are faster to use than the default shortcuts in emacs.

I run Ubuntu Lucid (newbie).

You can turn on cua-mode by Alt+x cua-mode.

Or you can install the ErgoEmacs Keybinding, then it'll also support standard Open, Close, Save, Save As, New... about 7 of them.

The Naming of cua-Mode

Emacs's cua-mode, is named after the IBM's Common User Accesss standard. However, according to Wikipedia IBM Common User Access the IBM CUA standard does not say cut/copy/paste are X C V keys. Quote:

The Cut command is ⇧ Shift+Del; Copy is Ctrl+Ins; Paste is ⇧ Shift+Ins;

The Z X C V keys for undo/cut/copy/paste is popularized by Apple starting in mid 1980s.

Emacs's naming of cua-mode is very bad. Because:

  • CUA name is not intuitive. Very few people know what CUA is. Among all people who makes a living by coding, i'd say less than 0.05% know what CUA means. Personally, i own and use Mac daily since 1991 to today, started my programing career in 1995, read ALL issues of Macworld , MacUser magazines in the 1990s till they closed doors. I never heard of CUA until using a GUI based emacs on the Mac in about 2006.
  • Emacs's cua-mode's behavior is not IBM's CUA standard at all. All it does is basically just the X C V keys, and these may not even be part of IBM's CUA.

Why was it named cua-mode?

Emacs's developers named it cua-mode probably because of a ego/cult problem. They needed a name for this widely needed mode, but naming it anything that might relate to Microsoft Windows or Apple is a political problem to FSF/GNU.

(note: Richard Stallman HATES Microsoft and also HATES Apple. GNU's stance against Microsoft is well known, from GNU/Richard's writings especially in 1980s and 1990s. Richard has published several essays that advise programers to avoid mentioning the term Microsoft, as a political tactic for advancing GNU, and this is well known. Throughout 1990s, GNU boycotted Apple partly because Apple sued Microsoft for copying Apple's GUI interface. This boycott is officially ceased in i think around 2000. See: “End of Apple Boycott” from gnu.org GNU's Bulletin, vol. 1 no. 18 )

Better Naming

The cua-mode is probably better named XCV-mode or copy-paste-key-mode, and the menu name should be “XCV keys for Cut/Copy/Paste”. The mode name change is probably too late, but the menu name change can still be done. The name “XCV keys for Cut/Copy/Paste” does not relate any commercial organization, and is easy for people to understand what it means, and it more accurately describe what cua-mode do.

Missing Z for Undo

The cua-mode has a major problem in that it supports XCV but not Z for undo. The Z for undo is part of the XCV, and the standard undo/redo behavior is also widely asked for. Z for undo is also standard across Microsoft/Mac/Linuxes today.

Terminologies of plug-in/add-on/shortcut vs Emacs Conventions

On 2010-06-19, Evans Winner <tho...@unm.edu> wrote:

By the way, and just for your information, Emacs users typically do not call Emacs Lisp packages "plugins." More often they call them libraries or packages.

Calling it plug-in is not emacs convention but i think is very good terminology. It is intuitive, and widely used. For example, browsers used the term plug-ins since ~1995. Mathematica, a programing language calls its extra packages/libraries plug-ins or add-ons when in a user context. Firefox also clarified a bit in their terminology of plug-in vs add-on about 1 or 2 years ago. e.g. plug-in are those like Java, Flash, QuickTime engines, while add-on often are little user oriented utilities.

plug-in and add-on are intuitive terms that anyone can easily understand what they mean just by the word itself. While, package, library, module, is more oriented to software engineering in a technical context.

Keybinding vs Keyboard Shortcut

If the code implements a major or minor mode, they typically call it a "mode."  They also usually don't use the term "shortcut," possibly because that seems to imply some other manner of input that is privileged over use of the keyboard.  The phrase "key binding" is more often used, because that is what you do: you bind a function to a key or key combination.

Similar to the library/package/module vs plug-in/add-on argument, same applies here. The term “Keyboard shortcut” or “hotkey” is suitable in the context of users using a software application, while keybinding is suitable for programing and software engineering.

Keyboard shortcut is a better term also because it is the term used in Microsoft, Mac OS X, Linuxes today.

“keybinding” is in fact technically not correct in the user application context. When you press a key to invoke a command, you are not binding a key. You are using a KEY that has a keybinding. The gist is that it is a user interface convenience, a sort of alias, therefore: shortcut, a shortcut through the keyboard, thus “keyboard shortcut”, is better than keybinding.

These distinctions are important.

I'm writing this because it is common in emacs community to bug new users about these kinda things. When the issue is about some technical aspects, such as elisp macros vs keyboard macros, such that using the wrong term leads to wrong results or confusion, then it is good. However, when fuzzing about a terminology that has little practical impact other than political, then i think it's very harmful to emacs's health. It just turns away users and keep brewing the emacs cult.

Hunspell Tutorial

Perm url with updates: http://xahlee.org/comp/hunspell_spell_checking.html

Hunspell Tutorial

Xah Lee, 2010-06-16

This page shows you the basics of using hunspell.

Hunspell is a mature and modern spell checker, better than aspell. It is used by Apple, Google, Opera, Firefox, OpenOffice.org.

The info on this page is tested with hunspell version 1.2.8.

Hunspell home page is at hunspell.sourceforge.net. Basic history at Wikipedia Hunspell.

# short usage summary
hunspell -h

How to check words interactively?

“cd” to the hunspell dir, then do:

hunspell -d en_US

that will start the program in a interactive shell. Type word and press enter to spell check it. To exit, press “Ctrl+c”.

Setting Environment Variables Path

If you have problem starting hunspell, you might need to set up some Environment Variables. Here's some example on Windows using cmd.exe:

Windows with cmd.exe

Here's a example for adding hunspell executable to environment variable PATH in Windows Vista using cmd.exe:

setx PATH "C:\Program Files (x86)\ErgoEmacs 1.8.1\hunspell\;%PATH%"

You also need to set its dictionary file path. Like this:

setx DICPATH "C:\Program Files (x86)\ErgoEmacs 1.8.1\hunspell"

Note: hunspell 1.2.8 Windows port has a bug. The DICTIONARY and or DICPATH paths must be set in the Windows Registry. It won't work if these are set as session variables.

Once you have set these env vars, you can just type “hunspell” in any dir in the command line.

Unix with Bash

On unix bash, do it like this:

export PATH=/usr/local/bin:$PATH
export DICPATH=/usr/lib/firefox/dictionaries

Simple Usage

How to spell check a file interactively?

hunspell -d en_US filename.txt

It launches into a interactive command line interface.

How to spell check a file in batch?

cat myFile.txt | hunspell
hunspell -l myFile.txt

The output is long list with annoying “*” for each line. To not show those “*”, do this:

cat myFile.txt | hunspell -i utf-8 | grep -v \* | uniq

To list only the misspelled words, do:

cat myFile.txt | hunspell -l -i utf-8

How to specify the file's encoding

Use the “-i” option, like this:

cat myFile.txt | hunspell -l -i utf-8

How to check a single word?

echo badword | hunspell

echo somee words ar good some badd | hunspell

Where is personal dictionary at?

It's at “~/.hunspell_default”.

arrows in unicode

Perm url with updates: http://xahlee.org/comp/unicode_arrows.html

Arrows in Unicode

Xah Lee, 2010-06-19, 2010-06-22

This page collects arrow characters in Unicode.

← → ↑ ↓ ↔ ↕ ↖ ↗ ↘ ↙ ↮

⇦ ⇨ ⇧ ⇩ ⬄ ⇳ ⬀ ⬁ ⬂ ⬃

⬅ ⬆ ⬇ ⬈ ⬉ ⬊ ⬋ ⬌ ⬍

⇐ ⇒ ⇑ ⇓ ⇔ ⇕ ⇖ ⇗ ⇘ ⇙ ⇍ ⇏ ⇎ ⟸ ⟹ ⟺

↤ ↦ ↥ ↧ ⇤ ⇥ ⤒ ⤓ ↨

⇆ ⇄ ⇅ ⇵ ⇈ ⇊ ⇇ ⇉

⇠ ⇢ ⇡ ⇣

⇚ ⇛ ⤊ ⤋ ⭅ ⭆ ⟰ ⟱

↩ ↪ ↫ ↬

↞ ↟ ↠ ↡ ↚ ↛

↜ ↝ ↢ ↣

↰ ↱ ↲ ↳ ⬐ ⬎ ⬑ ⬏ ↴ ↵

↺ ↻ ⥀ ⥁ ⟲⟳

↶ ↷ ⤾ ⤿ ⤸ ⤹ ⤺ ⤻

↼ ⇀ ↿ ↾ ↽ ⇁ ⇂ ⇃ ⇋ ⇌

⇜ ⇝ ⬳ ⟿ ⬱ ⇶ ⇽ ⇾ ⇿ ⟵ ⟶ ⟷ ⟻ ⟼

⥊ ⥋ ⥌ ⥍ ⥎ ⥏ ⥐ ⥑ ⥒ ⥓ ⥔ ⥕ ⥖ ⥗ ⥘ ⥙

⥚ ⥛ ⥜ ⥝ ⥞ ⥟ ⥠ ⥡ ⥢ ⥣ ⥤ ⥥ ⥦ ⥨ ⥧ ⥩ ⥮⥯ ⥪ ⥫ ⥬ ⥭

⇷ ⇸ ⤉ ⤈ ⇹

⇺ ⇻ ⇞ ⇟ ⇼

⬴ ⤀ ⬵ ⤁

⬹ ⤔

⬺ ⤕ ⤂ ⤃ ⤄ ⬶ ⤅ ⬻ ⤖ ⬼ ⤗ ⬽ ⤘

⤆ ⤇ ⤌ ⤍ ⤎ ⤏ ⤙ ⤚ ⤛ ⤜ ⤝ ⤞ ⤟ ⤠

⤡ ⤢ ⤣ ⤤ ⤥ ⤦ ⤪ ⤨ ⤧ ⤩ ⤭ ⤮ ⤯ ⤰ ⤱ ⤲ ⤫ ⤬

⥼ ⥽ ⥾ ⥿

⤶ ⤷ ⤴ ⤵

⤼ ⤽

⥂ ⥃ ⥄ ⭀⥱ ⥶⥸ ⭂ ⭈ ⭊ ⥵ ⭁ ⭇ ⭉ ⥲ ⭋ ⭌ ⥳ ⥴ ⥆ ⥅

⬷ ⤐ ⬸ ⤑ ⬿ ⤳ ⥹ ⥻

⬰⇴ ⥈ ⬾ ⥇ ⬲ ⟴

⥷ ⭃ ⥺ ⭄

⇱ ⇲

↸ ↹ ↯ ↭ ➾ ⥉ ⥰

⇪ ⇫ ⇬ ⇭ ⇮ ⇯ ⇰ ☚ ☛ ☜ ☝ ☞ ☟ ➔ ➘ ➙ ➚ ➛ ➜ ➝ ➞ ➟ ➠ ➡ ➢ ➣ ➤ ➥ ➦ ➧ ➨ ➩ ➪ ➫ ➬ ➭ ➮ ➯ ➱ ➲ ➳ ➴ ➵ ➶ ➷ ➸ ➹ ➺ ➻ ➼ ➽

There are about ~340 of them. These are from several different blocks of Unicode, including:

  • Miscellaneous Symbols
  • Dingbats
  • Miscellaneous Mathematical Symbols-A
  • Supplemental Arrows-A
  • Supplemental Arrows-B
  • Miscellaneous Mathematical Symbols-B
  • Supplemental Mathematical Operators
  • Miscellaneous Symbols and Arrows

For detail about these code blocks, see: Mapping of Unicode character planes.

To find out the code point for the char, use emacs. See:

Random Notes

Some notes: it took me something like 20 hours over 3 days to collect and organize these arrows. They are scattered in different unicode blocks, and are hard to find. Also, there are a lot symmetry issues, and some mirror image isn't there. Here's some details of my experience.

Char Scattered

They are scattered in different code blocks. Typically, the most common ones are collected in “Symbols, Arrows (2190–21FF)”. For many special ones, usually in the beginning there's just a right pointing one, because left pointing one is seldomly or never used. But later, it's realized the left pointing one is important too, for one reason or another, and sometimes there's a need just for completeness because Unicode became more wide spread. So, the left pointing one gets added to another block. Thus you have “Supplemental Arrows-A” and “Supplemental Arrows-B”. For similar reasons, other symmetric versions such as upward and or downward version are scattered in wildly different blocks.

Missing Symmetric Versions

Also, lots of these arrows are from math. When mathematicians use a arrow-like glyph in their notation, usually they are not doing it in any formal way in the sense of formalism, so their notation use is very sloppy. Typically they never thought about or care if that symbol is a operator or just a glyph to convey a concept. So, in unicode, the arrows gets into one of these blocks: “Miscellaneous Mathematical Symbols-B”, “Supplemental Mathematical Operators”, “Miscellaneous Symbols and Arrows”. Often, the left/right pair are in different blocks, or the up/down version are not even in a math category.

Here's a example: ⇹ ⇺ ⇻ ⇞ ⇟ ⇼. Note there's no vertical version of . Another: ⥂ ⥃ ⥄. Note that there's no mirror glyph of

Many arrows do not have symmetric versions. Symmetry here can be left/right mirror, up/down mirror, or combination of them (e.g. 90° rotation). Examples: ↴ ↵ ↸ ↹ ⤺ ⤻ ⤼ ⤽ ⤪ ⤨ ⤧ ⤩ ⤭ ⤮ ⤯ ⤰ ⤱ ⤲.

Ordering Problem

Also, when trying to order them, i ran into the problem of devising a ordering scheme. For example, usually i order them by left right up down, like this:. ← → ↑ ↓. But now look at these: ⇆ ⇄ ⇅ ⇵. For the verticle pair, which should come first?

Here's another example of the complexity. There are these chars:


If you analyze their names, you can see that a circle can be divided into 8 parts. Left, right, top, bottom, then 4 of the diagonal arcs. Each glyph can be clockwise or anti-clockwise. There are a combination of 16 possibilities. First of all, note that not all of them is present. But given these chars, how do you order them?

Font Problems

Note that some left/right pairs looks very different, even in the same font. For example: ⬾ ⥇ ⬲ ⟴ ⬳ ⟿ ⬱ ⇶. Also note, that the font design for first char there is wrong. That char's unicode name is “LEFTWARDS ARROW THROUGH X”. It should not be “Two-headed arrow” as in some other chars.

Typically, the rightward version has better font, correctly designed and vector based, because it was used more often.


Hunspell Path Pain

Perm url with updates: http://xahlee.org/comp/hunspell_spell_path_pain.html

Hunspell Path Pain

Xah Lee, 2010-06-18

Am slightly frustrated with hunspell. Spend about 5 hours yesterday and today on it. Am trying to get it to work with emacs's speck-mode, on Windows.

Being a kinda thorough person, i started to work on this problem from the ground up, by first trying to read the doc, become familiar with its basic usages, syntax, and get it to run on the command line only. Once i am familar with it on command line, then i can move on to understand the integration and config issues with emacs and speck-mode, by getting it to work in my personal emacs setup. Then, i can move on to the next step, of working ErgoEmac's installation elisp config files. Great and careful master plan. (actually, i went one step more thorough than this, by first understanding aspell, of which, i did yesterday, the result is here: aspell Tutorial.)

So, first job is to get it to run on the command line.

The path to hunspell on my machine is at:

C:\Program Files (x86)\ErgoEmacs 1.8.1\hunspell\

Chang path into the dir, then i can run:

hunspell -d en_US

Good. Now i need set the hunspell executable path in my env var PATH so i can run it elsewhere. Using Windows's cmd.exe, it's like this:

set PATH="C:\Program Files (x86)\ErgoEmacs 1.8.1\hunspell\";%PATH%

Easy. This is just for the current session. I can set it permanently later using “setx” or PowerShell once i got all env var issues resolved. Now, i can call hunspell from elsewhere, however, “hunspell -d en_US” gives the error:

c:\Users\xah>hunspell -d en_US
Can't open affix or dictionary files.

This works:

c:\Users\xah>hunspell -d "C:\Program Files (x86)\ErgoEmacs 1.8.1\hunspell\en_US"

Hunspell 1.2.8

According to the man page, there are the 3 env vars. Here i quote the section of the man page as it is written literally:

  Similar to -d.

  Dictionary path.

  Equivalent to -p.

I spent 2 hours trying a combination of the following variations:

set DICTIONARY="C:\Program Files (x86)\ErgoEmacs 1.8.1\hunspell\en_US"
set DICPATH="C:\Program Files (x86)\ErgoEmacs 1.8.1\hunspell\en_US"

set DICPATH="C:\Program Files (x86)\ErgoEmacs 1.8.1\hunspell"
set DICPATH="C:\Program Files (x86)\ErgoEmacs 1.8.1\hunspell\en_US"

set DICPATH="C:\Program Files (x86)\ErgoEmacs 1.8.1\hunspell\en_US"

set DICTIONARY="C:\Program Files (x86)\ErgoEmacs 1.8.1\hunspell\en_US"
set DICPATH=""

Won't work. Also, i got fancy and imagined maybe the DICPATH in the manual is a typo, maybe it should be DICTPATH? No.

Its man page, in the tradition of unix, is the most fucking shit possible. The syntax of the command hunspell is also shit, like every unix command line program.

The “-d” option can be either like “en_US” or the full path to the file but sans the suffix “.dic” and “.aff”. WTF? (note that “en_US” involves 2 files, the dictionary file “en_US.dic” and the affix file “en_US.aff”.) Further, it can be a sequence of dictionaries, separated by comma, and seems like space after comma is not allowed. So what if you want to give multiple dictionaries with full path that has spaces in them? (it is probably impossible, to have a mathematically simple yet precise spec, on how the program takes the parameter.)

If you search the web, for the exact error message “"Can't open affix or dictionary files."”, there are 392 results, all over from debian, redhat, fedora etc. What kinda incompetent shit created this situation?

Also, the manual link at home page http://hunspell.sourceforge.net/ is a “404 Error – Page Not Found”. Typical of open source tech geeker's quality, of those elite programers so proud of calling themselfs the idiotic term “hackers”. Sure, they can write complex programs, but do these idiots have a minimal concept of quality? Maybe they are not very endowned in the department of writing documentation, understandable, but do they at least TRY to have anything working well? What possible incompetence, can explain that the big fat manual link on the home page being broken? How long has it been broken?

Eventually, it hit on me. Maybe the port to Windows is buggy, that it doesn't check session env var but only look in the registry? So, i did:

setx DICPATH "C:\Program Files (x86)\ErgoEmacs 1.8.1\hunspell"

That solved it. It is when actually writing this rant at this point, i got it to work.

God, writing things out helps. Helps my anger, helps my thinking.

Now, is my incomplete understanding of Windows Environment Variables to blame, or is this a bug of hunspell Windows port?

PS Note that Windows shell is also a deeply layed baggage of shit. Note the syntax of “set” and “setx” are different, in fact “setx” is a hack added into cmd.exe, which itself is several evolution and reincarnation over the past 20 years. But that's another tale. Glad Microsoft has PowerShell bundled in Windows 7.


Text Editor's Cursor Movement Behavior (emacs, vi, Notepad++)

Perm url with updates: http://xahlee.org/emacs/text_editor_cursor_behavior.html

Text Editor's Cursor Movement Behavior (emacs, vi, Notepad++)

Xah Lee, 2010-06-17

This article discusses some differences of cursor movement behavior among editors. That is, when you press “Ctrl+”, on a line of programing language code with lots of different sequence of symbols, where exactly does the cursor stop at?

Always End at Beginning of Word?

Type the following in your favorite text editor.

something in the water does not compute

Now, you can try the word movement in different editors.

I tested this on Notepad, Notepad++, vim, emacs, Mac's TextEdit.

In Notepad, Notepad++, vim, the cursor always ends at the beginning of each word.

In emacs and TextEdit, they end in the beginning of the word if you are moving backward, but ends at the end of the word if you are moving forward.

That's the first major difference.

Does Movement Depends on the Language Mode?

Now, try this line:

something !! in @@ the ## water $$ does %% not ^^ compute

Now, vim and Notepad++ 's behavior are identical. Their behavior is pretty simple and like before. They simply put the cursor at the beginning of each string sequence, doesn't matter what the characters are. Notepad is similar, except that it will move into between %%.

Emacs and TextEdit behaved similarly. Emacs will skip the symbol clusters !!, @@, ##, ^^ entirely, while stopping at boundaries of $$ and %%. (when emacs is in text-mode) TextEdit will stop in middle of $$ and ^^, but skip the other symbol clusters entirely.

I don't know about other editors, but i understand the behavior of emacs well. Emacs has a syntax table concept. Each and every character is classified into one of “whitespace”, “word”, “symbol”, “punctuation”, and others. When you use backward-word, it simply move untill it reaches a char that's not in the “word” group.

Each major mode's value of syntax table are usually different. So, depending on which mode you are in, it'll either skip a character sequence of identical chars entirely, or stop at their boundary.

(info "(elisp) Syntax Tables")

The question is whether other editor's word movement behavior changes depending on the what language mode it is currently in. And if so, how the behavior changes? do they use a concept similar to emacs's syntax table?

In Notepad++, cursor word-motion behavior does not change with respect to what language mode you are in. Some 5 min test shows nor for vim.

More Test

Now, create a file of this content for more test.

something in the water does not compute
something !! in @@ the ## water $$ does %% not ^^ compute
(defun insert-p-tag () "Insert <p></p> at cursor point."
  (interactive) (insert "<p></p>") (backward-char 4))
for (my $i = 0; $i < 9; $i++) { print "done!";}
<a><b>a b c</b> d e</a>

Answer this:

  • Does the positions the cursor stop depends on whether you are moving left or right?
  • Does the word motion behavior change depending on what language mode you are in?
  • What is your editor? on what OS?

Which is More Efficient?

Now, the interesting question is which model is more efficient for general everyday coding of different languages.

First question is: is it more efficient in general for left/right word motions to always land in the left boundary the word as in vim, Notepad, Notepad++ ?

Certainly i think it is more intuitive that way. But otherwise i don't know.

The second question is: whether it is good to have the movement change depending on the language mode.

I don't know. But again it seems more intuitive that way, because users have good expectation where the cursor will stop regardless what language he's coding. Though, of course it MAY be less efficient, because logically one'd think that it might be better to have word motion behavior adopt to different language. But am not sure about this in real world situations.

Though, i do find emacs syntax table annoying from my experience of working with it a bit in the past few years... from the little i know, i felt that it doesn't do much, its power to model syntax is quite weak, and very complicated to use... but i don't know for sure.

This article is inspired from Paul Drummond question in gnu.emacs.help

Mac OS X 10.6 no longer supports PowerPC Macs

Perm url with updates: http://xahlee.org/comp/blog.html

As you may know, Mac OS X 10.6, released in 2009, no longer supports Macs based on PowerPC chip. My Mac is the last PPC chip Mac bought in late 2005.

Note from Wikipedia Mac OS X Snow Leopard, quote:

Some ways of running 10.6 Snow Leopard on certain unsupported hardware have been discovered. Users who have access to supported hardware have installed Snow Leopard on the supported machine then simply moved the hard drive to the unsupported machine. Alternatively, the Snow Leopard Installation DVD can be booted on a supported Mac, then installed on an unsupported Mac via the Firewire Target Disk Mode.

So, the decision of this must went something like this: Let's get some engineers to put in code so that old mac owner's can't upgrade. It's time for them to buy a new Mac!

See also: Switching from Mac/Unix To PC/Windows.

the Borderline, by Sharon Apple

Perm url with updates: http://xahlee.org/Periodic_dosage_dir/sanga_pemci/borderline_sharon_apple.html

the Borderline, by Sharon Apple

Xah Lee, 2010-06-16

“the Borderline”, a song sung by Akino Arai (b1959).

This song is dazed, dreamy, demented, psychedelic, and exceedingly sultry.

Title: the Borderline
Singer: Akino Arai
Lyrics: Yoko Kanno
Music: Yoko Kanno?
The Borderline

Red and Roses
Lips and Breath
Hair and Dolls
They're look a-like

Smoke and Mist
Night and Midnight
The deep and Hell
They really get me

Flip and Fly
Heal and Feel
Flower and Poison
are on the brink

The Borderline The Borderline

Belly and jell-o
Crack and Jazz
Arch and Bridge
They're look a-like

Meet me and Hit me
Tiny and Sticky Candy
Kiss and Eating
are just same things

Free and Fall and
Love and Low
Evil make you feel good
can't help doing that

The Borderline The Borderline
Sharon apple 2605

Sharon Apple

In Macross plus, Sharon Apple is a artificial idol. She exists as a computer which produces a hologram. While her producers say that she has a artificial intelligence that includes emotional programming, it is later revealed that this programming is incomplete and her emotions are provided by Myung Fang Lone. (quote from Wikipedia)

aspell Tutorial

Perm url with updates: http://xahlee.org/comp/aspell_spell_checking.html

aspell Tutorial

Xah Lee,

This page shows you the basics of using aspell.


Aspell home page is at: aspell.net.

Short intro by Wikipedia GNU Aspell.

Full manual is at the home page. You can also read it from the command line. Type:

# short usage summary
aspell usage

# short doc.
man aspell

# long list of all options
aspell help 

# full manual
info aspell

Simple Usage

How to spell check a file interactively?

aspell check filename.txt

It launches into a interactive prompt.

How to spell check a file in batch?

cat myFile.txt | aspell pipe --encoding utf-8

The output is long list with annoying “*” for each line. To avoid that, use the following.

cat myFile.txt | aspell pipe --encoding utf-8 | grep -v \* | uniq

To list only the misspelled words, do:

cat myFile.txt | aspell list --encoding utf-8

How to use aspell to check a single word?

echo badword | aspell pipe

echo somee words ar good some badd | aspell pipe

Where is personal dictionary at?

It's at “~/.aspell.en.pws”. The file is just a list of words, one on each line (except the first line). Not sorted.

When you spell check a doc, such as “aspell check myFile.txt”, you can type “a” to add it.

There are also features for checking similar sounding words or word's root or affix and surfixes. e.g.

aspell soundslike
aspell munch

However, am not sure to use them. They didn't work on my machine.


Cursum Perficio, by Enya

Perm url with updates: http://xahlee.org/Periodic_dosage_dir/sanga_pemci/Cursum_Perficio_Enya.html

Cursum Perficio, by Enya

Xah Lee, 2010-06-16

“Cursum Perficio” (1988), sung by Enya (Eithne Ní Bhraonáin, b1961)

The lyrics is in Latin, and is written by Roma Ryan.

Here's the lyrics, in Latin, with English translation, from the official site enya.com.

Cursum perficio
Verbum (sat) sapienti
eo plus cupiunt
Quo plus habent, eo plus cupiunt
Post nubila, Phoebus
(in) aeternum
...my journey ends here...
...a word is enough for the wise;
   the more one has, the more he desires...
...after the clouds, the light...  

Cursum Perficio, Enya The text shown on the screen is someone's try in putting the sound in English. It's not accurate, but quite funny. I especially like the way where the words “eterna” gets larger and larger.

Love this song. It also reminds me of Elfen Lied (Elven Song).

Enya Watermark album

Cover of the album “Watermark”.

Her official youtube site with many videos is at: youtube.com enyatv.

Keyboard Hardware's Influence on Keyboard Shortcut Design

Perm url with updates: http://xahlee.org/emacs/keyboard_hardware_and_key_choices.html

Keyboard Hardware's Influence on Keyboard Shortcut Design (How Emacs and vi keys came to be)

Xah Lee, 2010-06-16, 2011-01-14

In my study of keyboarding in the past 20 years, i've noticed that the choices of many shortcuts in many apps are adopted to the many aspects of the keyboard hardware of the time in use by the community. Emacs's keybindings are not simply based on the first letter of commands, but the qwerty layout's key positions have significant influence on it. This also applies to the letter choice of unix's shell commands. Much of this influences of design are unconscious.

Emacs's Meta and Control

As a example, emacs's Meta key, and heavy use of Control as primary modifier, and avoiding any 【Ctrl+Shift+‹letter›】 in its keyboard shortcuts, are caused by the lisp keyboard hardware and dumb terminals of 1980s.


Symbolics's lisp machine keyboard PN 365407 Rev C. full keyboard❐. Photo by Joey Devilla. Used with permission.


Right hand side.

Space-Cadet keyboard-2m

The Space-cadet keyboard, one of the early Lisp Machine keyboards. Source

More Lisp Machine keyboards: Knight keyboard , Symbolics keyboard PN 364000.

For detail, see: Why Emacs's Keyboard Shortcuts Are Painful.

vi's Esc key and J K H I

Unix vi's use of j k h i for cursor movement, and the choice of Esc key for mode switching, came from the keyboard it was developed on, the ADM-3A terminal.

terminal ADM-3A vi

The ADM-3A terminal. Source

terminal ADM-3A keyboard

terminal ADM-3A keyboard. Notice the Esc key and the arrows on H J K L.

terminal ADM-3A numberical keypad

terminal ADM-3A numberical keypad.

terminal ADM-3A keyboard layout

The ADM-3A terminal's keyboard layout. Source

Gaming's W A S D

The gaming's convention of W A S D for character movement keys, is also shaped by the PC keyboard's physical key layout used at the time.

Most people need to use the right hand for the mouse for operating a gun or view, so the left hand is used for controlling the character's movement. Right hand is the most dexterous hand for most people, and operating the gun for aim is usually more critical than moving the character.

So, to move the character, there's the arrow keys, but those have some problems. The arrow keys are on the right side of the keyboard, making it awkward to use with left hand. So, a cluster of keys on the left side of the keyboard is used instead. The keys are choosen so that the form a inverted T shape.

But why

 A S D

and why not for example:

 S D F

keys? They are in the standard typing position. Instead, W A S D is more suitable, because W A S D is on the neighbor of Caps Lock, Tab, Shift, Control, Alt, that gamers needs to use for Firing, Shield, Jump, change weapon, etc. So, W A S D becomes the convention.

Also note that the common layout is QWERTY. W A S D is inverted T on QWERTY layout. For those using the Dvorak Keyboard Layout, the W A S D keys are scattered and is a problem. In fact, in the early days, many games do not respect user's choice of key layout in Operating System, nor does it provide ways for users to change the keys. Even today, some game software still have this problem, notably Second Life. (In the early days, say mid 1990s, Operating systems such as Windows hardly have a consistent keyboard layout API for programers anyway. Many software protocols, standards, layers, are gradually established as with most things.)

The X C V for Cut Copy Paste

Another history is the convention of X C V keys for Cut Copy Paste. This came from Apple.

Apple computer, in the 1980s, made the undo, cut, copy, paste concepts popular to the masses, and in general the computer keyboard shortcuts concept. These keys are chosen because they are all adjacent and on the left side of the keyboard, where under them there's the Command/Apple key. Also in this set are Quit (q), Close (w), Select All (a), Save (s), Duplicate (d), and Undo (z). The only exceptions are Open (o) and Print (p) on the right side of keyboard.

 A S D
  Z X C V

All these keys have become universally the standard on about all applications on Windows, Mac, Linux today, possibly except the Z for undo and D for Duplicate.

See: Cut, copy, and paste.

Windows's PrtScn/SysRq for Screenshot

On today's PC keyboard, you'll find quite a few relic keys. PrtScn/SysRq, ScrLk, Pause/Break, Insert. They used to have meaningful purposes in the 1980 or earlier, some of them are separate keys. But computer hardware changes, and software changes, dramatically over the past 20 years. Keyboard itself did not change as fast. So, these keys became defunct. Because the name PrtScn somewhat relates to screenshot capture, so Microsoft have choosen it to be the key for saving screenshots. Similarly, the Backspace key, was chosen as browser's back to previous page shortcut. Note that this key is labeled “Delete” on Apple's keyboards, even they sent the exact same signal. In Apple's operating system, in Mac Classic of the 1990s or Mac OS X since early 2000s, this key was not used for browser's back function, only so in mid 2000s when Apple started to adopt many Windows's conventions.

See also: Difference Between Apple and PC keyboards.


If there's any conclusion, it is that many keyboard shortcut or hotkey choices are based on what is practical at the time. Issues of logical design, ergonomics, consistency, efficiency, are less important. Some of these concept didn't even exist at the time, and some choice was good at the time but computer keyboard has changed.

In retrospect, many of the choices are not the best today. For example, qwerty layout was practical at the time, but the Dvorak Layout was invented too late, when convention was already established, and ergonomics isn't as big a concern at the time because not that many people need to use typewriters. But typing on computer is done by everyone today, for chatting, emails, all sorts of communication, and programing has become a field that's some million times more than the number of typists in 40 years ago.

Emacs's primary modifier the Ctrl is much better at the Alt position on today's PC keyboards.

“vi”'s Esc might be better today at PC keyboard's Alt or Caps Lock. “vi”'s H J K L is still pretty good, but arguably, the following is better:

 J K L

And, QWERTY really should be Dvorak today.

The defunct keys: Insert, PrtScn, ScrLk, Pause, Break, really should be gone. There needs to be keys to switch to previous next app/window/tab, or toggle Show/Hide current window. The Num Lock on the number keypad also is a relic, from a time long past that keyboards don't have dedicate arrow keys and Page up/down Home/End etc keys.

Today, there needs to be keys to change sound level, play/pause music, next/previous song. Luckily, these has been on most keyboards on the market today since about mid 2000s, just that they have not been standardized in layout. Similarly, there needs keys to launch frequently used apps such as email, web browser. These have also been widely popular in keyboards. Also needed is keys for Open, Close, New. These are used in about every application on a hourly basis. Major keyboard makers Microsoft and Logitech have started to make keyboards with these functions pre-assigned to the F1 to F12 Function keys. However, it creates problems because these function keys already have uses in many applications, especially for programers. Microsoft also introduced the F-Lock key to toggle the purpose of the F function keys, but that created more problem than is worth. (See: The F-Lock Key Problem.)


keyboard key ghosting

Perm url with updates: http://xahlee.org/comp/keyboard_key_ghosting.html

Keyboard Ghosting; How Many Keys Your Keyboard Can Take?

Xah Lee, 2010-06-14

How many simultaneous key presses can your keyboard handle?

Here's a test you can do.

Hold down both Shift keys, then press x. See if the letter shows up on your screen.

Yes? Now, try other keys, while keep both the Shift keys depressed. Go through the whole alphabet. Best is to ask your friend to hold both the Shift down, then you press each and every key on your keyboard, and see if they appear on the screen.

On my Microsoft Comfort Curve Keyboard 2000 and Natural Ergonomic Keyboard 4000, when both Shift are held down, the key “x” and “/” and “3” does not work!

Key Ghosting and Keyboard Switch Circuit Design

Apparently, this is a known problem, and is a problem for vast majority of keyboards. This problem is called key ghosting. It has something to do with the design of the circuits. Basically, the electronics of the keys are laid out on a rectangular grid, and when several keys on the same column or row are being pressed, the design have problem knowing exactly which new key is being pressed. This is a simple design flaw of circuit, and can be easily fixed, however, fixing this problem so that all keys can be detected correctly when simultaneously pressed, means more electronic components, more cost, and people never really need to press more than say 5 keys at the same time anyway, so keyboard makers don't bother with complete solutions. They just re-arrange the correspondence between the keys and positions on the grid, so that common key combination do not lie in the same column or row.

Mass marketed keyboards, even expensive ones from Microsoft or Logitech, cannot detect more than 6 or so simultaneously held keys. Also, lots of 3-keys combination also fails. The exact number depends on which keys. The only exception are some gaming keyboards.

The modifier keys, e.g. Alt, Ctrl, Shift, often need to be used with other keys together. So, keyboard makers have made sure that these keys can used simultaneously no problem. But uncommon combination, such as pressing a 5 letter keys at the same time, or pressing both Left Shift and Right Shift and other keys, is practically never used. So they become the victims.

Connectors and Operating System

Apparently, the key ghosting problem isn't just caused by money-saving circuit design, but also can be caused by the connector the keyboard uses to communicate to the computer. (e.g. USB, PS/2, ADB) Your keyboard may send all the correct signals, but the design of the interface might have assumed that simultaneous n keys never happens, so is never capable of sending such signal, so your PC never receives it.

But also, it is reported that even if keyboard and the connector sent all keys correctly, you operating system, keyboard driver, or application, just doesn't know what to with it, and simply dropped the signal as if you never pressed the keys.

Here's a online app from Microsoft that you can use to test how many keys your keyboard can detect, and what key combos your keyboard is weak at: microsoft.com Keyboard Ghosting Demonstration.

You can also read more about the issue at the following sites:

Who Needs to Press 6 Keys Simultaneously?

You might wonder who actually need to press so many keys simultaneously.

Wikipedia cited Braille2000, see: braille2000.com. Quote:

To use any computer braille-entry program, including Braille2000, you will need a keyboard that responds to six-key input. Be alerted that many famous-brand computer systems are supplied with keyboards that are NOT suitable. Be especially careful when shopping for a laptop computer�not being able to use its built-in keyboard will be a real hassle.

Also, in gaming, the need to press more than 5 keys simultaneously is common. Usually, the arrows keys or WASD keys are used to control your character movement, while Shift with left/right arrow makes your avatar move left/right instead of turning left/right. Sometimes 2 arrows such as up/right arrow makes your avatar walk diagonally. Add in key for jumping or squatting, usually needed to be combined with avatar movement keys. Add a key for run mode. Then, there's also things like firing a gun, shield, quickly you have 5 or 6 keys pressed simultaneously.

Basic modern keyboards already have shifted their electronic grid so that multi-key combo with the modifier is no problem. But when the game or game playing gets advanced, like doing some strife shooting while prim jump etc as in Second Life , you need a keyboard that does well. For this reason, as cited by Microsoft and elsewhere, gaming keyboards often take the extra mile to make this correct.

As another example, i recall about 10 year ago, i can play Street Fighter on PC or other similar game on the Mac, in a 2 player versus mode. For single player, you need 4 keys for the movement and another 4 or 6 for various levels of kick and punch. For 2 person playing on the same keyboard you really need keyboard that can detect some 20 simultaneous keys correctly. Remember those super combo inputs for executing special attacks. LOL


Unrelated, but here's a bunch of other keyboard related tech articles:

the Kinesis Contoured Keyboard review

Perm url with updates: http://xahlee.org/emacs/keyboard_Kinesis.html

Kinesis Contoured Keyboard Review and RSI

Xah Lee, 2006-06, 2010-06-12

A excellent, ergonomically designed keyboard is the Kinesis's Contoured Keyboard.

Kinesis Contoured keyboard

The Kinesis contoured keyboard. Source

Design Advantages

There are several quality designs that went into this keyboard. I explain each item below.

Palm Higher Than Finger Tips

Note the bowl shaped surface. When your hands rest on the keyboard, your wrists don't bend up. Your fingers naturally dip in and rest on the keys.

The Microsoft Natural Ergonomic Keyboard 4000, introduced in 2005, used the same ergonomic prinpiple, by tilting the palm side of the keyboard higher.

Key Columns Not Jagged

Note that key columns (e.g. 1QAZ, 2WSX, 3EDC...) are layed out straight, so that your fingers moves in a straight line, not slanted as in conventional keyboards.

The reason traditional keyboards have jagged columns, probably because the design are inherited from mechanical typewriters. Mechanical typewriters has the jagged columns, probably because it is a compromised design to keep the typewriter's mechanics simple, yet have some benefits of a split and angled keyboard. More specifically, typewriters inventors might have thought about split the typing area into 2 angled sections that makes a inverted V shape to suit the natural position of the hands, but such design would complicate the mechanics, so a compromise is to have a single rectangular layout but with the rows jagged, so as to emulate some aspect of the inverted V of a split keyboard.

Kinesis keyboard thumb keys

Thumb For Modifier Keys

Note that the modifier keys and other major keys such as space, enter, delete, shift, control etc are under the most powerful finger the thumb.

The Backspace key is the most frequently used key, yet on a conventional keyboard it is situated at the far upper right corner. Again, the reason for this is probably due to the need for mechanical simplicity at the time. (Also note, when something is just invented, aspects of secondary details cannot be the center of focus. The energy that go into the design of typewriters (or any invention) must necessarily be spend on making it practically work. Consideration of key layout, ergonomics, can only be later development. (The ergonomic consideration of keyboarding only began with computer keyboards, which is some 30 or 50 years after typewriters are in popular use.))

The modifier keys for today's computer keyboards such as the Ctrl, Alt, the Windows key, are aligned on the lower left and right corners of the keyboard. Effectively, only the Alt modifier is easy to use as it is right under the thumb. The Windows key, requires the thumb to curve far inward to press it. The Ctrl key, cannot be press comfortably using a finger. (A technique of pressing the Ctrl key is to use the palm)

The Kinesis keyboard solved this problem by moving these modifier keys right under one of the most powerful finger the thumb. So, moving the thumb to various positions, the user can hold down any of the modifier key, and other fingers of either hand can easily press the other keys to be modified with.


Here's the detailed layout diagram.

Kinesis-keyboard layout

Kinesis layout diagram. image source

Note that in newer models, the Ctrl is now the Windows Logo key, while one of the Alt or Alt Gr is Ctrl. Though, the function of these keys can be re-assigned or swapped.


The function keys F1 to F12 are made of rubber. Instead of normal key with good tactile sensation, now becomes rubbish. Hard to press and hard to know if it registered. For detail about this problem, see: Keyboard Shortcut Design: Dedicated keys, Special Buttons, Extra Keys.

The arrangement of F keys is now a contiguous row, instead of 3 blocks of 4 keys each. The left row has F1 to F8. The contiguous design makes it difficult to find the key without looking at the keyboard, especially for keys in the middle of the row, like f3, f4, f5.

The Esc key is now part of the rubber key in the F key row. The Esc key is important in many applications. Now it being a special rubber key, makes it very bad.

Possibly hard to reach Ctrl and Alt keys. If you use key combo extensively, such as in Emacs, Second Life, Blender, that requires a lot combination keypresses such as “Ctrl+‹letter›” and “Alt+‹letter›”, “Ctrl+Alt+‹letter›”, “Ctrl+Shift+‹letter›”, and even “Ctrl+Alt+Shift+‹letter›”, they are much difficult with Kinesis than a popular Microsoft ergonomic keyboard.

Also, many of 3D modeling app require using the mouse while a combination of Alt, Ctrl, Shift is held down. It may be any 2 of them or all of them. This will be difficult with Kinesis.

Not enough keys. For a programable keyboard, it should have a lot special keys that people can assign them for dedicated purposes. F1 to F12 is not enough. They are often already used up by key-intensive applications such as emacs, 3D modeling apps.

The bowl shaped surface makes it difficult for casual use of the keyboard. Even for a touch typist, you are not always in a typing intesive situation. Sometimes you are watching a movie on your computer, or just need to press a few keys while reading in a browser. The Kinesis requires you to put both of your hands in position if you just want to press a few keys.

I've been a admirer of the Kinesis ever since i saw it around 1991 in a store and have been kept reading about it over the years on the web. I particularly find many of the improvements to the standard keyboard fantastic. I've always been wanting to have one, but due to the high price ($250), i never did. However, today, with my analysis above, i'm guessing that i wouldn't find this keyboard to be my best keyboard even if is just $50, due to the several problems above.

I'm certain i'd prefer my current and all-time favorite The Microsoft Natural Ergonomic Keyboard 4000.

I'm also a heavy emacs user for the past 10 years. If you have RSI problem, i recommend using a Microsoft ergonomic keyboard, learn the Dvorak Layout, and use ErgoEmacs Keybinding in emacs.


This guy Tim Tyler, modified his Kinesis extensively. http://mykeyboard.co.uk/kinesis/

Bill Clementson, a long time lisp programer and emacs user, developed RSI, and got Kinesis, wrote several blog articles about the keyboard in 2006. See his blog at: bc.tech.coop.

Alex Schroeder, best known as the one who started emacswiki.org, also developed RSI. He now uses Kinesis. You can find some discussion about RSI here: emacswiki.org RepeatedStrainInjury. On tips of Kinesis + emacs, see: emacswiki.org KinesisKeyboard.

Jamie Zawinski, main developer of Netscape browser, and famously known for as the one to blame for the Emacs/Xemacs schism, also developed RSI. He wrote a lot about his experiences in several places. He did not like Kinesis. See: http://www.jwz.org/gruntle/wrists.html.

Alfred Lawson; the University of Lawsonomy

Perm url with updates: http://xahlee.org/Periodic_dosage_dir/lawsonomy.html

Alfred Lawson; the University of Lawsonomy

Xah Lee, 2010-06-14

Alfred Lawson (1869-1954), another cult, theory of everything guy. Quote:

In the 1920s, he promoted health practices including vegetarianism and claimed to have found the secret of living to 200. He also developed his own highly unusual theories of physics, according to which such concepts as "penetrability", "suction and pressure" and "zig-zag-and-swirl" were discoveries on par with Einstein's Theory of Relativity.[3] He published numerous books on these concepts, all set in a distinctive typography. Lawson repeatedly predicted the worldwide adoption of Lawsonian principles by the year 2000.

He later propounded his own philosophy—Lawsonomy—and the Lawsonian religion. He also developed, during the Great Depression, the populist economic theory of "Direct Credits", according to which banks are the cause of all economic woe, the oppressors of both capital and labour. Lawson believed that the government should replace banks as the provider of loans to business and workers. His rallies and lectures attracted thousands of listeners in the early 30s, mainly in the upper Midwest, but by the late 30s the crowds had dwindled.

In 1943, he founded the unaccredited University of Lawsonomy in Des Moines to spread his teachings and offer the degree of "Knowledgian," but after various IRS and other investigations it was closed and finally sold in 1954, the year of Lawson's death. Lawson's financial arrangements remain mysterious to this day, and in later years he seems to have owned little property, moving from city to city as a guest of his farflung acolytes. A 1952 attempt to haul him before a Senate investigative committee and get to the bottom of his operation ended with the old man leaving the senators baffled and unimpressed.[4]

David Icke


Discovered another crackpot. David Icke this guy claimed he's son of God, claimed that earth are ruled by lizard-like alien and human hybrids, etc. Wrote and sell several books, with big site peddling his shit, going around the world giving lectures.

There are quite a few people that i've read who claimed to be son of God, or brother of Jesus. One most diastrous one, is 洪秀全 (Hong Xiuquan), which eventually became Taiping Rebellion, with 20 million deaths. (for one of his poem and links to Wikipedia articles, see: 斬邪留正詩 (Kill the Vicious and Keep the Righteous poem)).


is Skype chat encrypted?

Perm url with updates: http://xahlee.org/comp/skype.html

Skype Chat Encryption and Screen Sharing

Xah Lee, 2010-06-13

Was wondering if Skype text chat or voice chat are encrypted. After few minutes of web search, quickly the answer is found without a doubt.

You Can Talk About Your Secrets Over Skype

According to support.skype.com. Quote:

Skype uses AES (Advanced Encryption Standard), also known as Rijndael, which is used by the US Government organizations to protect sensitive, information. Skype uses 256-bit encryption, which has a total of 1.1 x 1077 possible keys, in order to actively encrypt the data in each Skype call or instant message. Skype uses 1024 bit RSA to negotiate symmetric AES keys. User public keys are certified by the Skype server at login using 1536 or 2048-bit RSA certificates.

Of course i confirmed this to not be a commercial company's false claim. In short, for average citizens, you can pass passwords using Skype, or talk about your affairs, without worrying about eavesdroppers.

This is great! Although i have a chat account with AOL, MSN, Yahoo, and google talk, but in the past year i'm relying on Skype more. As a thinker with critical views on human animal society and behavior, i'm quite fuzzy about my choices of software. I approve Skype!

For tech detail of Skype's encryption feature, see: Skype security.

For curiosity, i wonder if any of the AOL, MSN, Yahoo, or Google Talk, currently has encryption on by default, and what they use.

Screen Sharing


Discovered that Skype has a screen sharing feature builtin. (just click on the Share then Share Screen.) That is, you can show your screen to your friends on Skype. This is a Fantastic. As they say, a picture is worth a thousand words.

Without this feature, you have to use something like Timbuktu (software), or other Remote desktop software, but these usually lets you control the other desktop too.

my java tutorial accolade

Perm url with updates: http://xahlee.org/comp/blog.html


Got this accolade today for my Java Tutorial:

Thanks much for your informative Java programming aid online. I'm an old crow who cut his teeth on assembly language - and left programming for my career in SatCom. But all roads seem to circle around some programming application and your website has been very helpful with my current interest. Thanks much for the time and effort your spent to create it!!

MS Engineering control theory UC-Berkeley '72