From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: Offering the differences on exit Date: 02 Jul 2002 22:47:09 +0200 Sender: emacs-devel-admin@gnu.org Message-ID: <5x1yalg8mq.fsf@kfs2.cua.dk> References: <87k7oedk2b.fsf@lexx.delysid.org> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1025641082 16195 127.0.0.1 (2 Jul 2002 20:18:02 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 2 Jul 2002 20:18:02 +0000 (UTC) Cc: emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17PU65-0004D6-00 for ; Tue, 02 Jul 2002 22:18:01 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17PUBG-0003kt-00 for ; Tue, 02 Jul 2002 22:23:22 +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 17PU67-00022o-00; Tue, 02 Jul 2002 16:18:03 -0400 Original-Received: from mail.filanet.dk ([195.215.206.179]) by fencepost.gnu.org with smtp (Exim 3.34 #1 (Debian)) id 17PU58-0001zt-00 for ; Tue, 02 Jul 2002 16:17:02 -0400 Original-Received: from kfs2.cua.dk.cua.dk (unknown [10.1.82.3]) by mail.filanet.dk (Postfix) with SMTP id EA2867C016; Tue, 2 Jul 2002 19:46:31 +0000 (GMT) Original-To: Mario Lang In-Reply-To: <87k7oedk2b.fsf@lexx.delysid.org> Original-Lines: 33 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 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:5356 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:5356 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). The following function may be useful here (it doesn't use a temp file, but maybe that's not portable diff behaviour): (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 " -")))) (message "No file is associated with buffer")))) -- Kim F. Storm http://www.cua.dk