2(defvar cq-compilation-started 'nil)
4 (setq compilation-finish-functions 'cq-call) ;; this function called when compilation has finished - see compile.el
5 (setq compilation-exit-message-function
6 (lambda (status code msg)
7 ;; If M-x compile exists with a 0
8 (when (and (eq status 'exit) (zerop code))
9 ;; then bury the *compilation* buffer, so that C-x b doesn't go there
10 (bury-buffer "*compilation*")
11 ;; and return to whatever were looking at before
12 (replace-buffer-in-windows "*compilation*"))
13 ;; Always return the anticipated result of compilation-exit-message-function
14 (message "Compilation Error")
19"Adds function before point to a queue. The first function is called when there are at least two functions in the queue"
22 (search-backward-regexp "(\\(.*\\))")
23 (if (boundp 'funclist)
24 (add-to-list 'funclist (intern (match-string-no-properties 1)) t)
25 (setq funclist (list (intern (match-string-no-properties 1)))))
26 (setq overlay-arrow-position (make-marker))
27 (setq overlay-arrow-string "1")
28 (set-marker overlay-arrow-position (line-beginning-position)
31 (message "Added %s" (match-string-no-properties 1))
32 (unless cq-compilation-started (cq-start))
36(defun cq-add-func (func)
37 "Adds function given as argument to a queue. The first function is called when there are at least two functions in the queue"
39 (if (boundp 'funclist)
40 (add-to-list 'funclist (func) t)
42 (setq funclist (list func)))
43 (message "Added %s" func)
44 (unless cq-compilation-started (cq-start))
48;;(setq compilation-finish-functions 'nil)
49(setq compilation-finish-functions 'cq-call) ;; this function called when compilation has finished - see compile.el
51(defun cq-call (buffer string)
52 "Calls the next function in the global variable funclist"
53 (if (and (boundp 'funclist) (not (eq funclist nil))) (funcall (pop funclist))
54 (cq-after-compilation)
55 (setq cq-compilation-started 'nil)) ;; while list is not nil!
60"Starts the compilation process"
62(if (boundp 'funclist) (progn
63 (funcall (pop funclist))
64 (setq cq-compilation-started 't))
65 (message "Queue is empty!"))
69"Displays the compilation queue"
71(if (boundp 'funclist) (print funclist t))
75"Clears the compilation queue"
80 (setq cq-compilation-started 'nil)))
88(defun cq-after-compilation ()
90 (setq visible-bell 'nil)