From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#23824: 25.0.95; Prevent compare one buffer with itself Date: Wed, 22 Jun 2016 18:19:15 +0300 Message-ID: <83wplh45fw.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1466608898 30593 80.91.229.3 (22 Jun 2016 15:21:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 22 Jun 2016 15:21:38 +0000 (UTC) Cc: 23824@debbugs.gnu.org To: Tino Calancha Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jun 22 17:21:27 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bFjxs-0005CJ-1A for geb-bug-gnu-emacs@m.gmane.org; Wed, 22 Jun 2016 17:21:16 +0200 Original-Received: from localhost ([::1]:59054 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFjxr-0007FR-9B for geb-bug-gnu-emacs@m.gmane.org; Wed, 22 Jun 2016 11:21:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39054) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFjxi-0007Dw-HO for bug-gnu-emacs@gnu.org; Wed, 22 Jun 2016 11:21:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFjxe-0002zU-EY for bug-gnu-emacs@gnu.org; Wed, 22 Jun 2016 11:21:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:38972) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFjxe-0002zL-BT for bug-gnu-emacs@gnu.org; Wed, 22 Jun 2016 11:21:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bFjxe-0005Nb-3P for bug-gnu-emacs@gnu.org; Wed, 22 Jun 2016 11:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 22 Jun 2016 15:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23824 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23824-submit@debbugs.gnu.org id=B23824.146660882320626 (code B ref 23824); Wed, 22 Jun 2016 15:21:02 +0000 Original-Received: (at 23824) by debbugs.gnu.org; 22 Jun 2016 15:20:23 +0000 Original-Received: from localhost ([127.0.0.1]:51309 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFjx1-0005Mc-IR for submit@debbugs.gnu.org; Wed, 22 Jun 2016 11:20:23 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:47720) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFjx0-0005MR-Is for 23824@debbugs.gnu.org; Wed, 22 Jun 2016 11:20:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFjwq-0002iz-KV for 23824@debbugs.gnu.org; Wed, 22 Jun 2016 11:20:17 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41718) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFjwq-0002iB-Hc; Wed, 22 Jun 2016 11:20:12 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1873 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bFjwj-0006K6-Mk; Wed, 22 Jun 2016 11:20:08 -0400 In-reply-to: (message from Tino Calancha on Wed, 22 Jun 2016 19:12:13 +0900 (JST)) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:119937 Archived-At: > From: Tino Calancha > Date: Wed, 22 Jun 2016 19:12:13 +0900 (JST) > > When the current buffer, buf-a, is visiting FILE-B, buf-b should > be a temporary buffer on sync with FILE-B. > > ./emacs -r -Q -eval '(progn (with-temp-file "/tmp/foo" (insert "foo")) > (find-file "/tmp/foo") (insert "bar"))' > M-: (highlight-compare-with-file "/tmp/foo") RET > n n ; Answer no to saving suggestions. > ;; Current buffer content different than /tmp/foo but no face > highlight-changes shown. I think we need first to establish what exactly is the semantic of this situation. You are comparing a buffer with the file that the buffer visits. The doc string of this function tries to say something about this situation: If the current buffer is visiting the file being compared against, it also will have its differences highlighted. Otherwise, the file is read in temporarily but the buffer is deleted. but I must confess that this is incomprehensible for me. So I think we should first establish what that means, or what the code is trying to do. > + (with-current-buffer buf-new > + (insert-file-contents-literally file-b) ??? Why insert-file-contents-literally? That definitely sounds wrong. Thanks.