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:
- ① Just facts and tips, less or no personal stories or opinions, like text books.
- ② Good tips and emacs info, plus some background intro or opinion to sweeten it up is nice, like tech magazines.
- ③ I've read at least 10 of your articles. They are balanced as is.
Vote at: http://xahlee.blogspot.com/2011/06/xahs-emacs-tutorial-poll-2011-06-25.html. Result will be posted there in a week.
- 2 (15%) ① Just facts and tips, professional; less or no personal stories or opinions.
- 6 (46%) ② Good tips and emacs info, plus some background intro, personal info or opinion, to sweeten it up is nice.
- 6 (46%) ③ I've read at least 10 of your articles. They are balanced as is.
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
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.)
Rewritten with new findings: Keyboard Layout: Dvorak vs Colemak: is It Worthwhile to Improve the Dvorak Layout?.
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 firstname.lastname@example.org with subject “emacs tutorial upgrade” and i'll email it to you.
Thank you for your support!
Major updates on 2 ergonomic keyboards. They are perfect for emacs or ErgoEmacs:
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:
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 v126.96.36.199 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.
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.
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
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.
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)
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.
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 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:
- Using Emacs's Abbrev Mode for Inserting Special Symbols
- How to Create a APL or Math Symbols Keyboard Layout
- Emacs: Remapping Keys Using key-translation-map
- Emacs: Xah Math Input Mode
- Emacs Custom Keybinding to Enhance Productivity