Xah Emacs Blog Archive 2011-01

Emacs: Form Feed and Source Code Section Paging Commands.

New version of ErgoEmacs keybinding is out, at 5.3.9 . Major changes since 5.3.7 :

See _HISTORY.txt for full detail.

Download at: ErgoEmacs Keybinding.

Set Bash Shell Prompt to Color

David Capello created a new version of “command-frequency.el” now called “keyfreq.el”. See here for detail and download location:Emacs's Command Frequency.

Emacs vs Windows Notepad (rant)

Emacs Bug: 【C-u】 and (key-translation-map) disables “undo”.

See: Emacs Misc Bugs.

Emacs Undo and Emacs Cult Problem.

Complexity of software engineering: Emacs grep Problem in Windows.

Reminder: you can get all my emacs and elisp tutorial. Close to 300 HTML pages, each HTML page is about 1 to 5 printed pages. It comes in simple HTML+CSS, without web ads, banners, or JavaScript. See: What People Say about Xah's Emacs Tutorial.

Emacs Shell in Movie TRON.

Emacs Dired Bug: Delete File List Not Visible

See: Emacs Misc Bugs.

A recent article that should be here: Emacs Keybinding Rant, and a Glimpse of Xah Lee's Life 2010 (essay)

New version of Emacs: Xah Math Input Mode, xah-math-input.el (for math symbol and Unicode input). This version added about 102 full width symbols. For example: “fw&” becomes “&”. (these chars probably not useful to most, but i use the fullwidth version of ampersand often to avoid encoding complexity in HTML) happy using.

See: HTML Entities, Ampersand, Unicode, SemanticsProblems of Symbol Congestion in Computer Languages; ASCII Jam vs Unicode.

Elisp: Batch Find Replace

Emacs: Remapping Keys Using key-translation-map.

Discovered the command display-time-world . These days, when communicating with people around the world (in twitter, Skype, Second Life …), usually i need to know what time it is in their location. This command helps. Faster and more accurate than i can do mental calculation.

Am tired of using dictionary within emacs. See bottom of Emacs Dictionary Lookup for reasons.

Here's the complete solution to the asciify-word-or-selection problem. See bottom of Elisp: Asciify Unicode String (Zap Gremlins).

A Curious Look at Emacs One Thousand Keybindings

Update: How to Quickly Switch Fonts in Emacs

Emacs: some problems of slowdown (tabbar, font) (some report of my experiences)

Elisp: Asciify Unicode String (Zap Gremlins)

Discovered “artist-mode”. It's a mode that lets you draw ASCII pictures with the mouse. See: Emacs: manipulate Column Text, string-rectangle, ASCII-Art.

Much improved my code for “get-selection-or-unit”. Also, a “unit-at-cursor” function is created. This is separated out because sometimes you want to get the thing at point, without caring whether there's a text selection. For the code, see: Emacs: xah-get-thing.el.

refactoring my “.emacs”

Xah's log, stardate 2011-03-02T02:03:32-08:00.

Spent the past 5 hours refactoring elisp code in my emacs init. Not exactly thrilled. it's the kinda work that has no immediate benefit, but potentially disruptive. The software proverb goes: “if it ain't broken, don't fix it.”.

I'd say it's only half complete. But am tired of it at this (point). Actually, about every 4 months in past 4 years i spend several hours refactoring stuff there. (not counting the time adding stuff there) As the functions pile up, more time went into it. As my elisp kungfu increases, more is there to be refactored.

well, today, most work done is to replace “thing-at-point” by get-selection-or-unit. But alone the way, saw old code, and can't help to clean it.

Though, my strategy towards “.emacs” is still basically “don't bother unless you absolutely have to”. Emacs: Organize Init File.

sgml-delete-tag bug

See: Emacs Bugs.

Elisp: Find String Inside HTML Tag

Emacs: Insert Random Number/Hex/String

vi, Emacs, Keybinding Design

Emacs Custom Keybinding to Enhance Productivity

If you explore Second Life, try Emacs LSL Mode (xlsl-mode) for Linden Scripting Language.

Reminder. If you like this blog, you might also enjoy my other programer related blogs:

Usually i don't repeat a article in more than one place, even if it's related to both.

Bad Advice on Typing and Keyboard from Programers

Elisp: List

Find Replace is a central mechanism in text processing, especially in emacs. I took few hours to edit and re-organize several articles i've written that are all related to find replace. Here's the re-organized index. It gives a much more clear view on what each article is about and how they relate to each other.

Using a Elisp Function for Dynamic Replacement String

Multi-Pair String Replacement

If you like them, please support the site. You can support by buying computer stuff from Amazon links here. USB drives, keyboard and mouse, iPad, mobile phones, laptops, DVDs, etc. Or, you can get all my emacs and elisp tutorial. (See bottom of Xah Emacs Tutorial.) Or, you can support the site by a donation. Any amount counts. Thanks!

You can also ask emacs questions here: Ask Emacs.

A little avanced emacs lisp tip today. Elisp: Using thing-at-point.

ErgoEmacs version 1.9.2 binary for Windows is released. Download at ErgoEmacs 1.9.2 Setup.exe.


Thanks to David Capello for the build.

New version: Emacs: Xah Math Input Mode, xah-math-input.el

Elisp: Write grep (tutorial)

I'm creating a Ask Emacs page. There, you can ask all sort of questions about emacs or elisp.

Unicode 6 and Emacs 23.2 semi-Bug

See: Emacs Bugs.

Emacs Tip: Stop Org-Mode Opening File in Folded View

If you use org mode, you can set it to not open files in folded view. Put the following in your “.emacs”:

(setq org-startup-folded nil )

I find this useful because when i do interactive find replace on multiple files, if the org mode files open in folded view, you won't be able to see what's being replaced.

If you prefer to open org mode files in folded view, one solution is to temporarily set the variable org-startup-folded to nil before you do find replace in a dir. Just Alt+x set-variable.

A great tutorial about eshell. Mastering Eshell By Mickey Petersen. At http://www.masteringemacs.org/articles/2010/12/13/complete-guide-mastering-eshell/

See also: Emacs: eshell

Hauke Rehfeld send in this improved version of “fold”.

(defun fold (f x list)
  "Recursively applies (F i j) to LIST starting with X.
For example, (fold F X '(1 2 3)) computes (F (F (F X 1) 2) 3)."
 (let ((li list) (x2 x))
   (while li
     (setq x2 (funcall f x2 (pop li)))

This one improves upon on a primitive one i've written, which has problems if element in the list eval to nil.

Elisp: Simple Emacs Lisp Examples

Xah Emacs Packages. (a list of emacs lisp code i've written. Your support also very much appreciated.)

About 3 months ago, i started to use the CapsLock key for emacs “M-x”. That's fantastic. If you are on Windows, here's a util that can make it happen.

Download it at this page: System-wide ErgoEmacs Keybinding for Windows, Mac, Bash.

Useful for emacs users on Creating Keyboard Layout in Mac OS X.

Want to learn a new language in 2011? How about emacs lisp? [see What is Your Favorite Lisp]

Instead of a new year's resolution, which often are forgotten after Jan, let's have a resolution just for January.

So, what about setting a short-term goal for learning emacs and elisp? What do you wish to learn in January? Answer these questions. Before you answer, try to have a realistic, low-key goal, that you actually would achieve after Jan. Some of the questions below is about emacs/lisp if you think that's something you'll find helpful.

• Is there a language you wish to learn in Jan?

• What are some things you always wanted to know about emacs/elisp?

• Is it a particular emacs setup that's bugging you for a while?

• Any particular mode, package, you wished to install or know more?

• Do you have a basic understanding of elisp?

• Is it some basic understanding of elisp you always wanted?

• What would be some practical things that would help in your job?

• How much time you can devote to learning (your choice of new language or elisp)? (i recommend no more than 30 min a day, but at least every other day. You must stick to this schedule)

• At the end of the month, what would be some things that can concretely measure your effort? (a small set of learning notes? A small program as a project?)

Post your answers below.

If you have a question, put $5 at patreon and message me on xah discord.
Or support me by Buy Xah Emacs Tutorial