[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: highlight-changes and french-prefix input method
From: |
Richard Stallman |
Subject: |
Re: highlight-changes and french-prefix input method |
Date: |
Thu, 31 Jan 2002 20:37:58 -0700 (MST) |
Does this replacement function fix it? By the way, it would be good
for someone who has time available to clean up the whole file.
(defun hilit-chg-fixup (beg end)
"Fix change overlays in region between BEG and END.
Ensure the overlays agree with the changes as determined from
the text properties of type `hilit-chg' ."
;; Remove or alter overlays in region beg..end
(let (ov-start ov-end props q)
;; temp for debugging:
;; (or (eq highlight-changes-mode 'active)
;; (error "hilit-chg-fixup called but Highlight Changes mode not active"))
(dolist (ov (overlays-in beg end))
;; Don't alter overlays that are not ours.
(when (overlay-get ov 'hilit-chg)
(let ((ov-start (overlay-start ov))
(ov-end (overlay-end ov)))
(if (< ov-start beg)
(progn
(move-overlay ov ov-start beg)
(if (> ov-end end)
(progn
(setq props (overlay-properties ov))
(setq ov (make-overlay end ov-end))
(while props
(overlay-put ov (car props)(car (cdr props)))
(setq props (cdr (cdr props)))))))
(if (> ov-end end)
(move-overlay ov end ov-end)
(delete-overlay ov))))))
(hilit-chg-display-changes beg end)))