Xah Emacs Blog Archive 2014-05 to 2014-05

Emacs Lisp: Enable Undo in Buffer

Emacs: Cycle Fonts by Command (major update)

Emacs vs vi: How to Compute a Keybinding's Efficiency?

Keyboard Layout, Is Inverted Number Row Better? (updated with chart)

Emacs: View Image Thumbnails (on its own page)

How to Install Emacs Package Manually (minor update)

Emacs: Effective Windows Management

Emacs: Font Configuration (updated)

Emacs: How to Install Packages Using ELPA, MELPA (minor update)

Emacs: Visual Line Mode, Wrap Lines at Word Boundaries (old article, on its own page)

see also: Emacs 23.1 New Features (released 2009-07)

Emacs: Jump to Punctuation

Computer Languages Character Distribution (with JavaScript + svg charts)

Emacs: Xah Math Input Mode (new version)

thanks to Rusi and Alan Schmitt.

Linux: xmodmap Tutorial (updated)

Emacs Lisp: Doc String Markup (updated)

added a whole section on how to deal with region and kill-ring. Emacs Lisp: How to Write Commands

Emacs: What's Region, Active Region, transient-mark-mode? (updated)

there are 2 persons who bought my emacs tutorial, but reply to their email addressed got error. So, if you haven't yet received it, please let me know. (xahlee@gmail.com or xah@xahlee.org)

Emacs Bug: file-remote-p 2014-05-15

vi, vim, 3 Decades Pile of History

PC Keyboard Modifier Keys — A Short Survey (updated)

Xah's Truly Ergonomic Keyboard Layouts (updated)

You can download the layout now. Thanks to LuminousMonkey

Sacha Chua just posted the transcript. 〔 Emacs Chat: Xah Lee (ErgoEmacs) By Sacha Chua. At http://emacslife.com/emacs-chats/chat-xah-lee.html

Emacs Lisp: List (updated)

Emacs: Search Text in Files (minor update)

Sacha Chua's Emacs Chat with Phil Hagelberg (aka Technomancy)

How to Write grep in Emacs Lisp (repost)

wee. The power of emacs lisp.

(xah-find-replace-text-regex "; keyboard\">amazon</a>" "\" data-category=\"keyboard\">amazon</a>" "~/web/" "\\.html$" t t t)

(xah-find-replace-text-regex "; ⌨\">amazon</a>" "\" data-category=\"keyboard\">amazon</a>" "~/web/" "\\.html$" t t t)

(xah-find-replace-text-regex "; comp\">amazon</a>" "\" data-category=\"computer\">amazon</a>" "~/web/" "\\.html$" t t t)
(xah-find-replace-text-regex "; comp\">Amazon</a>" "\" data-category=\"computer\">amazon</a>" "~/web/" "\\.html$" t t t)

(xah-find-replace-text-regex "; book\">amazon</a>" "\" data-category=\"book\">amazon</a>" "~/web/" "\\.html$" t t t)

(xah-find-replace-text-regex "; movie\">amazon</a>" "\" data-category=\"movie\">amazon</a>" "~/web/" "\\.html$" t t t)

(xah-find-replace-text-regex "; music\">amazon</a>" "\" data-category=\"music\">amazon</a>" "~/web/" "\\.html$" t t t)
(xah-find-replace-text-regex "; 🎶\">amazon</a>" "\" data-category=\"music\">amazon</a>" "~/web/" "\\.html$" t t t)

(xah-find-replace-text-regex "; ⌨\">" "\" data-category=\"keyboard\">" "~/web/" "\\.html$" t t t)
(xah-find-replace-text-regex "; keyboard\">" "\" data-category=\"keyboard\">" "~/web/" "\\.html$" t t t)
(xah-find-replace-text-regex "; 🎶\">" "\" data-category=\"music\">" "~/web/" "\\.html$" t t t)
(xah-find-replace-text-regex "; comp\">" "\" data-category=\"computer\">" "~/web/" "\\.html$" t t t)

I routinely update my site's html systematically sidewide, on about 7k files. About every 3 months for the past 7 years.

I do these changes to it keep up with HTML evolution, and also improve the markup to be more semantically meaningful, and or improve SEO.

if your site is dynamically generated by some content management system, then you (usually) just modify one template. But for me, my site is static HTML, raw. So, i rely on regex find replace.

The xah-find-replace-text-regex is a interactive command. It prompts you for find regex, replacement text, and dir path regex, whether to actually write to the file, whether case sensitive search, whether case sensitive replacement. Once i called it, i can call repeat-complex-command to get the lisp code. Then, i can easily modify the elisp in a buffer and eval it to do other find replace without going thru the interactive prompt, and sometimes this is more convenient.

Why didn't you just use emacs's dired-do-query-replace-regexp?

one reason is that dired-do-query-replace-regexp prompt you for each find replace. Sure you can press a key to do them in batch, but then you don't get to see what's been replaced.

xah-find-replace-text-regex does batch, and does a report of what's replaced, with option of whether to write to file.

You can find the code at: Emacs: xah-find.el, Find Replace in Pure Elisp

Why Emacs's Keyboard Shortcuts are Painful (slightly revised)

Also note, lisp pioneer Daniel Weinreb's blog〔danweinreb.org〕 has changed hands. Now it seems like a SEO site. If you have link to it, be sure to change it to Wayback Machine such as http://web.archive.org/web/20121014112316/http://danweinreb.org/blog/

〔►see Lisp Programer Daniel Weinreb Died (1959 – 2012)

Emacs: Interactive Abbrev (goodie from 2013)

Emacs: Insert Alphabets A to Z (updated)

minor update: Emacs Lisp: Insert Random UUID. (thanks to Hideki Saito)

on that page, is a piece of code contributed by Christopher Wellons, and Christopher is going to be interviewed by Sacha, on at https://www.youtube.com/watch?v=Hr06UDD4mCs. Mark your calendar.

Emacs: Display Key and Command in Real Time

Banish Shift Key

Emacs: Interactive Abbrev (repost)

Sacha Chua's Emacs Chat (minor update. Refresh page.)

Who Do You Like to See in Sacha Chua's Emacs Chat?

Sacha Chua asks who do we like to see in her emacs chat?

Here's a short list i like to see:

just a few people i know off hand. Didn't have time to compile a full list. Some i didn't have time to include link to website or how i knew them. Sorry. Also, i only included those that might have general interest. Also exclude some she already planned.

and of course, Matthew L Fidler and David Capello, who can give a much better intro to ergoemacs-mode than i can.

on vi Keybinding vs Emacs Keybinding (updated)

Cursor Movement Keys: vim's {h j k l} vs Inverted T {i j k l}

random misc articles. Lots rants. Emacs Related Essays (now slightly better grouping of the index of articles)

I had a great time chatting with Sacha. See: Sacha Chua's Emacs Chat

Emacs Lisp: Get universal-argument (minor update)

emacs chat with Sacha Chua

Live chat with Sacha Chua on Google Hangout. TODAY at 5pm. ( Friday PDT 5pm (California time)) Join us at https://plus.google.com/events/c5e0anjpg4v7n1jtjuor4mromos

Emacs: Remapping Keys Using key-translation-map