Allows to:
It is quite useful when one needs to quickly switch between different places in one or several buffers, typically when programming.
It is very light, as emacs provides something called "registers" which mainly does the work. Actually this package only simplifies the key bindings for this feature by dedicating some keys to it (like the keys of the num pad).
The file circul-keys-pc.el is an example of key assignation for circul.el, it makes use of the keypad on the right of a standard pc keyboard (I never use it). Modify it as you want, a good idea is to use f(1-10) keys instead.
This is inspired from other interactive programs ( Pcoq ). It allows to defines "holes" in your buffer. A hole is a piece of text (with nothing particular except it is highlighted) that may be replaced by another piece of text later. This feature is useful to build complicated expressions by copy pasting several peaces of text from different parts of a buffer (even from different buffers). Holes are just highlighted pieces of your buffer, nothing is written in your file and you can delete holes exactly like normal characters (there are other ways to delete a hole, see below).
There is always one or zero active hole, highlighted with a different color.
To define a hole, two methods:To activate a hole, click on it with the button 1 of your mouse.
To forget a hole without deleting its text, click on it with the button 2(middle) of your mouse.
To destroy a hole and delete its text, click on it with the button 3 of your mouse.
To replace the active hole first make sure it is active, then two methods:
to jump to the active hole, just hit meta-return. You must be in the buffer containing the active hole. the point will move to the active hole, and the active hole will be destroyed so you can type something to put at its place. The following hole is automatically made active, so you can hit meta-return again.
It is also useful in conjonction with abbreviations, for example in c-mode I use "f" as an abbreviation for for(#;#;#) {#}, where each # is a hole, then hitting meta-return goes from one hole to the following and I can fill-in each hole very quickly. This last trick needs some very simple manipulation on your abbrev file. See some examples in my : abbrev file .
There are four files in this archive, three of them are used to deal with this f... Emacs/Xemacs incompatibility.
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-load)
(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.
(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. See also the ref menu to navigate through the table of
content of your document.
(defvar latex-process-timer nil
"the timer used to watch latex and dvips processes.")
(defun send-sig (process-string sig)
"sends sig signal to every process having name process-string"
(interactive)
(call-process "killall" nil nil nil sig process-string))
(defun wait-latex-xdvi ()
"wait for the latex process to stop, and send the USR1 signal to all
running xdvi.bin processes"
(if (TeX-active-process)
()
(let ((x (current-message)))
(send-sig "xdvi.bin" "-USR1")
(if (featurep 'xemacs) (delete-itimer latex-process-timer)
(cancel-timer latex-process-timer))
(message x))
)
)
(defun latex-xdvi ()
(interactive)
(TeX-command-menu "LaTeX")
(setq latex-process-timer (run-with-timer 1 1 'wait-latex-xdvi)) ;; latex-process-timer is a global variable
)
Then replace the control f11 shortcut above by this one:
(add-hook 'LaTeX-mode-hook '(lambda ()
...
(define-key LaTeX-mode-map [(control f11)] 'latex-xdvi))
)