From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: [R.Ekker@ai.rug.nl: highlight-changes-rotate-faces sets buffer modified flag] Date: Wed, 16 May 2007 07:59:17 +0200 Message-ID: <464A9DB5.5010001@gmx.at> References: <46416DBF.4020506@gmx.at> <46424454.10906@gmx.at> <46443356.7070103@gmx.at> <464825E3.6040609@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000807090202040005090903" X-Trace: sea.gmane.org 1179296681 25932 80.91.229.12 (16 May 2007 06:24:41 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 16 May 2007 06:24:41 +0000 (UTC) Cc: emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 16 08:24:40 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HoCwB-00089R-CN for ged-emacs-devel@m.gmane.org; Wed, 16 May 2007 08:24:40 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HoD47-0003CO-7c for ged-emacs-devel@m.gmane.org; Wed, 16 May 2007 02:32:51 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HoD43-0003CJ-OQ for emacs-devel@gnu.org; Wed, 16 May 2007 02:32:47 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HoD41-0003By-60 for emacs-devel@gnu.org; Wed, 16 May 2007 02:32:46 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HoD41-0003Br-0t for emacs-devel@gnu.org; Wed, 16 May 2007 02:32:45 -0400 Original-Received: from mail.gmx.net ([213.165.64.20]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1HoCw1-0007n3-5m for emacs-devel@gnu.org; Wed, 16 May 2007 02:24:30 -0400 Original-Received: (qmail invoked by alias); 16 May 2007 06:24:22 -0000 Original-Received: from N831P007.adsl.highway.telekom.at (EHLO [62.47.47.199]) [62.47.47.199] by mail.gmx.net (mp025) with SMTP; 16 May 2007 08:24:22 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX18pNj967fgpCqZ10EySWviy4HedLnpeuXrFb1QJxo QbdJ2HerQJGy4v User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en In-Reply-To: X-Y-GMX-Trusted: 0 X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) 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:71142 Archived-At: This is a multi-part message in MIME format. --------------000807090202040005090903 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit > First let's see what is best in this specific case. > Afterward we could see if any part of it is worth generalizing. The attached patch should handle the specific case. --------------000807090202040005090903 Content-Type: text/plain; name="hilit-chg.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="hilit-chg.patch" *** hilit-chg.el Tue May 15 20:20:12 2007 --- hilit-chg.el Tue May 15 20:22:12 2007 *************** *** 790,806 **** (interactive) ;; If not in active mode do nothing but don't complain because this ;; may be bound to a hook. ! (if (eq highlight-changes-mode 'active) ! (let ((after-change-functions nil)) ! ;; ensure hilit-chg-list is made and up to date ! (hilit-chg-make-list) ! ;; remove our existing overlays ! (hilit-chg-hide-changes) ! ;; for each change text property, increment it ! (hilit-chg-map-changes 'hilit-chg-bump-change) ! ;; and display them all if active ! (if (eq highlight-changes-mode 'active) ! (hilit-chg-display-changes)))) ;; This always returns nil so it is safe to use in write-file-functions nil) --- 790,826 ---- (interactive) ;; If not in active mode do nothing but don't complain because this ;; may be bound to a hook. ! (when (eq highlight-changes-mode 'active) ! (let ((modified (buffer-modified-p)) ! (inhibit-modification-hooks t)) ! ;; The `modified' related code tries to combine two goals: (1) Record the ! ;; rotation in `buffer-undo-list' and (2) avoid setting the modified flag ! ;; of the current buffer due to the rotation. We do this by inserting (in ! ;; `buffer-undo-list') entries restoring buffer-modified-p to nil before ! ;; and after the entry for the rotation. ! (unless modified ! ;; Install the "before" entry. ! (setq buffer-undo-list ! (cons '(apply restore-buffer-modified-p nil) ! buffer-undo-list))) ! (unwind-protect ! (progn ! ;; ensure hilit-chg-list is made and up to date ! (hilit-chg-make-list) ! ;; remove our existing overlays ! (hilit-chg-hide-changes) ! ;; for each change text property, increment it ! (hilit-chg-map-changes 'hilit-chg-bump-change) ! ;; and display them all if active ! (if (eq highlight-changes-mode 'active) ! (hilit-chg-display-changes))) ! (unless modified ! ;; Install the "after" entry. ! (setq buffer-undo-list ! (cons '(apply restore-buffer-modified-p nil) ! buffer-undo-list)) ! ! (restore-buffer-modified-p nil))))) ;; This always returns nil so it is safe to use in write-file-functions nil) --------------000807090202040005090903 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --------------000807090202040005090903--