unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* sometimes I want to compile and not save files nor be asked
@ 2004-07-14 17:50 Dan Jacobson
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Jacobson @ 2004-07-14 17:50 UTC (permalink / raw)


Compile's docstring should mention compilation-ask-about-save.

Documentation:
*Non-nil means C-x c asks which buffers to save before compiling.
Otherwise, it saves all modified buffers without asking.

Well gosh, how about what if we just plain don't want to be asked
about saving, and don't want gratuitous saving?

I suppose that 3rd possibility will not fit into the nil/non-nil
paradigm mapped out above, that leaves no room for adding more
possibilities later.

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

* Re: sometimes I want to compile and not save files nor be asked
       [not found] <mailman.334.1090173850.1960.bug-gnu-emacs@gnu.org>
@ 2004-07-28 17:23 ` Kevin Rodgers
  2004-07-29 11:20   ` Richard Stallman
       [not found] ` <87acxj3ay6.fsf@jay.tmax.co.kr>
  1 sibling, 1 reply; 4+ messages in thread
From: Kevin Rodgers @ 2004-07-28 17:23 UTC (permalink / raw)


Dan Jacobson wrote:
 > Compile's docstring should mention compilation-ask-about-save.

I'm not sure about that: there are 7 compilation- user options, of which
only compilation-read-command is mentioned in compile's doc string.

 > Documentation:
 > *Non-nil means C-x c asks which buffers to save before compiling.
 > Otherwise, it saves all modified buffers without asking.
 >
 > Well gosh, how about what if we just plain don't want to be asked
 > about saving, and don't want gratuitous saving?
 >
 > I suppose that 3rd possibility will not fit into the nil/non-nil
 > paradigm mapped out above, that leaves no room for adding more
 > possibilities later.

Good idea:

*** emacs-21.3/lisp/progmodes/compile.el~	Fri Jan 17 06:45:11 2003
--- emacs-21.3/lisp/progmodes/compile.el	Wed Jul 28 11:15:00 2004
***************
*** 449,458 ****
     :group 'compilation)

   ;;;###autoload
! (defcustom compilation-ask-about-save t
!   "*Non-nil means \\[compile] asks which buffers to save before compiling.
! Otherwise, it saves all modified buffers without asking."
!   :type 'boolean
     :group 'compilation)

   ;; Note: the character class after the optional drive letter does not
--- 449,461 ----
     :group 'compilation)

   ;;;###autoload
! (defcustom compilation-save-buffers 'ask
!   "*Non-nil means \\[compile] saves modified buffers before compiling.
! If t, it does so without asking; for other values, it queries the user
! about each file."
!   :type '(choice (const :tag "Save" t)
! 		 (other :tag "Ask" ask)
! 		 (const :tag "Don't save" nil)))
     :group 'compilation)

   ;; Note: the character class after the optional drive letter does not
***************
*** 588,594 ****
        (list (eval compile-command))))
     (unless (equal command (eval compile-command))
       (setq compile-command command))
!   (save-some-buffers (not compilation-ask-about-save) nil)
     (compile-internal command "No more errors"))

   ;; run compile with the default command line
--- 591,598 ----
        (list (eval compile-command))))
     (unless (equal command (eval compile-command))
       (setq compile-command command))
!   (cond ((eq compilation-save-buffers t) (save-some-buffers t))
!         (compilation-save-buffers (save-some-buffers nil)))
     (compile-internal command "No more errors"))

   ;; run compile with the default command line
***************
*** 595,601 ****
   (defun recompile ()
     "Re-compile the program including the current buffer."
     (interactive)
!   (save-some-buffers (not compilation-ask-about-save) nil)
     (compile-internal (eval compile-command) "No more errors"))

   (defun grep-process-setup ()
--- 599,606 ----
   (defun recompile ()
     "Re-compile the program including the current buffer."
     (interactive)
!   (cond ((eq compilation-save-buffers t) (save-some-buffers t))
!         (compilation-save-buffers (save-some-buffers nil)))
     (compile-internal (eval compile-command) "No more errors"))

   (defun grep-process-setup ()

-- 
Kevin Rodgers

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

* Re: sometimes I want to compile and not save files nor be asked
  2004-07-28 17:23 ` Kevin Rodgers
@ 2004-07-29 11:20   ` Richard Stallman
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Stallman @ 2004-07-29 11:20 UTC (permalink / raw)
  Cc: gnu-emacs-bug

We could use your changes if you could get the necessary legal papers
to cover them.  However, we don't have them, and the result is that we
cannot implement changes the way you have written them.  It actually
makes our work harder when you post changes, because then we would
have to make sure not to implement the change the way you wrote it.

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

* Re: sometimes I want to compile and not save files nor be asked
       [not found] ` <87acxj3ay6.fsf@jay.tmax.co.kr>
@ 2004-07-29 21:07   ` Dan Jacobson
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Jacobson @ 2004-07-29 21:07 UTC (permalink / raw)


>>>>> "j" == jay  <jay@_HOSTNAME_> emails me:

j> * Dan Jacobson <jidanni@jidanni.org> at 2004-07-15 01:50+0800
j> | Well gosh, how about what if we just plain don't want to be asked
j> | about saving, and don't want gratuitous saving?

j>  Well, I guess this is more about feature request rather than bug report.
j>  Anyway, I'm using the following simple advice to do the job:

Well OK, but my postings here are mainly for "permanent changes to
emacs for the benefit of future generations", not for advice stuff for
little old me's ~/.emacs.

j>    (setq compilation-read-command      t
j>          compilation-ask-about-save    nil)
j>    (defmacro do-without-save-buffers (command)
j>      `(defadvice ,command (around dont-ask-dont-save-buffers activate)
j>         (flet ((save-some-buffers (&rest args) nil))
j>           ad-do-it)))
j>    (do-without-save-buffers compile)
j>    (do-without-save-buffers recompile)

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

end of thread, other threads:[~2004-07-29 21:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-14 17:50 sometimes I want to compile and not save files nor be asked Dan Jacobson
     [not found] <mailman.334.1090173850.1960.bug-gnu-emacs@gnu.org>
2004-07-28 17:23 ` Kevin Rodgers
2004-07-29 11:20   ` Richard Stallman
     [not found] ` <87acxj3ay6.fsf@jay.tmax.co.kr>
2004-07-29 21:07   ` Dan Jacobson

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).