From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.bugs Subject: bug#23823: 25.0.95; Reset between highlight buffer/file comparisons Date: Wed, 22 Jun 2016 19:11:27 +0900 (JST) Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Trace: ger.gmane.org 1466590566 18902 80.91.229.3 (22 Jun 2016 10:16:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 22 Jun 2016 10:16:06 +0000 (UTC) To: 23823@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jun 22 12:15:55 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 1bFfCJ-0001Ew-LP for geb-bug-gnu-emacs@m.gmane.org; Wed, 22 Jun 2016 12:15:51 +0200 Original-Received: from localhost ([::1]:56969 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFfCI-0000M9-LB for geb-bug-gnu-emacs@m.gmane.org; Wed, 22 Jun 2016 06:15:50 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45810) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFf8g-0005SE-B6 for bug-gnu-emacs@gnu.org; Wed, 22 Jun 2016 06:12:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFf8c-0002qc-3T for bug-gnu-emacs@gnu.org; Wed, 22 Jun 2016 06:12:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:38015) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFf8c-0002qX-0d for bug-gnu-emacs@gnu.org; Wed, 22 Jun 2016 06:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bFf8b-0001Wb-QF for bug-gnu-emacs@gnu.org; Wed, 22 Jun 2016 06:12:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 22 Jun 2016 10:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 23823 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14665903065838 (code B ref -1); Wed, 22 Jun 2016 10:12:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 22 Jun 2016 10:11:46 +0000 Original-Received: from localhost ([127.0.0.1]:50352 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFf8M-0001W6-B9 for submit@debbugs.gnu.org; Wed, 22 Jun 2016 06:11:46 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:54735) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFf8K-0001Vt-HO for submit@debbugs.gnu.org; Wed, 22 Jun 2016 06:11:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFf8E-0002jc-EZ for submit@debbugs.gnu.org; Wed, 22 Jun 2016 06:11:39 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:45082) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFf8E-0002ic-Bs for submit@debbugs.gnu.org; Wed, 22 Jun 2016 06:11:38 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45689) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFf8C-00054F-35 for bug-gnu-emacs@gnu.org; Wed, 22 Jun 2016 06:11:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFf86-0002hb-UR for bug-gnu-emacs@gnu.org; Wed, 22 Jun 2016 06:11:34 -0400 Original-Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]:35540) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFf86-0002hR-NB for bug-gnu-emacs@gnu.org; Wed, 22 Jun 2016 06:11:30 -0400 Original-Received: by mail-pf0-x242.google.com with SMTP id t190so3753269pfb.2 for ; Wed, 22 Jun 2016 03:11:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:subject:message-id:user-agent:mime-version; bh=OSmsDP+mXPmuIWGqUEkbinuWW7k/LBZjC5h8jj8gqpM=; b=ru28r9svGNNXC0ofpa4Cd+CqoClZdUd1zJWGEF23yktK67n20BrpuAkWj14uwc6z3J zdHtwCvQA9tWp+khIV6EGa2GkHXUU5bd5dCsDDZm5gpswWeKJ2yKTdYQ80Vc4B51lyOS Vw/k2MxWMnP3WLec5ifiTyP702z2CBzHaz8aNZkqlPG3YfJBKMQlATSu/JjJLWzl92su AWk7cxpAoQb7DXR78I2lVC8OrltLQVPuwwPx37fIVq7wW/Cg27hcyknTUjtPdA/YuWy5 I/Wh23VCTadi2MPlLpJ7A85tVQfRBgML1uf2IjByP6EgAQLa7J8PfECSWxO0eKuiU/Fl HF+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:subject:message-id:user-agent :mime-version; bh=OSmsDP+mXPmuIWGqUEkbinuWW7k/LBZjC5h8jj8gqpM=; b=DWFP2zVJsFoZl6gbfG+WSak5ow72h9oqk0qr7pgmZ3D2EvsUy8YxkIAssypuHLlH3Q 68pfGV5azIOZ0oWOF+aVtCIRMKSb8AZ9EosM3QV3CBAI5QnEGtstBBeAlent63VgnX5n MUvcJayaZZTCPHYEDkIAcHkd1WiV1Sifpi0ZZ4EoJWnuKmcdSLV5s0tFXqPttP8bCkXc MLnPM2QaTi2WgM/gl7vvjpwv6lo7s1NNfViWl2lGpSfJp9JuJ2s2XYUU/fwWplau8jIp ZHtNIOzyhdOlh8fW0OdRo4oZXKYCbOhAw7EssPiRFYhBPKAnrjnR+OTvEGbyPnMitbYD EhvA== X-Gm-Message-State: ALyK8tJE/cpxddrTMAyupeLA57/jqSe9KGppYSmsVpzPKMOXFCup3YRjnpPsA5ZjLAg6Mw== X-Received: by 10.98.3.3 with SMTP id 3mr21411197pfd.8.1466590289709; Wed, 22 Jun 2016 03:11:29 -0700 (PDT) Original-Received: from calancha-pc (softbank126103144234.bbtec.net. [126.103.144.234]) by smtp.gmail.com with ESMTPSA id i124sm41341403pfg.77.2016.06.22.03.11.28 for (version=TLSv1/SSLv3 cipher=OTHER); Wed, 22 Jun 2016 03:11:29 -0700 (PDT) X-Google-Original-From: Tino Calancha X-X-Sender: calancha@calancha-pc User-Agent: Alpine 2.20 (DEB 67 2015-01-07) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:119923 Archived-At: ./emacs -r -Q -eval '(progn (with-temp-file "/tmp/foo" (insert "foo")) (switch-to-buffer "bar") (insert "boo"))' M-: (highlight-compare-with-file "/tmp/foo") RET C-b C-b DEL f M-: M-p RET ;; Now current buffer content equals /tmp/foo content ;; but foo is still displayed with face highlight-changes. In GNU Emacs 25.0.95.2 (x86_64-pc-linux-gnu, GTK+ Version 3.20.6) Repository revision: 829733104db073f8abd67765eae162e7360281fa ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Following patch fixed it calling (and highlight-changes-mode (hilit-chg-clear)) each time (highlight-changes-mode 1) is called. It would be better if such reset were performed inside one hook. Any idea to do this better? >From 18251da925f8f8c6cca50b2a4f56235534c0a479 Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Wed, 22 Jun 2016 18:29:13 +0900 Subject: [PATCH] Reset between highlight comparisons * lisp/hilit-chg.el (highlight-markup-buffers) (highlight-changes-mode-turn-on): Call hilit-chg-clear before performing a new comparison (Bug#23823). --- lisp/hilit-chg.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lisp/hilit-chg.el b/lisp/hilit-chg.el index 8f042b6..f6eae52 100644 --- a/lisp/hilit-chg.el +++ b/lisp/hilit-chg.el @@ -804,8 +804,12 @@ highlight-markup-buffers (or file-b (setq temp-b (setq file-b (ediff-make-temp-file buf-b nil)))) (set-buffer buf-a) + (when highlight-changes-mode + (hilit-chg-clear)) (highlight-changes-mode 1) (or markup-a-only (with-current-buffer buf-b + (when highlight-changes-mode + (hilit-chg-clear)) (highlight-changes-mode 1))) (setq change-info (hilit-chg-get-diff-info buf-a file-a buf-b file-b)) @@ -993,6 +997,8 @@ highlight-changes-mode-turn-on (and (not (string-match "^[ *]" (buffer-name))) (buffer-file-name)))) + (when highlight-changes-mode + (hilit-chg-clear)) (highlight-changes-mode 1)) )) -- 2.8.1