Why Emacs Is So Useful. (essay)
How To Swap Caps Lock, Alt, Control Keys On Windows.
A new version of AutoHotKey Mode For Emacs is out. This version fixes a defect where if the source code contains “"C:\"”, then everything after is badly syntax colored.
A new report: Emacs's Command Frequency. This report is a major update from the one in 2007, with data size that's 20 times larger. It took some 16+ hours to do this report, most time is spent on thinking and re-writing the python script that generates the report. (i thought it was just gonna be some 2 hours)
A new release of ErgoEmacs is out, at version 1.7. (Thanks to David Capello)
If your are running Microsoft Vista, and you use emacs to edit files in the “C:\Program Files\” or “c:\Program Files (x86)\” dir, and without admin privilege, Windows will automatically create them in “$HOME\AppData\Local\VirtualStore\”. This may be very confusing, because dired will show a certain file you have in the program dir, but it doesn't exist when you use shell to look for it. For detail, see File Aliases Considered A Plague.
“Zen-Coding”, A Abbrev Expansion Template System For HTML.
Emacs Function's Inline Doc String Markups (tutorial)
Using Emacs's Bookmark Feature (tutorial)
A new package: AutoHotKey Mode (xahk-mode.el) For Emacs. Took me about 8 hours to write, everything, including the web page, doc, this announcement etc, all. (i was expecting to be some 20 hours.)
Sometimes, i want to take out all the syntax coloring of some text. Never knew how to do that... but today i discovered font-lock-unfontify-region. Unfortunately, it's a function not command, so you cannot call it with “Alt+x”. So, i make one:
(defun unfontify-region (begin end) "Unfontify text selection. See also: `font-lock-fontify-block', `font-lock-fontify-buffer'." (interactive "r") (font-lock-unfontify-region begin end) )
Added a code snippet on More Elisp Examples. The code shows you how to write a function that cycle thru states when called repeatedly, and also explains the concepts of lisp's “symbol property”, setting font in a frame.
On Dec 26 2009, 8:50 pm, Ccming wrote:
I very like the default style of PHP lanuage on Notepad++, hope I can use them on GNU Emacs.
Yes.
i don't recommend it because emacs's font style for programing lang keyword types are used across all langs. For example, function is blue, strings is a bit orange, coments are red, etc., for all langs. Also, emacs's font face coloring are designed so it's also usable when in 8-color terminal.
anyway, to do what you want, do Alt+x customize-group, then give “font-lock-faces”. There, you can use the mouse to select and change.
you can see a sample of how emacs coloring are for different languages here: Google-code-prettify Examples.
When you use a hook, it is best to define it as a function, then add that to hook, instead of using a lambda. Let me explain.
Here's what a hook most people would do:
;; modify nxml-mode's shortcut keys (add-hook 'nxml-mode-hook (lambda () (define-key nxml-mode-map (kbd "<f8>") 'browse-url-of-buffer) (define-key nxml-mode-map (kbd "<tab>") 'html-next-content) (define-key nxml-mode-map (kbd "S-<tab>") 'html-previous-content)))
However, it is better done like this:
(defun xah-xml-mode-keys () "Modify keymaps used by xml-mode." (interactive) (define-key nxml-mode-map (kbd "<f8>") 'browse-url-of-buffer) (define-key nxml-mode-map (kbd "<tab>") 'html-next-content) (define-key nxml-mode-map (kbd "S-<tab>") 'html-previous-content) ) (add-hook 'nxml-mode-hook 'xah-xml-mode-keys)
There are minor advantages. One of them is that with a function name, you can now remove some of your hook stuff easily by calling “remove-hook”. Also, suppose you are using command-frequency-mode to know what commands you use the most. If you have lambda, the data will become unreadible with bunch of lambdas, instead of command names.
Of course, lambda in hook is so convenient, typically just used once in your emacs init file, and you don't need to manipulate it with remove-hook or others. But if you are using hooks in your elisp code in a package, it's best to define functions instead of using lambda in hooks.
Am starting this emacs blog. Often, i have random tips or notes i want to write down. Too small to be part of tutorial, but still useful even to myself later. This blog also serve as news update for my emacs tutorial. I have a main blog Periodic Dosage of Xah Lee but that is not focused on emacs topic. Many people are interested in my emacs news but not others. So, this emacs blog will help.
What follows are emacs related stuff from my main blog in the past 4 months. I put them here to start with, and also gives some sense of the topics in this blog.
- Trackball Mouse Reviews
- Gaming Mouses
- Emacs xbbcode-mode For Editing BBCode
- Microsoft IntelliType Hacks
- Problems of Microsoft IntelliType
- Problems of Emacs's Manual
- A Review of 3 Dictionaries
- Windows Environment Variables
- Emacs Does Not Support Viewing Images Files In Windows
- Idiocy Of Keyboard Layouts
- A Short Survey Of Keyboard Shortcut Notations
- Emacs Lisp Suggestion: A Function For Copying and Deleting Whole Dir
- Mac and Windows File Conversion
- Problems of Emacs Supporting Obsolete Systems