Xah Emacs Blog Archive 2014-05 to 2014-05

Buy Xah Emacs Tutorial. Master emacs benefits for life.

Emacs: Enable Undo in Buffer

How to set major mode to use a font?

for much more, see: Emacs: How to Set Font by Major Mode and Quickly Switch Fonts? (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 Packages Manually (minor update)

Emacs: Effective Windows Management

How to set default font in emacs init file?

Emacs: How to List & Set Font (updated)

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

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

see also: New Features in Emacs 23

Emacs: Commands to Jump to Punctuations

Computer Languages Character Distribution (with JavaScript + svg charts)

Emacs Unicode Math Symbols Input Mode (xmsi-mode) (new version)

thanks to Rusi and Alan Schmitt.

Linux: xmodmap Tutorial ⌨ (updated)

Emacs Lisp: Inline Docstring Markup (updated)

added a whole section on how to deal with region and kill-ring. Emacs Lisp Idioms for Writing Interactive 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. @ http://emacslife.com/emacs-chats/chat-xah-lee.html

Emacs Lisp Tutorial: List & Vector (updated)

Emacs: Searching for Text in Files (grep, find) (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: https://code.google.com/p/ergoemacs/source/browse/packages/xah_file_util.el

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/

〔➤ Daniel Weinreb Died ((1959 〜 2012) Lisp Programer)

Emacs: Interactive Abbrev in Shell (goodie from 2013)

Emacs Lisp: Insert Alphabets A to Z (updated)

minor update: Emacs Lisp: Insert Random ID, 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: Show Key & Command

Banish Shift Key

Emacs: Interactive Abbrev in Shell (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: Writing Command to Accept 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

blog comments powered by Disqus