Xah Emacs Blog Archive 2014-05

ELisp: 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: Show Image Thumbnails (on its own page)

Emacs Init: How to Install Package Manually (minor update)

Emacs Workflow: Fullscreen vs Multiple Frames

Emacs Init: Setup Font (updated)

Emacs: Install Package with ELPA/MELPA (minor update)

Emacs: Visual Line Mode (old article, on its own page)

see also: Emacs 23 (Released 2009-07)

Emacs: Move Cursor to Punctuation 🚀

Computer Languages Character Distribution (with JavaScript + svg charts)

Emacs: Xah Math Input Mode (xah-math-input.el) (new version)

thanks to Rusi and Alan Schmitt.

Linux: xmodmap Tutorial (updated)

ELisp: Docstring Markup (updated)

added a whole section on how to deal with region and kill-ring. ELisp: How to Write a Command

ELisp: Mark, Region, Active Region (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

Keyboard Modifier Keys, Short Survey

Xah's Truly Ergonomic Keyboard Layouts (updated)

You can download the layout now. Thanks to [ LuminousMonkey ] https://twitter.com/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 , accessed on 2014-05-12 ]

ELisp: List (updated)

Emacs: Search Text in Directory (minor update)

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

ELisp: Write grep (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 Replace (xah-find.el)

Why Emacs Keys 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 to 2012)]

Emacs: Interactive Abbrev 🚀 (goodie from 2013)

Emacs: Insert A to Z Vertically 🚀 (updated)

minor update: Emacs: 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

Ban 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 https://github.com/mattfidler and David Capello [https://davidcapello.com/] , 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}

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

ELisp: 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