Xah Emacs Blog Archive 2011-05 to 2011-06

Minor update: How to Avoid the Emacs Pinky Problem.

Xah's Emacs Tutorial Poll 2011-06-25

Do you like xah's emacs tutorial writing to be:

Vote at: http://xahlee.blogspot.com/2011/06/xahs-emacs-tutorial-poll-2011-06-25.html. Result will be posted there in a week.

Results:

Total vote: 13. Each voter can make more than one choice.

ErgoEmacs and Windows VirtualStore

In Windows 7, ErgoEmacs will recognize files in the VirtualStore location.

that means, if you want to modify some files in c:/Program Files/ such as

C:/Program Files (x86)/ErgoEmacs/ergoemacs/init_load_packages.el

you can do so without having to edit the file as admin.

Windows 7 will create the virtual file at %homepath%/AppData/Local/VirtualStore/

and when ErgoEmacs is relaunched, it'll recognize the ones in virtualstore location.

am not sure if this is due to GNU emacs 23.x change or something changed from Windows Vista to 7. (if anyone know, it'd be greate to know for curiosity. Post! After 2 years, am still Windows newb. lol.)

See also: Windows Vista VirtualStore ProblemWindows Environment VariablesUsing PowerShell to Manage Environment Variables.

Computer Keyboard: Increase Productivity Using Function Keys.

PC Keyboard Modifier Keys (Short Survey).

Rewritten with new findings: Keyboard Layout: Dvorak vs Colemak: is It Worthwhile to Improve the Dvorak Layout?.

Keyboard Layouts: Dvorak vs Colemak vs Workman.

Created a dedicated page for buying my tutorial, at: Buy Xah Emacs Tutorial.

For those of you who have bought it before, just email me at xah@xahlee.org with subject “emacs tutorial upgrade” and i'll email it to you.

Thank you for your support!

The Idiocy of the Happy Hacking Keyboard.

Microsoft Keyboards

Emacs Keyboards

Major updates on 2 ergonomic keyboards. They are perfect for emacs or ErgoEmacs:

Kinesis keyboard doll
image source

If you are on Mac OS X, this is for you: Mac OS X Keyboard Layout, Keymapping, Keybinding, Tools.

Emacs Manual Trivia

Updated my mirror of emacs manual and emacs lisp manual to version for emacs 23.3. Here:

My emacs tutorial links to them. For example: Emacs Lisp Basics.

Here's some trivia:

• There are a total of 694 HTML pages (nodes) for the emacs manual.

• There are a total of 896 HTML pages (nodes) for the elisp manual.

• Occurrence of HTML Entities in the elisp manual:

FreqStringUnicode Char
847&&
529>>
442&lt;<
2427&nbsp; 
561&ldquo;
561&rdquo;
1743&lsquo;
1743&rsquo;
2553&mdash;
70&minus;
4&ndash;
1&auml;ä
2&ouml;ö
1&uuml;ü
3&copy;©
1180&rArr;

Benefits of Compiling Your Emacs Lisp Files

Spend 6 hours in past 2 days to clean up my custom emacs init files.

Turns out there is just a lot to clean. I have 6.5k lines. (not counting elisp libs.) Most of my custom elisp code has to do with HTML for my website.

A compiled elisp code will load ~6 times faster, AND run ~6 times faster. But also, i realized it's good to compile your lisp code because it'll tell you errors such as using free variable (that is, you are using a var that you forgot to put inside “let”). I found ~5 instances of leaked vars. Surprising, it'll also tell you that you are using “equal” with only one argument. Normal loading of code won't tell you that.

Now there are sizable number of utils you might grab. Get at: Xah Lee's Emacs Customization Files.

See also: Emacs: Organize Init File.

There's a new util to get your Windows machine for system-wide support of the efficient ergonomic layout for Portuguese, the PT-Nativo layout. See: System-wide ErgoEmacs Keybinding for Windows, Mac, Bash.

Thanks to Xavier Gomes Pinho for contribution.

If you are wondering what PT-Nativo layout is like, see: Alternative Keyboard Layouts.

ErgoEmacs v1.9.3.1 lisp packages released. See announcement here: http://groups.google.com/group/ergoemacs/browse_frm/thread/c74781d6ba93d8ed

Can be installed on any OS with a working emacs 23.2.

http://ergoemacs.org/ErgoEmacs_Package_v1.9.3_release_notes.html

Download at: http://code.google.com/p/ergoemacs/downloads/

Spent about 8 hours working on ErgoEmacs. See: ErgoEmacs what's new for 2011 May At http://groups.google.com/group/ergoemacs/browse_frm/thread/e6161c69cbd73a2c.

Elisp: Get Script Name at Run Time, Call by Relative Path

Emacs on Ubuntu Linux.

Determine OS Type (Windows/Mac/Linux) in Emacs

Many of us work with several operating systems. When you write your emacs customization (the .emacs file), sometimes you need to know what OS you are on. Here's how to do it.

;; make the mouse 5th button (forward button) do close buffer.
(cond
 ((string-equal system-type "windows-nt") ; any flavor of Windows
  (global-set-key (kbd "<mouse-5>") 'close-current-buffer)
  )
 ((string-equal system-type "gnu/linux")
  (global-set-key (kbd "<mouse-9>") 'close-current-buffer)
  )
 ((string-equal system-type "darwin") ; Mac
  (global-set-key (kbd "<mouse-5>") 'close-current-buffer) )
 )

For some odd reason, if you have a 5-button mouse, the 5th button (aka “forward button”) in emacs has syntax <mouse-5>, but on Ubuntu 10.04 Linux, it's <mouse-9>. On Windows and Mac, scrolling mouse wheel down is <wheel-down>, but in Linux it's <mouse-5>. (you can find out the syntax of a mouse button/wheel by calling “describe-key” then press a button or wheel.)

Functional Programing: stop using recursion, cons. Use map and vectors

This is important but i think most lispers and functional programers still don't know it.

See: Guy Steele on Parallel Programing.

Lists (as cons, car, cdr) in the lisp world has always been some kinda cult. Like, if you are showing some code example and you happened to use lisp vector datatype and not cons (lists) and it doesn't really matter in your case, but some lisper will always rise up to bug you, either as innocent curious question or attacking you for not “understanding” lisp. (just as other idiocies happen in other languages that lispers see but other languages don't see)

It's interesting to me that all other high level langs: Mathematica, Perl, Python, PHP, JavaScript, all don't have linked list as lisp's list. It's also curious that somehow lispers never realises this. I've been having problems with lisp's cons ever since i'm learning Scheme Lisp in 1998 (but mostly the reason is language design at syntax and lack of abstraction level in calling “cons, car, cdr” stuff, without indexing mechanism). Realizing the algorithmic property and parallel-execution issues of linked list is only recent years.

Babolog — Digital Goods Marketplace for the Masses

Recently, 2 guys came up to me on skype. One is Michael K and the other is sabalaba. It turns out, they have something mysterious to sell, and that's their startup company babolog.com.

It's a digital goods marketplace website, where you can sell any of your digital files easily. So, they convinced me to use their service, and here it is, my emacs tutorial sold there, at: http://www.babolog.com/shop/p/471. Go buy it now! Help me out and check them out.

If you have some digital goods, you can sign up with them. Takes about 20 seconds. No upfront fee required. When your item got sold, they charge $0.3 plus 3% of the price. (always check their site for the exact terms.) Their site is quite simple. Check it out at: babolog.com.

Updated: Emacs's Keybinding Layout Diagram.

Emacs as Word Processor: enriched-mode, Bold and Highlight Text.

Put onto a page by itself: Elisp: html6-mode.

All Ways to Insert Special Symbols in Emacs

Thanks to Uriel Frisch for purchasing my emacs tutorial. [see donation]

Uriel asked about how to enter accented letters with emacs. Here's some relevant articles.

On mac, you can enter accented letter with the Option key. See: Mac OS X Keyboard Viewer and Unicode. You can also change a config file so the keys type any Unicode you want. See: Creating Keyboard Layout in Mac OS X. The above solutions are system-wide for the Mac.

For Windows, there's AutoHotkey and some other tools. See: AutoHotkey TutorialWindows: Keyboard Layout Tools, Key Macro Tools.

For within emacs, here are also several solutions. Emacs supports entering common accented letter and symbols. See: Emacs: Unicode Tutorial. Again, you can also create your custom keys to enter any Unicode symbol. If you want custom symbols or keys, see:

Emacs: Move Cursor to Bracket/Quote.

Emacs: w32-shell-execute Doc String Bug.

Elisp: View URL in Web Browser: browse-url.

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