unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: rms@gnu.org, emacs-devel@gnu.org
Subject: Re: [R.Ekker@ai.rug.nl: highlight-changes-rotate-faces sets buffer modified flag]
Date: Wed, 09 May 2007 20:05:44 +0200	[thread overview]
Message-ID: <46420D78.6000100@gmx.at> (raw)
In-Reply-To: <jwvk5vijcpd.fsf-monnier+emacs@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 493 bytes --]

 >>!       (let ((after-change-functions nil))
 >
 >
 > That's bad for karma.  Use "(let ((inhibit-modification-hooks t))"
 > instead, thank you,

Indeed.  Meanwhile I think that we should avoid altering the modified
state but retain undo information for face rotations.  This may show up
as a minor annoyance during undos but can't harm otherwise.  Eventually,
we should also add an `after-revert-hook' to remove hilit-chg's overlays
(unless `revert-buffer' gets re-implemented as TObeDOne).

[-- Attachment #2: hilit-chg.patch --]
[-- Type: text/plain, Size: 1788 bytes --]

*** hilit-chg.el	Tue Jan 23 06:40:02 2007
--- hilit-chg.el	Wed May  9 19:33:32 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,813 ----
    (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)
!     ;; Avoid marking the buffer as modified.  Note: We do not suppress modifying
!     ;; `buffer-undo-list' here.  Hence, undoing a face rotation may show up as a
!     ;; buffer modification.
!     (let ((modified (buffer-modified-p))
! 	  (inhibit-modification-hooks t))
!       (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 (set-buffer-modified-p nil)))))
    ;; This always returns nil so it is safe to use in write-file-functions
    nil)


[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

  reply	other threads:[~2007-05-09 18:05 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-08 18:09 [R.Ekker@ai.rug.nl: highlight-changes-rotate-faces sets buffer modified flag] Richard Stallman
2007-05-08 22:00 ` martin rudalics
2007-05-09 14:26   ` Stefan Monnier
2007-05-09 18:05     ` martin rudalics [this message]
2007-05-09 19:24       ` Stefan Monnier
2007-05-09 21:27         ` martin rudalics
2007-05-09 21:34   ` Richard Stallman
2007-05-09 21:58     ` martin rudalics
2007-05-09  6:44 ` martin rudalics
2007-05-09 21:34   ` Richard Stallman
2007-05-09 21:59     ` martin rudalics
2007-05-11  7:44       ` Richard Stallman
2007-05-11  9:11         ` martin rudalics
2007-05-13 17:37           ` Richard Stallman
2007-05-14  9:03             ` martin rudalics
2007-05-15  9:46               ` Richard Stallman
2007-05-16  5:59                 ` martin rudalics
2007-05-16 14:32                   ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46420D78.6000100@gmx.at \
    --to=rudalics@gmx.at \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).