Xah Emacs Blog Archive 2010-10
ELisp: Multi-Pair String Replacement with Report.
Thanks to Arie Kluit for $3 donation for Emacs LSL Mode (xlsl-mode) for Linden Scripting Language!
Thanks to Remington Furman for $15 donation!
Emacs: Key Macro Example: Insert All Unicode Bullets
Thanks to Derek Williams donation for Emacs: Xah Math Input Mode (xah-math-input.el).
Thanks to Oleksiy Shumytsky donation for Emacs: Xah Math Input Mode (xah-math-input.el).
Created a minor mode for inputting math symbols. See: Emacs: Xah Math Input Mode (xah-math-input.el)
Thanks to Michael Aldred donation for Emacs LSL Mode (xlsl-mode) for Linden Scripting Language.
Another anecdote on the power of emacs.
Today, i need to study how Mathematica treats Unicode. [see How Mathematica does Unicode?]. In the process, i need to get a file of math Unicode symbols. I have a page at Math Symbols in Unicode, but i need just the Unicode symbols, not all other content.
So, simply copy the whole file content. Then, put that into a file, say math_symbols_unicode.txt
. Then, delete all asccii chars. This you can do by calling “query-replace-regexp”. [see Emacs: Find Replace in Current File] For the replace regex, use [[:ascii:]]
. For the replacement string, just press Enter for nothing. Then, press ! to replace all.
Now, i need a space between each symbol. This is a great job for
Emacs keyboard macros. Type Ctrl+x ( to start recording. Then type → space. Then type Ctrl+x ) to end recording.
Then, type Ctrl+u 999 (for repeating 999 times the next command),
then Alt+x call-last-kbd-macro
. Then, spaces are inserted between each chars.
Thanks to Lew Perin http://www.panix.com/~perin/ for a correction.
Aaron wrote to note that, to add a space between each char, it's simpler to actually do another query-replace-regexp. Use \(.\)
for the find regex, and use \1
for the replacement string.
See also:
In emacs buffer, the line ending char is always just “\n” (^J, LF; ASCII 10), regardless what is the OS convention for newline. Emacs will display ^J, ^M only when the file's End Of Line chars cannot be interpreted in a consistent way.
For detail, see: Emacs: Newline Representations ^M ^J ^L.
For emacs tutorial, what would you like to see more?
ErgoEmacs package v1.9.1.1 is released. This is essentially just v1.9.1. Fixed a zip packaging problem, and loading problem of tab bar mode and twit mode.
Download at http://code.google.com/p/ergoemacs/downloads/list
http://ergoemacs.org/ErgoEmacs_Package_v1.9.1_release_notes.html
New section added: ELisp: Replace String Based On File Name (elisp tutorial)
Oscar Carlsson wrote to say there's a
variable-pitch-mode
.
That's fantastic.
When you turn that on, the buffer uses a variable width font, and sticks to that buffer only.
Very nice.
Emacs Lisp Date Time Formats (tutorial)
Thanks to Carlos Rocha donation for Emacs: Xah Unicode Mode, xah-unicode-mode.el.
ErgoEmacs package v1.9.1 is released!
Download at http://code.google.com/p/ergoemacs/downloads/list
http://ergoemacs.org/ErgoEmacs_Package_v1.9.1_release_notes.html
Emacs: Key Macro Example: Add HTML Attribute (tutorial)
A new version of abbrev and templates for coding emacs lisp. Get it at: Yasnippet Templates for Emacs Lisp Mode [ elisp_idiom_templates.html ] .
A new version of ErgoEmacs keybinding is out! At v5.3.7. Feature highlight:
- Added open-in-desktop command with key Ctrl+Shift+o.
- Added Danish layout. Thanks to Michael Budde
- Added ergoemacs-layout-pt-nativo.el. Thanks to Xavier Pinho
Download: http://ergoemacs.googlecode.com/files/ergoemacs-keybindings-5.3.7.zip (Released on 2010-11-15, tested with emacs 23.2.1.)
Visit home page for detailed info: ErgoEmacs Keybinding.
Thanks to Fabio Mazarotto for $3 donation for Emacs: Xah BBCode mode. xbbcode-mode.el.
Emacs Lisp Power: Text-Soup Automation (tutorial)
ELisp: HTML Amazon URL Linkify (tutorial)
Thanks to Jason Earl for $10 donation!
Update: ELisp: Command to Search Web.
Recently, a new lisp book came out: LAND OF LISP (Book and Comics).
My emacs tutorial and elisp tutorial is sizable for a book. There's no emacs cookbook or elisp cookbook on the market. To turn it into a book, it probably will take half a year at least to add content, convert HTML to a format suitable for print, as well as a lot work to improve quality. If i write a emacs book, are you likely to buy it?
- Yes, if it's good.
- No, am not likely to spend money on emacs/elisp book.
Please vote at
http://xahlee.blogspot.com/2010/10/do-you-want-emacs-cookbook.html
Does anyone know a emacs template for JavaScript?
In particular, am looking for template for either Emacs Templates with YASnippet yasnippet or AutoComplete.
one minute google or emacswiki search didn't find anything.
(am already using both js2-mode and js-mode (aka espresso mode), they don't appear to have name completion or template built-in.)
Answer at
http://xahlee.blogspot.com/2010/10/emacs-javascript-template.html
Thanks to 安藤 又雄 for donation!
How to force upcase of replacement?
In your replacement, use: \,(upcase \1)
.
For detail, see: Emacs: Find Replace in Current File.
Requesting guest blog writers for emacs. If you have used emacs for few years, and better if code emacs lisp, please just send your article to me (Xah@XahLee.org) and i'll post it, with links to your sites and all.
The article should be preferably technical than opinion piece or diary. For example, a short tutorial on installing and using a mode (blogging, twitter, hooking up with gmail, how to use planner, muse, intro to CEDET, etc.) It also can be some tips on commonly needed things, such as how to setup and use tags, etc.
If you are not familiar already, guest blogging has many advantages, as developed in the blogsphere community. It helps the community of the blog subject, gives readers a fresh writing style to read, saves the original blog author time, advertise for the guest author. It is practiced in the printed media for long. You can read about guest blogging here: Guest Blogging 101, from Darren Rowse.
I would like to try the guest blog idea. Give it a shot, why not?
If you haven't blogged before, here's some tips:
- Let the article be self-contained and concrete, as much as possible. For example, instead of writing “read the instruction at xyz.com”, simply pull the code from your “.emacs” as a concrete example. Say “put the file abc in the dir
~/.emacs/d/
”, instead of saying “put it in your lib path”. - Cover the most basic things about xyz that 90% of emacs users will need to do. Majority of emacs users are not emacs geeks and many don't know or read blogs, wiki, or reddit. (many simply web search for a problem they need to solve.)
- Make it as simple as possible, or even write it as instructions or receipe. Make it into sections. Each section cover one thing. Each paragraph contains one idea.
- When readers read the article, if they just spend 1 min they would have learned something. Don't make them think.
- Don't worry about some academic correctness or formality or completeness. Readers are not dummies, they understand the context. They can read the doc for detail if they want to.
Emacs thing-at-point and Chaining Functions
ELisp: Cycle Space Hyphen Underscore (tutorial; useful command)