User Tools

Site Tools


development:emacs:compile-cmd

Compile Commands

Some compile extensions located in my site-specific Emacs configuration file:

  • compile history (F7):
    (setq compile-history
          (list "make -C <dir1> ..."
                "make -C <dir2> ..."))
 
    (setq compile-command (car compile-history))
 
  • additional compile command (C-S-F7):
    (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
development/emacs/compile-cmd.txt · Last modified: by Ralf Hoppe