The Geek Parade - emacs tips 2
[Recent Entries][Archive][Friends][User Info]
12:00 pm
[Link] |
emacs tips 2 * intro This is the second of the emacs tips series. The previous tip was sent earlier to some people on this list. I resent it with the license and so that it would be archived here. (Earlier versions will be available there)
For a look ahead, note that each email is formatted in org-mode. These can be read in emacs org-mode or exported as html; to be explained in a later tip. The next tips should be approximately weekly.
* the .emacs file
This is the initialization file that sets up your particular emacs environment, and it is the starting point for making emacs do exactly what you want. The file is usually found in the home directory (e.g., /Users/pball or /home/pball); the home directory is written as ~/
The first thing emacs does when it is run is to load and to evaluate the ~/.emacs file. "Evaluate" means that all the lisp commands in .emacs are executed. Remember that emacs is a lisp interpreter, and it's running all the time. Lisp programs that you run affect how emacs works. This can be helpful and a lot of fun.
* cool stuff to put in .emacs
Semicolons ; indicate comments in elisp. I've commented the following that you might want in your .emacs file.
(setq inhibit-startup-message t ;; you've seen it enough recursive-load-depth-limit nil ;; let emacs use all the resources it wants line-number-mode t ;; errors often point to line numbers column-number-mode t ;; good to keep you the left of 70 size-indication-mode t ;; I like to remember how big the file is frame-title-format "%b" ;; put the filename on the window title menu-bar-mode t ;; let's keep the menu bar visible-bell 1 ;; and DO NOT make noise pop-up-windows nil ;; self-explanatory pop-up-frames nil ;; ditto global-font-lock-mode t ;; turn code-coloring on font-lock-maximum-decoration t ;; make code maximally colorful mouse-yank-at-point nil ;; paste where you're pointing, not at `point' transient-mark-mode t ;; require-final-newline t ;; always put \n at the end of the file (stata...) tool-bar-mode nil ;; we don't need icons on a tool bar show-paren-mode t ;; always make parens colorful delete-selection-mode t ;; delete a marked block if user types global-auto-revert-mode t ;; always reload buffer if the file changes savehist-mode 1) ;; remember the ring of commands at M-x.
* if these emails don't work for you
There are lots of strategies to learn emacs: other tutorials, books, and example code. The following sites give lots of other sources of information.
http://www.gnu.org/software/emacs/manual/emacs.html http://www.emacswiki.org/cgi-bin/emacs-en/LearningEmacs http://tiny-tools.sourceforge.net/emacs-elisp.html
* less silly than it seems http://catb.org/~esr/writings/unix-koans/
One evening, Master Foo and Nubi attended a gathering of programmers who had met to learn from each other. One of the programmers asked Nubi to what school he and his master belonged. Upon being told they were followers of the Great Way of Unix, the programmer grew scornful.
“The command-line tools of Unix are crude and backward,” he scoffed. “Modern, properly designed operating systems do everything through a graphical user interface.”
Master Foo said nothing, but pointed at the moon. A nearby dog began to bark at the master's hand.
“I don't understand you!” said the programmer.
Master Foo remained silent, and pointed at an image of the Buddha. Then he pointed at a window.
“What are you trying to tell me?” asked the programmer.
Master Foo pointed at the programmer's head. Then he pointed at a rock.
“Why can't you make yourself clear?” demanded the programmer.
Master Foo frowned thoughtfully, tapped the programmer twice on the nose, and dropped him in a nearby trashcan.
As the programmer was attempting to extricate himself from the garbage, the dog wandered over and piddled on him.
At that moment, the programmer achieved enlightenment.
* License: CreativeCommons Attribution-ShareAlike 3.0 You are free: * to Share — to copy, distribute and transmit the work * to Remix — to adapt the work Under the following conditions: * Attribution. You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work). * Share Alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under the same, similar or a compatible license. * For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to this web page. * Any of the above conditions can be waived if you get permission from the copyright holder. * Nothing in this license impairs or restricts the author's moral rights. See http://creativecommons.org/licenses/by-sa/3.0/ for the full text. * last revised: [2007-04-08 01:21PDT]
Tags: emacs
|
|