help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Compilation: save file xxx


From: Ittay Dror
Subject: Re: Compilation: save file xxx
Date: 19 Mar 2003 14:58:48 +0200

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





reply via email to

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