Xah Emacs Blog Archive 2010-06
Please subscribe, and YOU, donate! Or, please link from your blog. Thank you for YOUR support!
(defun xah-ibuffer-keys () "Modify keymaps used by `ibuffer'." (local-set-key (kbd "<down-mouse-1>") 'ibuffer-visit-buffer-other-window) ) (add-hook 'ibuffer-hook 'xah-ibuffer-keys)
Select the above code, then press 【Alt+x eval-region】, or restart emacs.
This will make the mouse click open the file into a split pane. What if you want to open the file without splitting the window? Hint: find out the function name for opening the file in ibuffer. (use “describe-key”.)
Created the emacs manual mirror, with better CSS and HTML, at http://xahlee.org/emacs_manual/emacs/index.html.
The emacs manual is pretty bad today. Too much fat. See: Problems of Emacs's Manual.
There are about 690 pages. If i spend 30 min to edit 5 pages a day, that'll take 138 days, or 4.6 months. Maybe that's what i'll do. That will be 69 hours of work.
If you like to support the site, please paylpal donate (to xah @ xahlee.org), and i'll send you my complete tutorial, plus emacs and elisp manuals. Link is also much appreciated. Thanks.
Am thinking of starting a emacs community. Please read here http://xahlee.blogspot.com/2010/09/starting-emacs-community.html and post comment to let me know what you think.
PS thanks to Steven Mitchell for donation!
Emacs: Abbrev Mode Tutorial (tutorial)
Using Emacs's “Dired Plus” Mode (very nice package!)
A survey of efficient keyboard layouts: Alternative Keyboard Layouts.
Another little underused tip.
If you want to rename many files, just go to dired 【Ctrl+x d】, then pull the menu 〖Intermediate ▸ Edit File Names〗 【Ctrl+x Ctrl+q】. Then, you can edit the file names, or use any of find replace command to do so, including regex ones. When done, press 【Ctrl+c Ctrl+c】. To cancel, press 【Ctrl+c Escape】.
Detail at: Emacs: Batch Rename Files.
Little very useful tip i think is underused.
Press 【Alt+/】 to expand a word that is already in the buffer. Type that again to switch to the next possibility.
Suppose your are coding in Python. You have defined your own function “getStringInFile”. Now, when you need to type that again, just type “ge” then press 【Alt+/】. If the word is not you want, press that again.
You can see all available choices by pressing 【Ctrl+Alt+/】.
I used emacs daily since 1998, but didn't learn this command until about 2008.
Got this email last week:
I read much, but don't post. I've been aware of you for years. (Emacs user since it was written in (gasp) Teco. 1977? Probably.)
I just got saved by your valuable article "The Confusion of Emacs's Keystroke Representation." Thank you.
About ten times per day recently, I've solved problems and learned things from your tutorials. Thank you, (great emphasis) for writing them and making them available.
I became curious about you and so I read a lot of xahlee.org.
I read fast, read alot.
You are famous, I see, as I recall, for being a troll. I do not understand (for some reason) how your "giving" side (xahlee.org seriously helpful articles) and your "poking at the morons" side live in the same guy, but my not knowing is okay.
I relate to a lot of the feelings you write, too. I should thank you for those writings, too, but that's one of my weird areas. I'm not going to do it now.
It made my day. (and thanks again Eirikur.)
Tip for elisp coders. Often, while still writing your program and
in the debugging process, you might put
(mesage myStr) to print some variables. However,
if your “myStr” happens to contain “%” char such as in URL, then
you'll get a mysterious error “Not enough arguments for format
string”. Took me some time to trace a bug to this extraneous debug line. So:
;; don't do this (message myStr) ;; do this (message "%s" myStr)
Also, you know about
apropos-command 【Ctrl+h a】 right? Useful to find the command you want. However, remember that it only list commands, not functions. When you are looking for the function you want, you can do a 【Ctrl+u】 first, so that
apropos-command will also list functions.
Created a ErgoEmacs online forum invitation, like this:
|Join ErgoEmacs's Discussion Forum!|
If you are a ErgoEmacs user, please join. You can subscribe with abridged or digest format with 1 email per day. Many webfeed are available at http://groups.google.com/group/ergoemacs/feeds
If you like ErgoEmacs, please place the following on your website or blog to spread ErgoEmacs.
<table border="0"> <tr><td> Join <a href="http://ErgoEmacs.org/">ErgoEmacs</a>'s <a href="http://groups.google.com/group/ergoemacs">Discussion Forum</a>! </td></tr> <tr><td> <form action="http://groups.google.com/group/ergoemacs/boxsubscribe"> Email: <input type="text" name="email"> <input type="submit" name="sub" value="Subscribe"> </form> </td></tr> <tr><td style="vertical-align:middle"> <img src="http://groups.google.com/intl/en/images/logos/groups_logo_sm.gif" height="30" width="140" alt="Google Groups"> </td></tr> </table>
My left hand is whacked. No pain yet, but something is getting seriously wrong …. Added the latest happening of my hand health saga to the bottom of: Programer Hand Health: vi Esc Key Syndrome.
After now 11th year of living in emacs daily, i discovered the utility of the mouse!
I'll try to use the mouse more often. Discovered this because recently am typing too much and is becoming a problem.
(transient-mark-mode 1) (defun select-current-line () "Select the current line" (interactive) (end-of-line) ; move to end of line (set-mark (line-beginning-position)))
This is added to Emacs Lisp Examples, check it out for other useful examples.
Transform HTML Tags with Emacs Lisp (elisp tutorial)
PS: Thanks to Roland Renaud, Sungmin Cho, for Donations.
there are several twitter modes for emacs.
Here's the top 10 most popular pages of the past month. The top one has 58 unique page views per day, on average. The last one has 29.
- 1. Emacs Advanced Tips
- 2. Emacs: How to Define Keys
- 3. Emacs Lisp Basics
- 4. Emacs: Unicode Tutorial
- 5. ErgoEmacs Keybinding
- 6. Emacs and Shell Tips (Bash, cmd.exe, PowerShell)
- 7. Emacs: Find Replace Text in Directory
- 8. Emacs 23.1 New Features (released 2009-07)
- 9. Why Emacs Keys are Painful
- 10. Text Pattern Matching in Emacs (emacs regex tutorial)
The time spent on each page is about 3 to 4 minutes.
Ever wonder what are the top 30 most frequently used emacs lisp functions? If you are just beginner elisp programer, you probably want to know these well. See: Emacs Lisp Function Frequency.
PS thanks to Kristian Hellquist for donation!
Created a snippet set for emacs lisp coding. Currently covering 105 elisp functions. Download at: Emacs Lisp Yasnippet Templates.
A new version of the ErgoEmacs Keybinding is out.
The new version is 5.3.4. New is a Swedish layout, and also the window splitting keys have changed for the ergonomically better. See the included “_HISTORY.txt” file for more detailed release notes. Thanks to Kristian Hellquist for the Swedish layout.
Also thanks to many who have voiced support.
Emacs: xah-replace-pairs.el Multi-Pair Find Replace (elisp tutorial + package)
Re-wrote the following tutorials:
Problems of Emacs's Manual; Examples. (commentary)
Emacs: How to define Super/Hyper Keys. (tutorial)
Outline mode (org-mode) is nice, but i never took the time to learn the details. Have been using it simply by just knowing the star header syntax and Tab or Shift Tab to show/hide headings. Today, i took the time and learned the basics keyboard shortcuts for creating and moving branches. Fantastic. Added to Emacs: Writing Outline, org-mode Tutorial.
There's glasses-mode, a minor mode, bundled in at least emacs 22.2. It will display “camelCase” words like this “camel-Case”. Note: it only display it that way, the text is actually not changed. (via gnu.emacs.help post by Tim X)
This tip is added to: Emacs Advanced Tips.
Complete re-write: Elisp: Writing a google-earth Function. It was written when i just started learning elisp in 2006. Now much better.
Added a section to How to Avoid Emacs Pinky, at the bottom.
In the past few days, been working on my site that heavily involves emacs lisp scripts i've written.
First is a update to my kml files. See: Google Earth KML Validation Fuckup. This involves also updating my script for generating kml files, see: Elisp: Writing a google-earth Function. Then, i created a collection of links to kml files. See: Google Earth Files. This is done by modifying my elisp script that generate Wikipedia links. See: Generate a Web Links Report with Emacs Lisp.
Google Earth today is amazing. You can see photos of any street of all major cities around the world, most with panoramic display. [see Google Earth Geography 101]
How to Quickly Switch Fonts in Emacs (tutorial)
GNU Emacs Development Inefficiency (commentary)
ErgoEmacs mentioned in news.ycombinator.com.
What's the difference between library, package, features? And what's the difference between load-file, load, require, autoload? See: Emacs Lisp's Library System.
Thanks to YOO for a major correction.
Want the cursor movement to stop between camelCaseLetters? Use “global-subword-mode” or “subword-mode”, available in emacs 23.2. (Thanks to Deniz Dogan for the tip.)
This tip is added to: Emacs Advanced Tips.
Emacs Switching to Guile Scheme Lisp? (commentary)
Played with Unicode too much in the past 2 days, and now wrote a new mode today: xub Unicode Browser mode for Emacs.
Emacs cua-mode Problems. (commentary; emacs modernization)
Text Editor's Cursor Movement Behavior (emacs, vi, Notepad++) (commentary; essay; question)
Spend 8 hours rewrote the article: Creating Keyboard Layout in Mac OS X. Also, created a system wide ErgoEmacs keybinding for OS X and Bash, for both Qwerty and Dvorak layout. Download at: http://code.google.com/p/ergoemacs/source/browse/#git%2Fextra. (Thanks to Brendan Miller for the initial work on Bash binding)
Also, wrote another article: What's NKRO, N-key Rollover? .
A few new articles i wrote in the past few days on keyboarding that might be of interest to emacs users.
- Kinesis Advantage2 Keyboard Review
- The Idiocy of Hacker Keyboards
- Keyboard Shortcut Design: Dedicated keys, Special Buttons, Extra Keys
Emacs Why line-move-visual (essay; newsgroup flame)
Some notes on: Emacs nxml-mode Fontification Changes.
Elisp: Functions on Line (elisp tips)
ErgoEmacs 1.8.1 for Windows is out! This one is based on the shiny new Emacs 23.2. [see Emacs 23.2 Features (released 2010-05)] Check it out! Download at: googlecode.com ErgoEmacs 1.8.1 Setup.exe. (Thanks to David Capello for the C coding on Windows.)
Patreon me $5. Ask me question on patreon