aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/hilit-chg.el64
2 files changed, 39 insertions, 32 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 0c6093f5a9e..3b7b62badc2 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12012-12-07 Le Wang <l26wang@gmail.com>
2
3 * hilit-chg.el (hilit-chg-set-face-on-change): Don't burp in
4 narrowed buffer (bug#12361).
5
12012-12-07 Michael Heerdegen <michael_heerdegen@web.de> 62012-12-07 Michael Heerdegen <michael_heerdegen@web.de>
2 7
3 * emacs-lisp/debug.el (debug): Fix hard-coded frame counts (bug#10025). 8 * emacs-lisp/debug.el (debug): Fix hard-coded frame counts (bug#10025).
@@ -3341,7 +3346,7 @@
3341 * calendar/cal-tex.el (cal-tex-weekly-common): 3346 * calendar/cal-tex.el (cal-tex-weekly-common):
3342 Restore leading blank page. 3347 Restore leading blank page.
3343 3348
33442012-08-22 Le Wang <l26wang@gmail.com> (tiny change) 33492012-08-22 Le Wang <l26wang@gmail.com>
3345 3350
3346 * misc.el (forward-to-word, backward-to-word): Activate or extend 3351 * misc.el (forward-to-word, backward-to-word): Activate or extend
3347 the region under `shift-select-mode'. (Bug#12231) 3352 the region under `shift-select-mode'. (Bug#12231)
diff --git a/lisp/hilit-chg.el b/lisp/hilit-chg.el
index 0970ece9446..7b5e2b54300 100644
--- a/lisp/hilit-chg.el
+++ b/lisp/hilit-chg.el
@@ -569,37 +569,39 @@ This allows you to manually remove highlighting from uninteresting changes."
569 highlight-changes-visible-mode) 569 highlight-changes-visible-mode)
570 (hilit-chg-fixup beg end)) 570 (hilit-chg-fixup beg end))
571 (highlight-save-buffer-state 571 (highlight-save-buffer-state
572 (if (and (= beg end) (> leng-before 0)) 572 (if (and (= beg end) (> leng-before 0))
573 ;; deletion 573 ;; deletion
574 (progn 574 (progn
575 ;; The eolp and bolp tests are a kludge! But they prevent 575 ;; The eolp and bolp tests are a kludge! But they prevent
576 ;; rather nasty looking displays when deleting text at the end 576 ;; rather nasty looking displays when deleting text at the end
577 ;; of line, such as normal corrections as one is typing and 577 ;; of line, such as normal corrections as one is typing and
578 ;; immediately makes a correction, and when deleting first 578 ;; immediately makes a correction, and when deleting first
579 ;; character of a line. 579 ;; character of a line.
580 ;; (if (= leng-before 1) 580 ;; (if (= leng-before 1)
581 ;; (if (eolp) 581 ;; (if (eolp)
582 ;; (setq beg-decr 0 end-incr 0) 582 ;; (setq beg-decr 0 end-incr 0)
583 ;; (if (bolp) 583 ;; (if (bolp)
584 ;; (setq beg-decr 0)))) 584 ;; (setq beg-decr 0))))
585 ;; (setq beg (max (- beg beg-decr) (point-min))) 585 ;; (setq beg (max (- beg beg-decr) (point-min)))
586 (setq end (min (+ end end-incr) (point-max))) 586 (setq end (min (+ end end-incr) (point-max)))
587 (setq type 'hilit-chg-delete)) 587 (setq type 'hilit-chg-delete))
588 ;; Not a deletion. 588 ;; Not a deletion.
589 ;; Most of the time the following is not necessary, but 589 ;; Most of the time the following is not necessary, but
590 ;; if the current text was marked as a deletion then 590 ;; if the current text was marked as a deletion then
591 ;; the old overlay is still in effect, so if we add some 591 ;; the old overlay is still in effect. So if the user adds some
592 ;; text then remove the deletion marking, but set it to 592 ;; text where she earlier deleted text, we have to remove the
593 ;; changed otherwise its highlighting disappears. 593 ;; deletion marking, and replace it explicitly with a `changed'
594 (if (eq (get-text-property end 'hilit-chg) 'hilit-chg-delete) 594 ;; marking, otherwise its highlighting would disappear.
595 (progn 595 (if (eq (get-text-property end 'hilit-chg) 'hilit-chg-delete)
596 (put-text-property end (+ end 1) 'hilit-chg 'hilit-chg) 596 (save-restriction
597 (if highlight-changes-visible-mode 597 (widen)
598 (hilit-chg-fixup beg (+ end 1)))))) 598 (put-text-property end (+ end 1) 'hilit-chg 'hilit-chg)
599 (unless no-property-change 599 (if highlight-changes-visible-mode
600 (put-text-property beg end 'hilit-chg type)) 600 (hilit-chg-fixup beg (+ end 1))))))
601 (if (or highlight-changes-visible-mode no-property-change) 601 (unless no-property-change
602 (hilit-chg-make-ov type beg end))))))) 602 (put-text-property beg end 'hilit-chg type))
603 (if (or highlight-changes-visible-mode no-property-change)
604 (hilit-chg-make-ov type beg end)))))))
603 605
604(defun hilit-chg-update () 606(defun hilit-chg-update ()
605 "Update a buffer's highlight changes when visibility changed." 607 "Update a buffer's highlight changes when visibility changed."