Xah Emacs Blog

Xah Teaches Emacs Lisp

that's a dedicated page for this month's emacs lisp lessons.

mouse hover tooltip function doc

the mouse hover tooltip now has better background color, and the iPad bug is fixed. You can close the bubble by clicking on it.

for example, goto this page, hover over a elisp function name. On tablet or phone, click it. Emacs Lisp Basics

The Glory of a Real Hacker: Ann Arbor Ambassador 60 Terminal

Ann Arbor Ambassador 60 Terminal By jwz. @ https://www.jwz.org/blog/2016/10/export-termaaa-60/

emacs history must read.

Coding Convention? Burn It.

Linus in “Linux kernel coding style” said:

“First off, I'd suggest printing out a copy of the GNU coding standards, and NOT read it. Burn them, it's a great symbolic gesture.”

from reddit, on emacs coding convention. https://www.reddit.com/r/emacs/comments/585osx/emacs_lisp_style_guide/d906u1j

That's a good point. But on a separate note, to a lesser degree, programer's practice of coding style, may be questionable.

Google has many coding styles, including python, HTML, and even Common Lisp. Its python style guide does not necessary agree with Guido's.

Many coding style includes name format convention such as camelCase vs pot_hole_case, do we actually have scientific data about these matters? (there's a couple, but not trust worthy.)

the coding styles may serve more of a purpose of bounding a particular community.

The rules given by bbatsov (i assume community driven) isn't followed by one of the most popular package on MELPA. For example, dash.el ends predicate function with a question mark.

also, gnu emacs suggest cutting lines to 70 char per line in doc. This is not a good convention. The 70 char per line came from punch cards. Coding style sometimes stifle innovation.

GNU Emacs also has a convention that parameter names be ALLCAPS in the docstring. This limits the possibility of actually having ALLCAPS as parameter name, since emacs is case sensitive, and it adds manual burden to programer.

GNU Emacs also has a convention that parameter names be ALLCAPS in the docstring. This limits the possibility of actually having ALLCAPS as parameter name, since emacs is case sensitive, but more so, it adds manual burden to programer. A better way is to introduce markers, similar to emacs `symbol' convention.

check this link out, by the guy who created the Mongrel web server that was used by twitter. (also famous for http://programming-motherfucker.com/ )

〔 Programming Languages Have Social Mores Not Idioms 2012-08-19 By Zed A Shaw. @ http://learncodethehardway.org/blog/AUG_19_2012.html

Instead of naming convention and other misc conventions, what might be a step forward, and is happening today in many languages, is to make it part of the language, enforced either by syntax or by the lang's compiler. For example, predicate function all ends in ?, mutation functions ends in !, or dollar sign sigils means global system var, Caps var name means global var, @ sigil means instance var, etc, all enforced by the lang.

Some convention seems obviously good. But, we need awareness of the many problems. By keep discussing about coding style as we have done so, we dilute the idea of automated and language enforced.


corrected a bug from yesterday. Emacs: comment-line vs comment-dwim

Emacs: comment-line vs comment-dwim

Emacs: Cycle Replace Space Hyphen Underscore (more change. Now, by default it works on current line. (it was current word before))

Emacs: Rename File from Space to Hyphen/Underscore (updated code. Now first check if there's space before rename. So you don't get error like file already exist.)

Emacs: Insert Date Time (major rewrite. Now choice of several date time formats.)

Emacs: Tabs, Space, Indentation Setup (updated.)

Emacs: Insert Brackets by Pair (updated code. now, brackets will wrap around symbol when in lisp modes)

Emacs: Reformat Lines for Source Code (bug fix. Now, run of space will be compacted to 1. Refresh page.)

Emacs: Clean Empty Lines (fixed a bug that prevents before save hook from working.)

Emacs: Replace Greek Letter Names to Unicode (new)

Emacs: xah-replace-pairs.el Multi-Pair Find Replace

new version. The functions xah-replace-pairs-region and xah-replace-regexp-pairs-region now have options to let you highlight. That is, the replaced string will be highlighted in buffer.

Emacs: Open Last Closed File. Add that, if you haven't already.

Emacs: Rename File from Space to Hyphen/Underscore (on its own page)

The command posted yesterday also reverted, so they are not dependent. See Emacs: Cycle Replace Space Hyphen Underscore

Emacs: Cycle Replace Space Hyphen Underscore

new feature. When in dired, it automatically rename current or marked files by replacing space to underscore. You can modify it to rename to using hyphen.

emacs: user-error: tags file doesn't exist

“user-error: File /home/y/TAGS does not exist”

3 hours wasted trying to find where is that path set.

Couldn't find it in any elisp file in my init, lib, or “.emacs.d”.

it seems emacs memorized prev value i used long ago.

Solution: (setq tags-table-list '()) once.

Emacs: Xah Fly Keys

page updated. More efficient than vim, or any emacs keybinding out there.

Emacs: Lookup Google, Dictionary, Documentation (updated)

Xah Emacs Packages Panel Index

new nav panel index for my packages.

Emacs Lisp: How to Create Keymap for Major Mode (new)

Xah Emacs Tutorial Update

emacs tutorial. New version out. Major rewrite to tens of articles in past 2 months. In particular, the lisp tutorials at Practical Emacs Lisp.

Buy Xah Emacs Tutorial

Recommend to a friend, Buy it. Thanks.

sending out update to previous buyers today.

emacs doge comment coloring

Emacs Lisp: How to Color Comment in Major Mode

completely rewritten.

Emacs Lisp: How to Write Keyword Completion Command

much revised and expanded.

stop ido-mode suggestion when write-file (aka save as)

Put the following in your emacs init:

(require 'ido)
;; stop ido suggestion when doing a save-as
(define-key (cdr ido-minor-mode-map-entry) [remap write-file] nil)

added to Emacs: Switch Buffer, ido-mode

got a cold

been sick in the past few days. Better now. What a pleasure it is to type code again.

i'll be rewriting several pages about how to write a major mode. Here Emacs Lisp How to Write Major Mode Panel Index

several pages there needs a review badly, in particular the keyword completion how-to and comment coloring how-to.

I think i'll finish that first, before i sent out the tutorial updates.

sorry about the delay in tutorial update.

elisp lesson will also continue. If you are late in the game, see Xah Teaches Emacs Lisp.

Do, Do, Do the exercises. That's the only way to learn.

gnu emacs 25.1 released

announcement at https://lists.gnu.org/archive/html/emacs-devel/2016-09/msg00451.html

For linux, download from the link given above.

building emacs on linux is easy. see

How to Build Emacs on Linux

You can get Microsoft Windows binary version at




new features

release notes https://www.gnu.org/software/emacs/news/NEWS.25.1

Artur Malabarba's blogs about emacs 25 features: http://endlessparentheses.com/tags-expanded.html#emacs-25

Mickey Petersen's blog about what's new https://www.masteringemacs.org/article/whats-new-in-emacs-25-1

Emacs Fun Panel Index

new side panel. A fun one. Pictures and logos stuff mostly.

Bought Xah's Emacs Tutorial, Didn't Receive It?

there's one guy in Germany who never received my tutorial. It seems you never got my emails. Can you message me if you see this?

If that's you, can you check your spam box? You can contact me on twitter https://twitter.com/ErgoEmacs/status/776663494573686785 or Google Plus https://plus.google.com/113859563190964307534 Thanks

Practical Emacs Lisp, Shaping into Course Material

Practical Emacs Lisp

the navigation panel on the side has seen more cleaned up.

(you may need to refresh and clear cache by Ctrl+⇧ Shift+r. )

I'm shaping the elisp tutorial into a focused course material.

random how-to and example articles are now collected at Emacs Lisp Misc Panel Index. For now.

Emacs Lisp: Cut Copy Paste to/from kill-ring (minor update)

elisp symbols, property list

Emacs Lisp Symbol (tutorial) (updated)

Emacs Lisp Function (on its own page)

Emacs Lisp Property List (new page)

Emacs Lisp Symbol Property List (new page)

Emacs: Font Configuration (minor update. added a screenshot.)

new command. xah-goto-matching-bracket

Emacs: Move Cursor to Brackets, Quotes (refresh page)

Emacs: Move Cursor to Brackets, Quotes

updated. Those commands, are critically important. They are far more useful than buildin emacs ways to navigate lisp code.

Emacs: Navigate Lisp Code as Tree (on its own page)

Emacs Lisp How to Write Major Mode Panel Index

new navigation panel. Few minor updates to the pages, will be going thru them in coming days.

Emacs Lisp: Replace HTML Entities (code update. Now make a report of occurence.)

Emacs Lisp: Unicode Representation in String (minor update)

Emacs Lisp: Hash Table (updated)

Emacs Lisp: Function Optional Parameters (added full examples)

list vector sections rewritten. That's it for today.

suppose you want add space around = in your code? just modify this command. Emacs Lisp: Multi-Pair String Replacement with Report

Emacs Lisp: Get User Input

major rewrite on how to use (interactive …) form.

Emacs: Keyboard Macro (now with its own navigation panel of 5 example.)

efficient way to type parenthesis, brackets

type brackets, i always use emacs to insert pairs e.g.

see Emacs: Insert Brackets by Pair (minor update)

if you have a Kinesis keyboard, ergodox, or other with key macro feature, you can program that into the keyboard so it's universal. 〔➤see Best Keyboard for Emacs

for those of you ergodox or kinesis users, here's some idea of layout i've been building. I'm collecting and polishing them continuously.

Kinesis Keyboard Optimal Thumb Cluster Layout

Emacs College Flag

PowerShell in Emacs Lisp Shell: Divide by Zero

Kinesis Advantage2 Keyboard is now on amazon!

Get it.

Kinesis Advantage2 Keyboard

the Advantage2's key macro/layout feature is truly superb. It has a embeded flash drive! You can open/mount it in OS without needing special driver/software. All key macros and layouts are stored as plain text files, you can simply edit and reload! This is in addition to creating macro/layout by pressing the special progm key.

I'll be writing more about this feature in detail in coming days.

my review Kinesis Keyboard Review

Xah Emacs Tutorial free for the next few days

杀杀 #Emacs# 教材,这几天免费下载。

这里 download here https://www.reddit.com/r/emacs/comments/4y0qpw/looking_for_an_emacs_tutorialbook_to_give_to/

say some good words. Thanks.

new nice photo of the Knight keyboard. Dad of the Space-cadet. Space-cadet, Lisp Machine Keyboards

emacs tutorial. New version out. Lots updates in past month. Recommend to a friend, Buy it. Thanks.

Buy Xah Emacs Tutorial

Emacs: Delete Paragraph, Text Block (minor update code. Now does on selection first if any)

Emacs: Abbrev Mode Tutorial (complete rewrite. Now properly using emacs commands.)

Kinesis Keyboard Unboxing review, first day Kinesis Keyboard Unboxing Gallery

Kinesis Advantage 2 Keyboard released

Kinesis keyboard advantage2 poster 37113
Kinesis Advantage 2 Keyboard. Kinesis Advantage2 Keyboard

see my introduction at Kinesis Keyboard Review (you can pre-order from a link there)

i'll be doing a hands-on video review in a few days. Am waiting for the keyboard to arrive.

i'll also be designing a layout for Emacs: Xah Fly Keys and ergoemacs-mode (http://ergoemacs.github.io/)

basically, lots things will be said in the coming months. You wait for it!

Best Keyboard for Emacs (also updated)

emacs emoji abbrev
emacs emoji abbrev

see Emacs: Abbrev Mode Tutorial

see also Unicode Emoji 😄 😱 😸 👸 👽 🙋

Emacs Lisp: Twitterfy (updated code)

LISP Logo sticker

lisp logo sticker 2016-08-02
LISP logo sticker, by Duncan Holm. 〔➤see LISP Logo

thanks to a friend.

Emacs Modernization

about 50 articles on improving emacs, now have side panels.

Most are written in the period 2006 to 2011. Some of them have been fixed in emacs.

Like it? Buy Xah Emacs Tutorial. Thanks.

or, buy something from my keyboard store.