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

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

Re: sometimes I want to compile and not save files nor be asked


From: Kevin Rodgers
Subject: Re: sometimes I want to compile and not save files nor be asked
Date: Wed, 28 Jul 2004 11:23:38 -0600
User-agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2

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





reply via email to

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