interview with Eric Ludlam (CEDET) By Dirk-Jan C Binnema. @ emacs-fu.blogspot.com
Thanks to John Kumpf for donation!
Please subscribe, and YOU, donate! Or, please link from your blog. Thank you for YOUR support!
In dired and Bookmark, you can use mouse click to open a file. But ibuffer, it marks the file instead. Here's how to fix it. Put the following in your emacs init file:
(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!
Difference Between Emacs's “(getenv PATH)” and “exec-path”.
Using Emacs Abbrev Mode for Abbreviation (tutorial)
Using Emacs's “Dired+” (diredplus) Mode (very nice package!)
A survey of efficient keyboard layouts: Dvorak, Maltron, Colemak, NEO, Bépo, Turkish-F, Keyboard Layouts Fight!.
Also, thanks to Xavier Gomes Pinho's message that is a result of a lot study, ErgoEmacs Keybinding will support the “br-navito” layout (for Portuguese) soon.
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 Esc】.
Detail at: Emacs: Rename Files Interactively by Pattern (regex; wdired).
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.)
Also, started to collect some nice words about my emacs work. See: Testimonial on Xah's Emacs Tutorial. Thank you all very much, and many who have helped me before.
This page Emacs: How to Override Minor Mode Keybinding hit reddit.
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 【F1 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.
Here's a short elisp example to get file content into a string.
;; thanks to “Pascal J Bourguignon” and “TheFlyingDutchman 〔zzbba…@aol.com〕”. 2010-09-02 (defun get-string-from-file (filePath) "Return FILEPATH's file content." (with-temp-buffer (insert-file-contents filePath) (buffer-string)))
And, remember, you can also get them into list of lines.
(defun read-lines (filePath) "Return a list of lines of a file at FILEPATH." (with-temp-buffer (insert-file-contents filePath) (split-string (buffer-string) "\n" t)))
For more about processing a file line by line, see: Process a File line-by-line in Emacs Lisp.
After now 11th year of living in emacs daily, i discovered the utility of the mouse!
In dired, you can just click about to browse files. Same for Bookmark. The exception is ibuffer. Pity.
I'll try to use the mouse more often. Discovered this because recently am typing too much and is becoming a problem.
Previously, we've covered Single Command to Delete Whole Line and How to Copy/Cut Current Line. But what if you want to select the current line with a single command? Very short, like this:
(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.
Using Emacs for Twitter (tutorial)
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.
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 Lisp: Multi-Pair String Replacement: xfrp_find_replace_pairs.el (elisp tutorial + package)
Left Wrist Motion Pain; vi Esc Syndrome (essay)
small elisp programing tip.
elisp has the toothpick syndrom. When you use elisp to process HTML, all the "quote" characters needs to be escaped. (worse if you have backslash (⁖ Windows style path) and need to process it with emacs regex.) If you process a lot HTML files, the typing of backquote gets painful.
Here's a quick commmand i've been using for a couple of years:
(defun escape-quotes-region (start end) (interactive "r") "Replace \" by \\\"." (replace-pairs-region start end '(["\"" "\\\""]))) (defun unescape-quotes-region (start end) (interactive "r") "Replace \\\" by \"." (replace-pairs-region start end '(["\\\"" "\""])))
You can assign a key to them.
This calls “replace-pairs-region”. Which i have defined. See if you can code that. I'll post my code tomorrow. (2011-10-29 here: Emacs Lisp: Multi-Pair String Replacement Function)
Re-wrote the following tutorials:
Printing in Emacs Lisp (tutorial)
Problems of Emacs's Manual; Examples. (commentary)
Emacs: How to define Super ＆ Hyper Keys. (tutorial)
Emacs Idolization: Have You Read the Emacs Manual From Cover to Cover?. (commentary)
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: Emacs Lisp: 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 the Emacs Pinky Problem, 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: Emacs Lisp: 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. 〔☛ 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.
GUI Makes People Dumb?
Thanks to YOO for a major correction. See: Emacs: How to Turn a Minor Mode on/off/toggle?
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.
GNU Emacs and XEmacs Schism, by Ben Wing
Well Known Emacs People With Hand Injuries
Emacs Form Feed (^L) Display Suggestion and Tips
Emacs Switching to Guile Scheme Lisp? (commentary)
Emacs byte compile incompability on 23.1 vs 23.2
A new version of bbcode-mode. Also a new version of xub Unicode Browser mode.
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)
Arrows in Unicode.
Text Editor's Cursor Movement Behavior (emacs, vi, Notepad++) (commentary; essay; question)
Keyboard Hardware's Influence on Keyboard Shortcut Design (How Emacs ＆ vi keys came to be).
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: Keyboard Ghosting; How Many Keys Your Keyboard Can Take?.
A few new articles i wrote in the past few days on keyboarding that might be of interest to emacs users.
Emacs Why line-move-visual (essay; newsgroup flame)
Some notes on: Emacs nxml-mode Fontification Changes.
All About Processing Lines in Emacs Lisp (elisp tips)
ErgoEmacs 1.8.1 for Windows is out! This one is based on the shiny new Emacs 23.2. 〔☛ Emacs 23.2 Features〕 Check it out! Download at: googlecode.com ErgoEmacs 1.8.1 Setup.exe. (Thanks to David Capello for the C coding on Windows.)
Emacs 23.2 Featuresblog comments powered by Disqus