Personal tools
You are here: Home wiki emacs
Views

Edit history

Edit: -1 of 1
Time: 2006-06-08 20:16:16
Note: /copilotconsulting.com/wiki/Emacs/PUT

changed:
-
I've used vi (mostly the "VIM":http://www.vim.org implementation of
vi) for 8+ years but I have decided to give emacs a try. I have always
admired it from afar. The famous extensible editor. Now that I am
doing more coding than ever it's time to figure out what people have
been raving about for so many years. I feel like a smoker trying to
quit. Getting off of vi is hard!

Anywho, here are some emacs links and info that I have found useful.

First, you are going to need some handy docs that tell you how to use
this thing. The "GNU Emacs manual is nice.":http://www.gnu.org/software/emacs/manual/

Your emacs distribution comes with a file called refcard.ps
Unfortunately it is formatted in a bizarre way. You can reformat it
for normal letter sized paper with three columns per page like this::

 psnup -h10.5in -w9.4in -H13in -W6in -l -3 -s.7 /usr/share/emacs/21.4/etc/refcard.ps > output.ps

Or regenerate it from the original tex source like so::

 tex /sw/share/emacs/22.0.50/etc/refcard.tex 
 dvips -t letter -t landscape -o refcard.ps refcard.dvi
 ps2pdf refcard.ps


Then get rid of that stupid caps lock key (which nobody should ever
touch) and remap it to a control key which emacs really depends
on. You can do this by putting this in your .Xmodmap file::

 remove Lock = Caps_Lock
 remove Control = Control_L
 keysym Control_L = Caps_Lock
 keysym Caps_Lock = Control_L
 add Control = Caps_Lock
 add Control = Control_L

Courtesy of
"snarfed.org":http://snarfed.org/space/gnu+emacs+backup+files here is
some code for your .emacs file to keep all of those auto-save and backup
files in one place instead of scattered everywhere::

  ;; Put autosave files (ie #foo#) in one place, *not* scattered all over the
  ;; file system! (The make-autosave-file-name function is invoked to determine
  ;; the filename of an autosave file.)
  (defvar autosave-dir (concat "/tmp/emacs_autosaves/" (user-login-name) "/"))
  (make-directory autosave-dir t)
  
  (defun auto-save-file-name-p (filename)
    (string-match "^#.*#$" (file-name-nondirectory filename)))
  
  (defun make-auto-save-file-name ()
    (concat autosave-dir
            (if buffer-file-name
                (concat "#" (file-name-nondirectory buffer-file-name) "#")
              (expand-file-name
               (concat "#%" (buffer-name) "#")))))
  
  ;; Put backup files (ie foo~) in one place too. (The backup-directory-alist
  ;; list contains regexp=>directory mappings; filenames matching a regexp are
  ;; backed up in the corresponding directory. Emacs will mkdir it if necessary.)
  
  (defvar backup-dir (concat "/tmp/emacs_backups/" (user-login-name) "/"))
  (setq backup-directory-alist (list (cons "." backup-dir)))

And then if you are a Gnome user you will find that gnome-terminal
intercepts the meta-w (forward-word) key as the hot-key to the file menu. This is clearly not acceptable. In the gnome-terminal window click Edit->Keyboard shortcuts and then click "Disable all menu access keys"

Other links:

"A Tutorial Introduction to GNU Emacs":http://www.lib.uchicago.edu/keith/tcl-course/emacs-tutorial.html

"EMACS: The Extensible, Customizable Display Editor":http://www.gnu.org/software/emacs/emacs-paper.html

"Multics Emacs: The History, Design and Implementation":http://www.multicians.org/mepap.html

"emacs wiki":http://www.emacswiki.org

"Emacs Code Browser":http://ecb.sourceforge.net/

What does Emacs stand for?

- Escape Meta Alt Control Shift

- Eighty Megs And Constantly Swapping

- Eight Megs And Constantly Swapping

- EMACS Makes A Computer Slow

- EMACS Makes All Computing Simple

- EMACS May Allow Customized Screwups

- Embarrassed Manual-Writer Accused of Communist Subversion

- Engine Monitoring and Control System

- Equipment Maintenance Accounting and Control System

- Equipment Management and Control System

- Escape Meta Alt Control Shift

- Eventually Malloc()s All Computer Storage

- Extensible Macro System

- Editor M A C ro S

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: