From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: rsharman@pobox.com Newsgroups: gmane.emacs.devel Subject: Re: highlight-changes-mode Date: Sat, 9 Dec 2006 14:40:33 -0500 Message-ID: <17787.4401.435315.516412@cube.homenetwork> References: <17721.60660.980363.609046@kahikatea.snap.net.nz> <17725.23383.490888.442550@cube.homenetwork> <17770.17915.319182.723314@cube.homenetwork> <17770.35080.725821.391914@kahikatea.snap.net.nz> <17782.25188.121126.54191@cube.homenetwork> <17783.21694.919909.627629@cube.homenetwork> NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1165693416 5655 80.91.229.10 (9 Dec 2006 19:43:36 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 9 Dec 2006 19:43:36 +0000 (UTC) Cc: nickrob@snap.net.nz, emacs-devel@gnu.org, rsharman@pobox.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 09 20:43:33 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by dough.gmane.org with esmtp (Exim 4.50) id 1Gt86d-0002wH-V7 for ged-emacs-devel@m.gmane.org; Sat, 09 Dec 2006 20:43:32 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gt86c-00019U-RI for ged-emacs-devel@m.gmane.org; Sat, 09 Dec 2006 14:43:30 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Gt86L-00018R-Ic for emacs-devel@gnu.org; Sat, 09 Dec 2006 14:43:13 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Gt86K-00017m-2Q for emacs-devel@gnu.org; Sat, 09 Dec 2006 14:43:13 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gt86J-00017i-Rq for emacs-devel@gnu.org; Sat, 09 Dec 2006 14:43:11 -0500 Original-Received: from [209.217.78.176] (helo=mx4-1.spamtrap.magma.ca) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1Gt86I-0006Pl-Uy; Sat, 09 Dec 2006 14:43:11 -0500 Original-Received: from mail2.magma.ca (mail2.internal.magma.ca [10.0.10.12]) by mx4-1.spamtrap.magma.ca (8.13.1/8.13.1) with ESMTP id kB9Jh3ZE016492; Sat, 9 Dec 2006 14:43:03 -0500 Original-Received: from cube.homenetwork (ottawa-hs-209-217-110-164.d-ip.magma.ca [209.217.110.164]) by mail2.magma.ca (Magma's Mail Server) with ESMTP id kB9Jh1n9027959; Sat, 9 Dec 2006 14:43:02 -0500 Original-Received: by cube.homenetwork (Postfix, from userid 1000) id A35AB93C8A; Sat, 9 Dec 2006 14:40:33 -0500 (EST) Original-To: rms@gnu.org In-Reply-To: X-Mailer: VM 7.19 under Emacs 21.4.1 X-magma-MailScanner-Information: Magma Mailscanner Service X-magma-MailScanner: Clean X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:63526 Archived-At: Richard Stallman writes: > The current implementation allows the situation where a user no longer > wants it turned on by default, but has an existing buffer that has > some changes already highlighted. If disabling the global mode > automatically disables highlight changes modes in that buffer, then > the highlighting of the changes disappears; we have lost information. > > That is clearly true. The question is whether this is a useful feature > that we want, or whether it is better to make this mode like the others. Personally I think it is useful. I certainly have no problems with global-highlight-changes always turning on the mode in all buffers. It is only the unconditional turning off that I have qualms with. Can I suggest a compromise? The default behaviour is changed to always affect existing buffers in both enabling and disabling. All references to the variable highlight-changes-global-changes-existing-buffers are removed. A new variable highlight-changes-mode-turn-off-fn can be set to a function to be called to [optionally] turn off the mode in a buffer. If set to nil (the default) the mode is turned off unconditionally. This is implemented by a different change to define-global-minor-mode from what I'd suggested earlier. Instead of the :only-new keyword there is a :turn-off keyword. If specified this function is called instead of the mode being turned off directly. It is a more symmetric change than the previous one. (defvar highlight-changes-mode-turn-off-fn nil "*If non-nil, a function to maybe turn off highlight changes mode. It is called by global-highlight-changes when the mode is turned off. The default setting of nil causes highlight changes mode to be disabled in all buffers.") (defun highlight-changes-mode-turn-off () (if highlight-changes-mode-turn-off-fn (funcall highlight-changes-mode-turn-off-fn) (highlight-changes-mode -1))) So to summarize, the default behaviour is as you prefer, but we allow a user to override it