Some (X)Emacs stuff

I am the author of two little developments for (X)Emacs:

To use these two files, download them and put them (untar holes.tgz with the command tar xvfz holes.tgz, you get a directory with four files) somewhere Xemacs can find them. Then put this in you initialization file:

(require 'holes)
(require 'circul)

The files span.el, span-extent.el and span.el are from the ProofGeneral mode. Everything is under GPL. It should work on both FSF Emacs(21) and Xemacs. Ideas for improvement and bug reports are welcome.

Emacs and LaTeX

Here is a minimum config you should add to your .emacs (replace (control fxx) by the keystroke you want). RefTeX should be installed by default if you have a standard installation of (x)emacs:
 (add-hook 'LaTeX-mode-hook '(lambda () 
    (turn-on-reftex); Turn on RefTeX Minor Mode for all LaTeX files
    (define-key LaTeX-mode-map [(control f12)] 'TeX-next-error)
    (define-key LaTeX-mode-map [(control f11)]
      '(lambda () (interactive) 
         (TeX-command-menu "LaTeX")))
Now hit (control f11), it compiles, if there are some errors, type (control f12) and it goes straight to the error and shows the message.
Here are some hacks I made:
This one allows to have a keystroke which runs latex on your file, then waits for the process to finish, and then sends a signal to xdvi telling him to watch the file (change "xdvi.bin" by the exact name of the process if necessary). That way you don't have to switch to xdvi's window each time.

  (defun send-sig (process-string sig)
     "sends sig to every process having name process-string"
     (shell-command (concat "killall " sig " " process-string) nil))
  (defun wait-latex-xdvi ()
     "wait for the latex process to stop, and send the USR1 signal to all
running xdvi.bin processes, which makes xdvi watch the file it shows."
     (if (TeX-active-process) (start-itimer "wait latex" 'wait-latex-xdvi 1)
        (send-sig "xdvi.bin" "-USR1")))
  (add-hook 'LaTeX-mode-hook '(lambda () 
    (define-key LaTeX-mode-map [(control f11)]
      '(lambda () (interactive) 
         (TeX-command-menu "LaTeX")	  
         (start-itimer "wait latex" 'wait-latex-xdvi 1)))))

Pierre Courtieu
Last modified: Tue Jan 6 08:53:58 MET 2004