From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sam Steingold Newsgroups: gmane.emacs.devel Subject: compilation-start-hook Date: Mon, 17 Nov 2008 11:14:27 -0500 Message-ID: <49219863.1040900@gnu.org> Reply-To: Emacs Devel NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1226938486 1431 80.91.229.12 (17 Nov 2008 16:14:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 17 Nov 2008 16:14:46 +0000 (UTC) To: Emacs Devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 17 17:15:48 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1L26lN-0000T5-5n for ged-emacs-devel@m.gmane.org; Mon, 17 Nov 2008 17:15:45 +0100 Original-Received: from localhost ([127.0.0.1]:50395 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L26kE-00006m-Jl for ged-emacs-devel@m.gmane.org; Mon, 17 Nov 2008 11:14:34 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L26kA-00005x-98 for emacs-devel@gnu.org; Mon, 17 Nov 2008 11:14:30 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L26k9-00005c-0d for emacs-devel@gnu.org; Mon, 17 Nov 2008 11:14:29 -0500 Original-Received: from [199.232.76.173] (port=34008 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L26k8-00005Z-Mm for emacs-devel@gnu.org; Mon, 17 Nov 2008 11:14:28 -0500 Original-Received: from mx1.janestcapital.com ([38.105.200.101]:59963) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1L26k8-0002qg-J2 for emacs-devel@gnu.org; Mon, 17 Nov 2008 11:14:28 -0500 Original-Received: from nyc-qsv-mail1.delacy.com ([172.25.22.57]) by mx1.janestcapital.com with esmtp (Exim 4.69) (envelope-from ) id 1L26k7-0003AF-Jo for emacs-devel@gnu.org; Mon, 17 Nov 2008 11:14:27 -0500 Original-Received: from nyc-qws-005.delacy.com ([172.25.131.105]) by nyc-qsv-mail1.DELACY.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1L26k7-0003Py-OW for emacs-devel@gnu.org; Mon, 17 Nov 2008 11:14:27 -0500 User-Agent: Thunderbird 2.0.0.14 (X11/20080506) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:105751 Archived-At: 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?