Xah Emacs Blog Archive 2012-11 to 2012-11

Emacs: Delete Current File

Bad Advice on Typing and Keyboard from Programers

Symbol for the Menu Key

Unicode joy. Found a appropriate symbol to represent the menu key. For example: ▤ Menu.

So, now i have: Shift, ⌘ command, ⌥ option, ❖ Window, ▤ Menu, Return ↩, Enter ↵, ⌫ Backspace, ⌦ Delete, Tab.


The ▤ Menu key by default calls execute-extended-command in GNU Emacs on Linux. On Microsoft Windows, you can define it yourself. See: Emacs: Add Custom Keys to Enhance Productivity.

See also: Emacs: Unicode Tutorial.

Define keys to open frequently used files quickly. See: Emacs: Add Custom Keys to Enhance Productivity.

Ask Emacs Tuesday.

updated: How to Write grep in Emacs Lisp

major update: Keyboard Shortcut Design: Dedicated keys, Special Buttons, Extra Keys

updated: Apple Computer Keyboards Review

much redesign of the keyboard home page. All you need to know about keyboard. If you have questions, feel free to ask me. Comment, or any of the social network. Thanks. Computer Keyboards, Layouts, Hotkeys, Macros, RSI ⌨

updated: Emacs: Batch Rename Files

I love Unicode. Here's many articles about Unicode. I just redesigned the page's appearance a bit. Also, several emacs articles about Unicode there too. Check it out and let me know your thoughts! Unicode Gallery and Tutorial ∑ λ ∞ π © ™ § ¶ ☺ ♀ ♂ ♥

Digging deeper into yesterday's issue: A design issue: What Should be Used for Source Code Section Marker

Updated: Emacs: How to Move Around Source Code Section (^L) and Text Blocks

Thanks to Steve Purcell ( https://twitter.com/sanityinc ) for a big tip.

Emacs: Cycle Fonts by Command

Emacs Tuesday again, for . This time, let's do something fun. List 3 emacs mode. It can be major mode, minor mode, can be builtin or 3rd party. You can select your favorite, or ones you can't live without, or most appreciated mode, or something you feel should be more widely known, however you want to chose. But 3 only. ☺

You can call describe-mode to see a list of currently active modes. Also goto ~/.emacs.d/elpa to see what modes you have installed via packages. And don't forget the many builtin language modes.

Past questions here: Ask Emacs Tuesday

Emacs: Using Registers (Multiple Clipboards)

old tip. Updated: Emacs: Insert Parenthesis by Pair: electric-pair-mode

Some dired tips: Emacs Advanced dired Tips (File Management)

Emacs Lisp Problems: Trim String, Regex Match Data, Lacking Namespace

A new version of emacs/elisp tutorial is available. Do you enjoy my tutorial? Buy for $5. At: Buy Xah Emacs Tutorial. Thank you. If you've bought it before, please do email to xah@xahlee.org with subject “emacs tutorial upgrade”.

Tuesday again. Ask Emacs Tuesday! Ask any emacs question, and i'll try my best to find the answer for you.

Here's the type of questions i'm best at answering: anything involving emacs usage, tricks, or how emacs lisp works. How to use emacs help, keys, commands, buffers. I've used emacs for over a decade, read most of the emacs and elisp manual. So, if you haven't used emacs for long, these questions i can easily help 70% off the bat!

am also able to answer questions about common practice, such as whether something you need is or isn't done in emacs, workarounds. Or i can redirect you to proper online resources or people for questions i can't answer.

Question that i may not answer well are specialized modes that's not part of emacs, or some symptoms on your machine.

also love to discuss emacs history, convention, culture, and my particular take on some issues (sometimes it's controversy!).

if you are experienced, i'd very much appreciate your help in answering, recommendations, tips, or see your emacs init files! Richard Stallman would be fond of us sharing emacs init files.

Questions can be posted to g+, facebook, twitter, sina weibo. See links here: Ask Emacs Tuesday. Past questions also archived there.

What to Do with Emacs Lisp.

Starting Emacs with Bookmark

To have emacs open bookmarks on startup, add this to the end of your elisp init file:

(setq inhibit-splash-screen t)
(require 'bookmark)
(switch-to-buffer "*Bookmark List*")

thx to Michael Lockhart for asking.

See also: Emacs: Bookmark Tutorial.

I wanted to thank many supporters. I recently updated this page that collects positive comments about my tutorial: Testimonial on Xah's Emacs Tutorial. and also this page: Testimonial for ergoemacs-mode. Again, the tutorial is available for just $5. Buy Xah Emacs Tutorial. Thanks to many of you who showed support.

I got asked this often about how to open recently opened files. Answer: call recentf-mode, then Alt+x recentf-open-files. See: How to Set Emacs's User Interface.

recently i started to type Chinese a lot. In Asian languages, they often use Asian version of punctuation. For example, , and .. [see Intro to Chinese Punctuation]

So, i wrote this command. It lets me transform the punctuations of current text block by one key press.

See: Emacs: Convert English/Chinese Punctuations

find/replace utils in emacs lisp: xah_file_util.el

If you want to do find replace on many files, you are probably better with dired-do-query-replace-regexp. See: tutorial on dired-do-query-replace-regexp.

If you want to do find replace on multiple files in batch (like unix “sed” or perl script), you can use the package xah_file_util.el at http://code.google.com/p/ergoemacs/source/browse/packages/xah_file_util.el

;; This package exports the follow functions:
;; xah-find-text               → grep
;; xah-find-text-regex         → regex grep
;; xah-find-count              → grep count
;; xah-find-replace-text       → sed
;; xah-find-replace-text-regex → sed

The advantages are: ① written in elisp (no need to install unix utils if on Windows) ② uses emacs regex. ② find string can span multiple lines. ③ separate commands for regex and literal text, and find report (like grep) ④ nice output report on changed text.

I wrote it and have been using it daily for about half a year. It works fine, but isn't polished. For example: the documentation isn't very good. Your comment welcome. If you are on Linux, then this will probably not be useful to you, because emacs integration with Linux is very good, and there's lots built-in emacs commands that call Linux grep and friends.