From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Mario Lang Newsgroups: gmane.emacs.devel Subject: Re: Offering the differences on exit Date: Tue, 02 Jul 2002 22:25:47 +0200 Sender: emacs-devel-admin@gnu.org Message-ID: <8765zxev1w.fsf@lexx.delysid.org> References: <87k7oedk2b.fsf@lexx.delysid.org> <5x1yalg8mq.fsf@kfs2.cua.dk> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1025641617 17445 127.0.0.1 (2 Jul 2002 20:26:57 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 2 Jul 2002 20:26:57 +0000 (UTC) Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17PUEj-0004XG-00 for ; Tue, 02 Jul 2002 22:26:57 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17PUJu-0003zl-00 for ; Tue, 02 Jul 2002 22:32:18 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 17PUEu-0003B8-00; Tue, 02 Jul 2002 16:27:08 -0400 Original-Received: from 212186194087.graz.teleweb.at ([212.186.194.87] helo=lexx.delysid.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 17PUCt-00030i-00 for ; Tue, 02 Jul 2002 16:25:03 -0400 Original-Received: from mlang by lexx.delysid.org with local (Exim 3.35 #1 (Debian)) id 17PUDb-00038b-00 for ; Tue, 02 Jul 2002 22:25:47 +0200 Original-To: emacs-devel@gnu.org In-Reply-To: <5x1yalg8mq.fsf@kfs2.cua.dk> (storm@cua.dk's message of "02 Jul 2002 22:47:09 +0200") Original-Lines: 47 User-Agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.2 (i386-debian-linux-gnu) Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:5361 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:5361 storm@cua.dk (Kim F. Storm) writes: > Mario Lang writes: > >> One feature I miss since I tried out Emacs the first time >> is the ability to see a diff when you are asked if you want to >> save changed you've made. > > I agree this would be extremely useful. > > However, I would prefer if this was built-in as a default option in > save-some-buffers. > > In that case, I don't see a great need for the more general approach > you have taken with the save-some-buffers-action-alist (although it > might have other uses). I figure people might want to use ediff instead of external diff. Also, when diff is available, I would like to remove C-r, as I never used it really before. > The following function may be useful here (it doesn't > use a temp file, but maybe that's not portable diff > behaviour): shell-command-on-region uses make-tempfile AFAICS. > (defun diff-buffer-to-visited-file (&optional buffer) > (interactive "bBuffer: ") > (setq buffer (get-buffer (or buffer (current-buffer)))) > (let ((file (buffer-file-name buffer))) > (if file > (with-current-buffer buffer > (save-restriction > (widen) > (shell-command-on-region (point-min) (point-max) > (concat "diff -c " file " -")))) If it went as a built-in into emacs I'd prefer to be able to configure the diff options. Either use vc-cvs-diff-switches, or ediff-custom-diff-options or some other variable. > (message "No file is associated with buffer")))) -- CYa, Mario