I'm working on a script that can compile multiple directories and then provide the first error to a file. Currently, I am tackling the issue of running make in multiple directories portion. I am making use of the compilation-finish-function hook in order to continue the compilation in the next directory. However, in this function, I get the following error:
error in process sentinel: Symbol's value as variable is void: >
The way the following script works is as follows:
- Currently (and unfortunately) using a globally defined DIRS symbol that stores the list of directories
- my-compilation-finish-function operates on the DIRS list, popping the first element and setting DIRS to rest of the list
- compile-in-dir-helper runs the make command on the new directory
- compile-in-dir runs is the only interactive command and relies on the compilation hook to finish compilation in the rest of the directories
I need some kind of conditional in the hook, otherwise an infinite loop condition can occur with an empty directory variable is passed to the helper function indefinitely. I'm not sure why the sentinel is complaining of the condition function, however.
(setq
DIRS
'(
"dir1"
"dir2"
"dir3"
))
(defun my-compilation-finish-function (buffer desc)
;;; (message "Buffer %s: %s" buffer desc)
;;; (if (< (length 'DIRS) 0)
(cond (> (length DIRS) 0) (
;;; (cond '(eql 1 0) (
(setq directory (car DIRS))
(compile-in-dir-helper directory)
(setq DIRS (cdr DIRS)))))
(add-hook 'compilation-finish-functions 'my-compilation-finish-function)
(defun compile-in-dir-helper (dir)
(setq make_cmd (concatenate 'string "make -j1 -C" dir))
(compile make_cmd))
(defun compile-in-dir ()
(interactive)
(compile "make -j1 -C ~/dir0"))