From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: diffs between a buffer and the underlying file Date: Tue, 5 Sep 2006 18:39:24 -0700 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1157506797 8546 80.91.229.2 (6 Sep 2006 01:39:57 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 6 Sep 2006 01:39:57 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Sep 06 03:39:55 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GKmOD-0006L4-4k for geh-help-gnu-emacs@m.gmane.org; Wed, 06 Sep 2006 03:39:41 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GKmOC-0002vX-Et for geh-help-gnu-emacs@m.gmane.org; Tue, 05 Sep 2006 21:39:40 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GKmO2-0002vS-To for help-gnu-emacs@gnu.org; Tue, 05 Sep 2006 21:39:30 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GKmO1-0002uy-8q for help-gnu-emacs@gnu.org; Tue, 05 Sep 2006 21:39:30 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GKmO1-0002ul-2w for help-gnu-emacs@gnu.org; Tue, 05 Sep 2006 21:39:29 -0400 Original-Received: from [148.87.113.118] (helo=rgminet01.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.52) id 1GKmO3-0001aM-9v for help-gnu-emacs@gnu.org; Tue, 05 Sep 2006 21:39:31 -0400 Original-Received: from rgmsgw02.us.oracle.com (rgmsgw02.us.oracle.com [138.1.186.52]) by rgminet01.oracle.com (Switch-3.1.6/Switch-3.1.6) with ESMTP id k861dQ8M032743 for ; Tue, 5 Sep 2006 19:39:26 -0600 Original-Received: from dradamslap (dhcp-amer-whq-csvpn-gw3-141-144-81-61.vpn.oracle.com [141.144.81.61]) by rgmsgw02.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with SMTP id k861dPOP007474 for ; Tue, 5 Sep 2006 19:39:26 -0600 Original-To: X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE 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: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:37174 Archived-At: I sometimes get into the following situation: I open a file, make some changes, then I want to see the changes before saving the file. The best way to do this seems to be to set the region to the whole buffer, write the region to some temporary file, and run diff on the two files. But I find this very unconvenient. I'd like to have a function in emacs which can be applied to a buffer, say buffer A, that opens a new buffer displaying all the changes between the buffer A and the disk file, opened in buffer A. Searching the emacs documentation I haven't found anything like this. Only functions for diff'ing two buffers or two files. You can always use ediff to compare any two buffers. So, with nothing extra, you can 1) rename buffer A as foo, 2) re-read file A into buffer A, and 3) compare buffers foo and A. The commands for this are 1) M-x rename-buffer, 2) M-x revert-buffer, and 3) M-x ediff-buffers. Ediff is your friend, generally.