From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Ittay Dror Newsgroups: gmane.emacs.help Subject: Re: Compilation: save file xxx Date: 19 Mar 2003 14:58:48 +0200 Organization: Qlusters Inc. Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <1048078728.31792.18.camel@rum> References: <4yr893tu5d.fsf@skjellgran.ii.uib.no> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1048078898 22578 80.91.224.249 (19 Mar 2003 13:01:38 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 19 Mar 2003 13:01:38 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Wed Mar 19 14:01:36 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18vdCJ-0005rq-00 for ; Wed, 19 Mar 2003 14:01:35 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18vdBT-0004lw-07 for gnu-help-gnu-emacs@m.gmane.org; Wed, 19 Mar 2003 08:00:43 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18vdAJ-00042z-00 for help-gnu-emacs@gnu.org; Wed, 19 Mar 2003 07:59:31 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18vdAD-0003y5-00 for help-gnu-emacs@gnu.org; Wed, 19 Mar 2003 07:59:25 -0500 Original-Received: from adsl-139-109.barak.net.il ([62.90.139.109] helo=hirame.qlusters.com) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18vdA3-0003sH-00 for help-gnu-emacs@gnu.org; Wed, 19 Mar 2003 07:59:16 -0500 Original-Received: from [10.100.0.13] ([10.100.0.13]) by hirame.qlusters (8.10.2/8.10.2) with ESMTP id h2JCsJ008387 for ; Wed, 19 Mar 2003 14:54:19 +0200 Original-To: help-gnu-emacs@gnu.org In-Reply-To: <4yr893tu5d.fsf@skjellgran.ii.uib.no> X-Mailer: Ximian Evolution 1.2.2 (1.2.2-3) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:7712 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:7712 On Wed, 2003-03-19 at 14:31, Joakim Hove wrote: > Hello, > > I find compiling programs from within emacs very useful, however I > have one small grievance: > > When I invoke the compile command emacs offers to save all buffers, > including buffers which are *totally* unrelated to the current > compilation. Is it possible to limit this questioning to a set of > files/directories/regexp/...? > > > Regards - Joakim Hove you can define a function which looks at the current buffer and returns t if it should be saved. say its name is 'save-my-buffers' then do (defun compile (command) (interactive (if (or compilation-read-command current-prefix-arg) (list (read-from-minibuffer "Compile command: " (eval compile-command) nil nil '(compile-history . 1))) (list (eval compile-command)))) (unless (equal command (eval compile-command)) (setq compile-command command)) (save-some-buffers (not compilation-ask-about-save) 'save-my-buffers) ;; <--- this is the change from the original compile (compile-internal command "No more errors")) hope it helps, ittay -- =================================== Ittay Dror (ittay@qlusters.com) User Space Team, R&D Qlusters Inc. +972-3-6081976 Fax: +972-3-6081841