Xah Emacs Blog Archive 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.

Examples:

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

See also: Emacs: Unicode Tutorial.

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

Ask Emacs Tuesday.

updated: ELisp: Write grep

Keyboard Shortcut vs Launch Buttons major update

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 Search πŸ˜„

Digging deeper into yesterday's issue: A design issue: Emacs Form Feed ^L Problems

Updated: Emacs: Form Feed ^L (Page Break)

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: Copy to Register

old tip. Updated: Emacs Init: Auto Insert Closing Bracket (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 Google Plus, 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)
(bookmark-bmenu-list)
(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 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: Emacs: Init File Tutorial.

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 Chinese/Japanese Full-Width/Half-Width 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: (1) written in elisp (no need to install unix utils if on Windows) (2) uses emacs regex. (2) find string can span multiple lines. (3) separate commands for regex and literal text, and find report (like grep) (4) 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.