From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Daniel Pittman Newsgroups: gmane.emacs.help Subject: Re: advising jde-compile -- a better way? Date: Tue, 26 Oct 2004 11:04:00 +1000 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <871xfm9tof.fsf@enki.rimspace.net> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1098756129 15075 80.91.229.6 (26 Oct 2004 02:02:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 26 Oct 2004 02:02:09 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Oct 26 04:01:57 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CMGeq-00060q-00 for ; Tue, 26 Oct 2004 04:01:57 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CMGmW-00045d-DG for geh-help-gnu-emacs@m.gmane.org; Mon, 25 Oct 2004 22:09:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CMGmO-00045Y-Hu for help-gnu-emacs@gnu.org; Mon, 25 Oct 2004 22:09:44 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CMGmO-00045M-4C for help-gnu-emacs@gnu.org; Mon, 25 Oct 2004 22:09:44 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CMGmN-00045J-W4 for help-gnu-emacs@gnu.org; Mon, 25 Oct 2004 22:09:44 -0400 Original-Received: from [80.91.229.2] (helo=main.gmane.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CMGeX-0000g5-Uq for help-gnu-emacs@gnu.org; Mon, 25 Oct 2004 22:01:38 -0400 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1CMGeU-0001wK-00 for ; Tue, 26 Oct 2004 04:01:34 +0200 Original-Received: from 203-217-29-45.perm.iinet.net.au ([203.217.29.45]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 26 Oct 2004 04:01:34 +0200 Original-Received: from daniel by 203-217-29-45.perm.iinet.net.au with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 26 Oct 2004 04:01:34 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 29 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 203-217-29-45.perm.iinet.net.au User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:zAMNOqxMZLptTn16RpcK4SDfN4k= X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:21431 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:21431 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