
Table of Contents
Emacs developed by Richard Stallman
The name is short for Editor Macros
XEmacs split to enhance GUI elements
Very similar but some packages work with one or the other
Console and Graphical modes
Core written in C
Core includes ELisp Interpreter
![]() | Note |
|---|---|
For the remainder of this presentation, I will refer to ELisp simply as Lisp. | |
Most of the functionality is written in lisp
Customize with lisp
Idea is to make command mnemonic
Chording commands
Ctrl written as C
Meta Written as M
Esc works as Meta but sometimes Alt does as well
Either love or hate chording
Chording works same in console and gui mode
XEmacs separates buffers from files
Buffers are transient and in memory
Editing is done on buffers
Buffers are saved to files
Can have a buffer without a file
Can have multiple buffers open simultanously
XEmacs starts in the buffer <code>*scratch*</code>
C-x C-f
C-x C-s
C-x s
C-k
C-y
C-x C-c
C-h a
C-g
M-x (interactive function)
M-x help
Enough Lisp to be Dangerous
Atoms
Lists
Symbols
Symbolic expression, S-expressions, sexp
<code>(function arg1 arg2 ... )</code>
<code>(print "hello world" (get-buffer "*scratch*"))</code>
How many functions are in this list?
Quoting prevents evaluation
(setq default-major-mode 'text-mode)
Functions can also be arguments
This leads to a highly dynamic form of programming
All functions can be evaluated from a buffer.
Some Functions can be entered interactively.
Table of Contents
M-x auto-fill-mode
To make it automatic you need to edit init file ~/.xemacs or ~/.emacs, and can add auto fill to other modes like cc mode.
(setq default-major-mode 'text-mode) (setq text-mode-hook 'turn-on-auto-fill)Can restart XEmacs or evaluate lisp code interactively by positioning the cursor at the end of each sexp you want to evaluate then chording <code>C-x C-e</code>
(global-set-key '(button4) 'scroll-down-command) (global-set-key '(button5) 'scroll-up-command)
(require 'font-lock) (setq-default font-lock-maximum-decoration t) ;; Highest level of coloration
See XEmacs FAQ Q5.0.1 and XEmacs FAQ Q5.0.3
Suppose we want to enter the current date frequently.
The function <code>current-time-string</code> provides the required information. If it is evaluated with <code>eval-print-last-sexp</code> it inserts the information, but with quotes.
(current-time-string)C-j "Wed May 31 09:41:29 2006"
We can write a function to do what we want, which is insert rather than print
(defun insert-current-time-string () "Insert the current time at point" (insert (current-time-string)))C-x C-e
(insert-current-time-string)C-x C-e Wed May 31 09:58:31 2006
Now if we want call the function interactivly we need to add the <code>interactive</code> declaration.
(defun insert-current-time-string () "Insert the current time at point" (interactive) (insert (current-time-string)))C-x C-e
M-x insert-current-time-string
Lets bind it to a key to reduce typing
(global-set-key 'f5 insert-time-string)C-x C-e
If interactivity is not required we can do it all in one step with a <code>lambda</code> (anonymous) function.
(global-set-key 'f5
(lambda () (insert (current-time-string)))C-x C-e
Works for C and C++
Highly customizable
M-x compile
Jump to next compile error C-x `
Can identify syntax errors
Try M-x function-menu
To add the function menu permantly put this in your .emacs file.
(require 'func-menu) (add-hook 'find-file-hooks 'fume-add-menubar-entry)
AUCTEX is a sopistocated document editing system for TEX systems. It is available from the AUCTEX Homepage
The most current version is not yet available for automatic installation. So this is how to install it manually.
Download and verify the XEmacs package
$ cd $HOME/dist $ wget -nv http://ftp.gnu.org/pub/gnu/auctex/auctex-11.82-pkg.tar.gz 14:51:47 URL:http://ftp.gnu.org/pub/gnu/auctex/auctex-11.82-pkg.tar.gz [870092/870092] -> \ "auctex-11.82-pkg.tar.gz" [1] $ wget -nv http://ftp.gnu.org/pub/gnu/auctex/auctex-11.82-pkg.tar.gz.sig 14:52:35 URL:http://ftp.gnu.org/pub/gnu/auctex/auctex-11.82-pkg.tar.gz.sig [65/65] -> \ "auctex-11.82-pkg.tar.gz.sig" [1] $ gpg --verify auctex-11.82-pkg.tar.gz.sig gpg: Signature made Mon Jan 16 10:03:42 2006 EST using DSA key ID 3C6B854E gpg: Good signature from "Reiner Steib <reiner.steib@gmx.de>" gpg: WARNING: This key is not certified with a trusted signature! gpg: There is no indication that the signature belongs to the owner. Primary key fingerprint: FDC7 BB69 6D06 D80F 4412 BFD0 E222 255A 3C6B 854E
Default Package Heirarchies
Local and 3rd party packages <code>$prefix/lib/xemacs/site-packages</code>
MULE-enabled XEmacsen <code>$prefix/lib/xemacs/mule-packages</code>
Normal packages <code>$prefix/lib/xemacs/xemacs-packages</code>
User packages <code>$HOME/.xemacs/xemacs-packages</code>
Unpack the package
$ cd $HOME/.xemacs $ mkdir xemacs-packages $ gunzip -c $HOME/dist/auctex-11.82-pkg.tar.gz | tar -xf - $ ls etc info lisp man pkginfoFor more information see the XEmacs Manual
Make the LaTeX files available.
$ cd $HOME/texmf/tex/latex $ ln -s /home/gdowdin/.xemacs/xemacs-packages/etc/auctex/latex auctex
Webpage TRAMP