emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

compilation-start-hook


From: Sam Steingold
Subject: compilation-start-hook
Date: Mon, 17 Nov 2008 11:14:27 -0500
User-agent: Thunderbird 2.0.0.14 (X11/20080506)

I use "omake -P" which monitors files and automatically recompiles when they change, i.e., the process in the compilation buffer never exits. However, I do not want to be asked about a running process when I do C-x C-c, so I thought of adding compilation-start-hook:

--- compile.el.~1.481.~ 2008-11-17 10:09:59.000000000 -0500
+++ compile.el  2008-11-17 11:04:27.000926000 -0500
@@ -92,6 +92,17 @@ (defcustom compilation-mode-hook nil
   :group 'compilation)

 ;;;###autoload
+(defcustom compilation-start-hook nil
+  "List of hook functions run by `compilation-start' on the compilation 
process.
+\(See `run-hook-with-args').
+If you use \"omake -P\" and do not want \\[save-buffers-kill-terminal] to ask whether you want
+the compilation to be killed, you can use this hook:
+  (add-hook 'compilation-start-hook
+    (lambda (process) (set-process-query-on-exit-flag process nil)) nil t)"
+  :type 'hook
+  :group 'compilation)
+
+;;;###autoload
 (defcustom compilation-window-height nil
   "Number of lines in a compilation window.  If nil, use Emacs default."
   :type '(choice (const :tag "Default" nil)
@@ -1277,6 +1288,7 @@ Returns the compilation buffer created."
                    (process-send-eof proc)
                  ;; The process may have exited already.
                  (error nil)))
+             (run-hook-with-args 'compilation-start-hook proc)
              (setq compilation-in-progress
                    (cons proc compilation-in-progress)))
          ;; No asynchronous processes available.


any objections?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]