From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.bugs Subject: [Fwd: Re: Compilation: save file xxx] Date: Fri, 21 Mar 2003 09:16:08 -0700 Sender: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: <3E7B3AC8.2030905@ihs.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1048263737 16209 80.91.224.249 (21 Mar 2003 16:22:17 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 21 Mar 2003 16:22:17 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 21 17:22:15 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 18wPGw-0004AD-00 for ; Fri, 21 Mar 2003 17:21:34 +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 18wPDu-0000mR-00 for gnu-bug-gnu-emacs@m.gmane.org; Fri, 21 Mar 2003 11:18:26 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18wPCa-0000OF-00 for bug-gnu-emacs@prep.ai.mit.edu; Fri, 21 Mar 2003 11:17:04 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18wPBr-0006cn-00 for bug-gnu-emacs@prep.ai.mit.edu; Fri, 21 Mar 2003 11:16:23 -0500 Original-Received: from chx400.switch.ch ([130.59.10.2]) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.10.13) id 18wPBh-00060t-00 for bug-gnu-emacs@prep.ai.mit.edu; Fri, 21 Mar 2003 11:16:09 -0500 Original-Received: from mail.fu-berlin.de ([160.45.11.165]) by chx400.switch.ch with esmtp (Exim 3.20 #1) id 18wPBY-0007Sr-00 for gnu-emacs-bug@moderators.isc.org; Fri, 21 Mar 2003 17:16:00 +0100 Original-Received: by mail.fu-berlin.de (Smail3.2.0.98) from Curry.ZEDAT.FU-Berlin.DE (160.45.10.36) with esmtp id ; Fri, 21 Mar 2003 17:15:58 +0100 (MET) Original-Received: by Curry.ZEDAT.FU-Berlin.DE (Smail3.2.0.98) from news.fu-berlin.de with bsmtp id ; Fri, 21 Mar 2003 17:15:58 +0100 (MET) Original-To: gnu-emacs-bug@moderators.isc.org Original-Path: 170.207.51.80!not-for-mail Original-Newsgroups: gnu.emacs.bug Original-Lines: 74 X-Orig-NNTP-Posting-Host: 170.207.51.80 X-Orig-X-Trace: fu-berlin.de 1048263357 76534442 170.207.51.80 (16 [82742]) User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 X-Accept-Language: en-us X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:4642 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:4642 It would be nice if one could call save-some-buffers like this: (save-some-buffers nil nil 'c-mode) ; all C Mode buffers or: (save-some-buffers nil nil "\\`/home/project/foo/") ; all Foo project files or: (save-some-buffers nil nil (lambda () (and (eq major-mode 'c-mode) (string-match "\\`/home/project/foo/" buffer-file-name)))) ; both Then the compile function could be smarter about what files it offers to save (see below). But save-some-buffers only allows the caller to distinguish which buffers are saved via the EXITING argument; I'm proposing adding an optional MODE, REGEXP, or PREDICATE argument. -------- Original Message -------- Subject: Re: Compilation: save file xxx Date: 19 Mar 2003 14:58:48 +0200 From: Ittay Dror Organization: Qlusters Inc. To: help-gnu-emacs@gnu.org Newsgroups: gnu.emacs.help References: <4yr893tu5d.fsf@skjellgran.ii.uib.no> 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 -- Kevin Rodgers