unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Compilation: save file xxx
@ 2003-03-19 12:31 Joakim Hove
  2003-03-19 12:58 ` Ittay Dror
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Joakim Hove @ 2003-03-19 12:31 UTC (permalink / raw)



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

-- 
Joakim Hove  / hove@ii.uib.no  /  (55 5) 84076

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Compilation: save file xxx
  2003-03-19 12:31 Compilation: save file xxx Joakim Hove
@ 2003-03-19 12:58 ` Ittay Dror
  2003-03-19 13:15 ` Joakim Hove
       [not found] ` <mailman.3369.1048078820.21513.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 4+ messages in thread
From: Ittay Dror @ 2003-03-19 12:58 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Compilation: save file xxx
  2003-03-19 12:31 Compilation: save file xxx Joakim Hove
  2003-03-19 12:58 ` Ittay Dror
@ 2003-03-19 13:15 ` Joakim Hove
       [not found] ` <mailman.3369.1048078820.21513.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 4+ messages in thread
From: Joakim Hove @ 2003-03-19 13:15 UTC (permalink / raw)



Hello, 

I found the variable compilation-ask-about-save, setting this to nil I
at least avoid the question. But of course saving *all* buffers
unconditionally is not what I consider an optimal solution.

Joakim

-- 
Joakim Hove  / hove@ii.uib.no  /  (55 5) 84076

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Compilation: save file xxx
       [not found] ` <mailman.3369.1048078820.21513.help-gnu-emacs@gnu.org>
@ 2003-03-19 20:40   ` Joakim Hove
  0 siblings, 0 replies; 4+ messages in thread
From: Joakim Hove @ 2003-03-19 20:40 UTC (permalink / raw)



Ittay Dror <ittay@qlusters.com> writes:


> 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'

Thanks - I have a implemented a solution according to your suggestion.

Joakim

-- 
Joakim Hove
Stabburveien 18
5231 Paradis
55 91 28 18

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-03-19 20:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-19 12:31 Compilation: save file xxx Joakim Hove
2003-03-19 12:58 ` Ittay Dror
2003-03-19 13:15 ` Joakim Hove
     [not found] ` <mailman.3369.1048078820.21513.help-gnu-emacs@gnu.org>
2003-03-19 20:40   ` Joakim Hove

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).