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: Fri, 24 Jun 2016 22:13:25 +0900 (JST) Message-ID: References: <83y45x45l1.fsf@gnu.org> <8b3c0970-72af-3f33-627a-e520c7708f51@gmail.com> <83mvmc2aji.fsf@gnu.org> <837fdf2hgg.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Trace: ger.gmane.org 1466774068 27769 80.91.229.3 (24 Jun 2016 13:14:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 24 Jun 2016 13:14:28 +0000 (UTC) Cc: Tino Calancha , 23823@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jun 24 15:14:17 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 1bGQw4-000337-P5 for geb-bug-gnu-emacs@m.gmane.org; Fri, 24 Jun 2016 15:14:17 +0200 Original-Received: from localhost ([::1]:43481 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGQw4-0000NN-2m for geb-bug-gnu-emacs@m.gmane.org; Fri, 24 Jun 2016 09:14:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46124) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGQvv-0000LS-HV for bug-gnu-emacs@gnu.org; Fri, 24 Jun 2016 09:14:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bGQvq-00048H-G6 for bug-gnu-emacs@gnu.org; Fri, 24 Jun 2016 09:14:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41175) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGQvq-00048D-CJ for bug-gnu-emacs@gnu.org; Fri, 24 Jun 2016 09:14:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bGQvq-0002RQ-8z for bug-gnu-emacs@gnu.org; Fri, 24 Jun 2016 09:14:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 24 Jun 2016 13:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23823 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 23823-submit@debbugs.gnu.org id=B23823.14667740169341 (code B ref 23823); Fri, 24 Jun 2016 13:14:02 +0000 Original-Received: (at 23823) by debbugs.gnu.org; 24 Jun 2016 13:13:36 +0000 Original-Received: from localhost ([127.0.0.1]:53512 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bGQvP-0002Qb-NB for submit@debbugs.gnu.org; Fri, 24 Jun 2016 09:13:35 -0400 Original-Received: from mail-pa0-f52.google.com ([209.85.220.52]:34027) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bGQvN-0002QO-P8 for 23823@debbugs.gnu.org; Fri, 24 Jun 2016 09:13:34 -0400 Original-Received: by mail-pa0-f52.google.com with SMTP id bz2so37636648pad.1 for <23823@debbugs.gnu.org>; Fri, 24 Jun 2016 06:13:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=CT0r6mFW6g7XJ7zaoRL6oQeTqorRc49bMzSt4xSnoE0=; b=zwyL+aBU1LHam68Bp/kIqTryz8mvrpZ8b7nFZx6J5mr7oWWt7/o21Rbw3XnCG+EE2n gtSDTk5M+D2F06g96VP+awN6gPJNXCj1jUf3D3ET2BvCo7AKBFgSCOwNTBi1LcHBJdST rog9ZIXCCxqdZl+TWMBmrRWqH4jANeD337SH1/hH3xHzzxbcwu/jsATnE8ZIV7PGBx8w TD5ClS4B3ka5DIsYjBEB8IQlQ85xTPGYwSGxZKZ65q2Ssv7QYIt+/BUu6WWNyXV+sjXl 3wCg0Vox17131PisbcBepGrshlFfgOwj6fMKW6AWBXqEO/GrMxiDljN2CGOP/65DjJKG dzmQ== 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:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=CT0r6mFW6g7XJ7zaoRL6oQeTqorRc49bMzSt4xSnoE0=; b=mIFa/2vGMvxaNi71ojxxWwIyJ749Sbb1Z/Q6bnbeqBWYy5MQ2MGdJGvPBcJLCow/H2 tqqnnCVRlQZSDGqc8N5qH9UzaWekT9kQEbvb8eVI5KuF4RUGBk9YTF4IeCuzFRCGtDmM 5MoHMww6+nFm+6CM/tDZP1oimeZ4OGP1LHlrZ7yB3AY/aly/EfUz/FqJDOfHpA5zvSrV OI+bm76b/B7krr+scvis7JjtTiBiyRJYfUy9yIfsHdPTTp/T8xK2++gVL5d2wIbPPsLT iXJM4kVjAdMkXd3kNXlC2zWyuszPi/BZPxod8onWoCqP6M8whsuwZe816ETFtnCQYvcD OZGA== X-Gm-Message-State: ALyK8tKjSY+G8zdhML0qSmscrvcbKO4Vr0zbnpA1McT/ORfyWWcKmSQGYv4I5BZfZPXaMg== X-Received: by 10.66.85.197 with SMTP id j5mr7500713paz.87.1466774007828; Fri, 24 Jun 2016 06:13:27 -0700 (PDT) Original-Received: from calancha-pc (softbank126103139048.bbtec.net. [126.103.139.48]) by smtp.gmail.com with ESMTPSA id 75sm8113549pfy.32.2016.06.24.06.13.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Jun 2016 06:13:27 -0700 (PDT) X-Google-Original-From: Tino Calancha X-X-Sender: calancha@calancha-pc In-Reply-To: <837fdf2hgg.fsf@gnu.org> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) 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:119998 Archived-At: On Fri, 24 Jun 2016, Eli Zaretskii wrote: > But the function's doc string clearly makes that expected behavior: > > If the current buffer is visiting the file being compared against, it > also will have its differences highlighted. > > The only way I can interpret that "also" part is that the changes > against the file are highlighted _in_addition_ to the changes tracked > by the mode. Your scenario just happens to produce a clash between > these two sets of differences, and the result could be ambiguous. But > what we get in fact doesn't seem unreasonable to me. You convinced me: there is no need to reset those highlighted differences. If the user want to do that he/she could toggle eaasily the mode before calling the func. Adding a prefix argument to reset may cause accidentaly lost all the tracked differences. The comentary of this lib helps to understand the design intentions. For example when it says: ;; You can "age" different sets of changes by using ;; `highlight-changes-rotate-faces'. Each time the buffer is saved, the new differences get a different face. Following example shows the point: emacs -Q -eval "(progn (with-temp-file \"/tmp/foo\" (insert \"Hi i am foo\n\")) (find-file \"/tmp/foo\") (highlight-changes-mode 1) (add-hook 'write-file-functions 'highlight-changes-rotate-faces nil t))" M-: (progn (goto-char (point-max)) (insert "Hi foo, i am bar.\n") (highlight-compare-with-file "/tmp/foo")) RET y y M-: (progn (goto-char (point-max)) (insert "Nice to meet you foo.\n") (highlight-compare-with-file "/tmp/foo")) RET y y M-: (progn (goto-char (point-max)) (insert "Nice to meet you too, bar.\n") (highlight-compare-with-file "/tmp/foo")) RET y y ;; If we reset the buffer on each func call we will loose all this ;; psicodelic color structure :-S