Some compile extensions located in my site-specific Emacs configuration file:
(setq compile-history (list "make -C <dir1> ..." "make -C <dir2> ...")) (setq compile-command (car compile-history))
(defvar compile-history-2 (list "make -C <dir1> ..." "make -C <dir2> ...") "compilation history for command `compile-custom-2'") (defun compile-custom-2 () "Run a make (compile)" (interactive) (let* ((cmd compile-command) (hist compile-history) (compile-history compile-history-2) (compile-command (car compile-history-2))) (call-interactively 'compile) (setq compile-command cmd ;restore original compile command compile-history-2 compile-history ;save current history compile-history hist))) ;restore original history