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

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

Re: advising jde-compile -- a better way?


From: Daniel Pittman
Subject: Re: advising jde-compile -- a better way?
Date: Tue, 26 Oct 2004 11:04:00 +1000
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (gnu/linux)

On 26 Oct 2004, Joe Casadonte wrote:
> jde-compile prompts me to save buffers before compiling, a practice
> that I find personally annoying.  I've come up with the following, but
> it seems ugly:
>
> (defadvice jde-compile (around jde-compile-no-save-prompt act)
> "Supresses the save-buffer prompting." (fset 'save-some-buffers-old-fn-def
>       (symbol-function 'save-some-buffers)) (fset 'save-some-buffers
>       'ignore) ad-do-it (fset 'save-some-buffers (symbol-function
>       'save-some-buffers-old-fn-def)))

(require 'cl)
(defadvice jde-compile (around jde-compile-no-save-prompt act)
  "Supresses the save-buffer prompting." 
    (flet ((save-some-buffers (&rest)))
      ad-do-it))

> Is there a better or more elegant way to accomplish the same thing?

Untested, but Common Lisp flet is a way of doing what you wrote
automatically.  There may even be a non-CL mechanism, named something
else, in Emacs somewhere.

          Daniel

-- 
Yet, I am the necessary angel of earth,
Since, in my sight, you see the earth again...
        -- Wallace Stevens





reply via email to

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