Xah Emacs Blog Archive 2013-10
emacs 25 features rectangular region
we are going to have rectangular region soon, with highlighting, as in cua-mode
.
Stefan Monnier discusses about it in emacs dev list here: http://lists.gnu.org/archive/html/emacs-devel/2013-10/msg00904.html
thanks to Fuqiao Xue (xfq) https://github.com/xfq/ for the heads-up.
if you are not familiar with existing features that lets you edit rectangular region, see: Emacs: Edit Column Text, Rectangle
Emacs = Best Unicode Tool
It's Halloween. Emacs exercise: type this JACK-O-LANTERN character 🎃 in emacs, and find out its decimal and hexadecimal code. Bonus: find all Unicode chars that has the word LEAF in it.
btw, emacs is the best unicode tool. Better than anything i know of.
If you need help, check out Emacs: Insert Unicode Character.
much update with links. Emacs: What's the Best Setup for Python, Ruby, Java, JavaScript, etc?
emacs lisp sort = destructive
a interesting question from Riley E yesterday.

one thing puzzled me was that why dotimes
doesn't construct the list fresh each time.
post your comment at Ask Emacs Tuesday 2013-10-29
Elisp: Count Lines, Words, Chars (oldie. Get you started on emacs lisp.)
Emacs: List Matching Lines (oldie. useful)
Tuesday again: You ask, me answer, at your service. Ask me anything about emacs. I'll be happy to answer. Post your question at Ask Emacs Tuesday 2013-10-29
I have a question too. In Linux, how to make Chinese input work in emacs? (using the Linux system-wide input, not emacs's. (我也有一个问题。在 Linux 下,如何让中文输入工作在 emacs?))
last Tuesday is a bit busier than usual. Check it out at Ask Emacs Tuesday 2013-10-22
Emacs: Delete Current File 🚀 (oldie)
- Linux: Set System Keyboard Layout ⌨
- Linux: Swap Control Alt Keys, xmodmap
- Linux: Keyboard Software Guide ⌨
New compact mechanical keyboards: Noppoo Choc Mini and Filco Majestouch Minila. See: Keyboards without Numeric Keypad
Recently, the ergodox keyboard is available on sale, and become very popular among hardcore keyboard geeks. Here's my analysis of its design, with lots beautiful photos people made. Ergodox Keyboard Review
Razer Orbweaver Gaming Keypad (Added high resolution user photo. This one's got mechanical keys for all your windows manipulation pleasure. Never press a key chord again.)
Richard Stallman on Steve Jobs's Death (oldie)
keyboard news. Now the Matias Mini Tactile Pro is available on amazon. Buy at amazon both Mac and PC versions. For my review, see: Matias Mini Tactile Pro Keyboard
288 photos of the lisp machine space cadet keyboard. Ogle time. flickr
See also: Space-cadet Keyboard and Lisp Machine Keyboards
Helpful Packages for Perl/Emacs regex Conversion/Learning
Helpful packages for those coming from {perl, python, JavaScript} regex:
- [2013-10-19 pcre2el ] ( https://github.com/joddie/pcre2el )
- [2013-10-19 regex-tool ] ( https://github.com/jwiegley/regex-tool )
These are in MELPA repository. 〔see Emacs: Install Package with ELPA/MELPA〕
Here's what they do:
pcre2el or rxt (RegeXp Translator or RegeXp Tools) is a utility for working with regular expressions in Emacs, based on a recursive-descent parser for regexp syntax. In addition to converting (a subset of) PCRE syntax into its Emacs equivalent, it …
regex-tool
After you type M-x regex-tool, you will see three buffers: *Regex*, *Text* and *Groups*. The *Regex* buffer contains your regular expression. By default, this tool uses Emacs regular expressions. If you customize the variable `regex-tool-backend', you can switch to using full Perl regular expressions.
The *Text* buffer contains the sample text you want to match against. Change this however you like.
The *Groups* buffer will list out any regular expression groups that match. Your regular expression is searched for as many times as it appears in the buffer, and any groups that match will be repeated.
The results are updated as you type in either the *Regex* or *Text* buffer. Use C-c C-c to force an update. Use C-c C-k to quit all the regex-tool buffers and remove the frame.
(Thanks to Steve Purcell for the tip.)
ergoemacs-mode = simple efficient keybinding and customizable
i write a lot about keybinding design, often they are esoteric and of little interest to most people.
If you want something simple about efficient keybinding, just use ergoemacs-mode. All the cremes of keybinding design are there, with good documentation, extensively customizable, and Matt is quick to answer and fix bugs, daily. (just look at its github repository) So, check it out, read the doc, ask questions or say thanks to Matt.
am writing about this again because Matt has just been adding features and bug fixes daily. Taking people's feedback, and fix bugs and answer questions, and also work with other packages and developers to make the emacs world better. Am very much impressed.
Emacs on a USB Stick, and 64 Bits Emacs for Microsoft Windows
There's now a 64 Bits binary Emacs for Microsoft Windows, always the latest emacs version, prepared by [Fabrice Popinea https://plus.google.com/108659671652610976578/posts].
Download at
http://semantic.supelec.fr/popineau/programming-emacs.html
Also, if you run emacs on USB, there's a nicely prepared portable emacs app
by [Matthew L Fidler https://plus.google.com/100239989767196954209/posts].
Download at
https://github.com/mattfidler/EmacsPortable.App
I linked them at Which Emacs to Download. Check it out.
Ask Emacs Tuesday 2013-10-22
For you keyboard layout fans. I just realized that Maltron layout may have significant advantage over others. See: Maltron vs Dvorak keyboard Layout
LISP dignitary Peter Norvig wrote a article, saying that one should learn a language in 10 years. yeah, right, let's retreat to a mountain and horn our skills for a decade. The Condition of Industrial Programers: Learn LISP in 10 Days
How Many Keystrokes Programers Type a Day? (updated. Also see comment by Johann Swart)
emacs lisp: add underline for lite-weight title markup
here's a command that adds a line ==========
under the current line, but with the same number of chars. This is useful for mark up titles in lite-weight markup such as ReStructuredText.
here's the solution.
(defun add-title-underline () "add ========= below current line, with same number of chars." (interactive) (let ( (num (- (line-end-position) (line-beginning-position) )) (ii 0)) (end-of-line) (insert "\n") (while (< ii num) (insert "=") (setq ii (1+ ii) ) ) ))
Thanks to ryuutei for asking. Ask Emacs Tuesday 2013-08-27
Best Unicode Fonts for Programer (updated)
Emacs Init: Set Default Major Mode (minor update)
TypeMatrix Keyboard Review (update with photos)
Ergonomic Keyboard Layouts (updated)
Why ZXCV Undo Cut Copy Paste Keys Are Bad? (updated)
keybinding design articles
several articles of past month, related to keybinding design, now each on a page of its own.
- Emacs: Move Cursor by Text Block 🚀
- Emacs Repetitive Strain Injury is Coming for You
- Emacs: menu e vs Tab Key
Emacs: Move Cursor to Bracket 🚀 (updated)
Which Chapters of Elisp Manual to Read?
Ask Emacs Tuesday 2013-10-15
Emacs: Cycle Space Hyphen Underscore (updated on xah-cycle-hyphen-underscore-space)
Question: how to setup emacs's whitespace-mode so single space doesn't show as dot? Got that interesting question from a comment by Pascal Emacs: Show Whitespaces#comment-1079798211
if you want emacs to automatically save, not emacs #auto-save# but real automatic save, you can try http://www.litchie.net/programs/real-auto-save.html
What Email Package You Use? Answer: I Use Function Keys!
one FAQ i get is what email package i use in emacs, or what package for twitter, irc, etc.
sadly, i use browser. Because for email, twitter, irc, etc, it's much config and perpetual management issue. You have to spend hours and hours, and every month or 2, on the config issue, update, management. But also, usually the features are far less. e.g. pictures in twitter, html mail, search problems… and those twitter etc API changes regularly, and using emacs for those sucks more memory, surprise!
however, i do heavy typing in emacs only. Just set F7 key to switch to emacs, F8 to prev app. For how to setup on {Windows, Mac, Linux}, see: How to Set Key to Switch to Browser
also, {F2, F3, F4} to {cut, copy, paste}, and one key to cut or copy entire buffer without even needing to select. Also, you want a single key to open a new buffer, and single key to close. (all these are in ergoemacs-mode in MELPA)
all the hell is one single key press, at most a sequence of 2 keys. (no key-chords)
that's why i kept saying the importance of function keys.
- Increase Productivity Using Function Keys
- Computer Keyboard: Using Number Keypad as Function Keys
- Emacs Keys: Key Sequence
- Keyboard Master: One Thousand Function Keys
- Programable Keypads
also, i use mouse. Hover over a window and it comes to front, no need to even press a key. So, just put your emacs window on one edge of screen, and browser in another edge, and terminal in another edge. You are all set! For how, see: Single-click Open File
and, it's great if you have 100-buttons mouse. Nothing's more painful when in browser you have to switch to keyboard to type a key chord to switch tab or close tab or go back to previous page. Just push a button on your mouse, right there. (or, a single key on keyboard) For some suggestions on which mouse to get, see: Best Mouse for Programers: 17 Buttons. I use the Logitech G700.
feel free to ask me questions about it at Ask Emacs Tuesday 2013-10-08
if you use 50 emacs packages, the load time may be a bit hard to manage. Here's a package that solves the problem. https://github.com/jwiegley/use-package. I haven't used it myself, but it's by John Wiegley, so i trust the code will do the right thing. (thanks to [Rafał Babinicz https://plus.google.com/104054809690343822036/posts] for the tip.)
Ask Emacs Tuesday 2013-10-08
diagnose your emacs init launch time
try this. https://github.com/dholm/benchmark-init-el have you tried it? let me know how it works out.
major update. The Japanese layout version of the HHKB has arrow keys and other keys. Better. Still, no cigar. Happy Hacking Keyboard (HHKB)
Topre Mechanical Switch Keyboard: Real Force
just discovered, that if you want a Keyboard with the Topre Mechanical switch, another option is the Real Force brand keyboard. They are quite expensive. Most sites i see starts at $290. For example:
- “Realforce Keyboard English Layout XF11T0” Buy at amazon
- “Topre Realforce Keyboard Anniversary Limited” Buy at amazon
However, i found this one that's amazon for only $150! “Topre Type Heaven 104 key Keyboard” Buy at amazon
it's the company's lower priced offering. It's cheaper because they switched the keycap tech (from some PBT to ABS. Something you'd care only if you are keyboard connoisseur).
The Topre switch is supposedly better than Cherry MX. If you don't know about them, see:
- Guide to Keyboard Key Switch Mechanisms
List of Keyboards with Mechanical Switches
sorry, lots keyboarding articles recently. Just updated again this article: Bad Keyboard Advice from Programers
designing a command keybinding or letter-key layout is like squeezing a water balloon. The designer of the walkman layout Oj Bucao said it the best:
It's like playing with a water balloon. If you squeeze on one side, it bulges on other sides.
—〔The Workman Keyboard Layout Philosophy By Oj Bucao. At http://www.workmanlayout.com/blog/ , accessed on 2013-10-02〕
basically, you just have 10 keys, but you have 100 commands. Can't fit 10 pigeons into one hole.
once by efficiency analysis you decided that a new command X should be mapped to a key, but after using it, you realized “damn, i really missed my command Y, i want it back!”. This happened to me over and over again.
Emacs 24 Common Lisp Package Name Change
news. Video reviews of the batman keyboard. Check it out. Microsoft Sculpt Ergonomic Keyboard Review
very useful. Computer Keyboard: Using Number Keypad as Function Keys
Emacs Advanced dired Tips (very useful. minor update)
Elisp: Functions on Line (very useful to know and slightly updated.)
wireless mouse with 3-years battery life❗
discovered a mouse. Logitech Wireless Marathon Mouse M705 Buy at amazon
this one, has 5 buttons, good for average people, and it has Logitech's spin-wheel. But the main thing is, it's wireless with 3-year Battery Life❗