X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lisp%2Ffont-lock.el;h=d927539e15a025aecafdd9f8e1602dd43c628123;hb=21db8709c0c2dcedbd278c7fe571290d5ce80a71;hp=693b57c8ba1699241ce16afbf6ec433f1f6e3914;hpb=02f4d2761a98c5cb9d5b423d2361160a5d8c9ee4;p=chise%2Fxemacs-chise.git diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 693b57c..d927539 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -2,7 +2,7 @@ ;; Copyright (C) 1992-1995, 1997 Free Software Foundation, Inc. ;; Copyright (C) 1995 Amdahl Corporation. -;; Copyright (C) 1996, 2000 Ben Wing. +;; Copyright (C) 1996, 2000, 2001 Ben Wing. ;; Author: Jamie Zawinski , for the LISPM Preservation Society. ;; Minimally merged with FSF 19.34 by Barry Warsaw @@ -1203,10 +1203,15 @@ buffer modifications are performed or a buffer is reverted.") (defun font-lock-after-change-function (beg end old-len) (when font-lock-mode ;; treat deletions as if the following character (or previous, if - ;; there is no following) were inserted. this is a bit of a hack + ;; there is no following) were inserted. (also use the previous + ;; character at end of line. this avoids a problem when you + ;; insert a comment on the line before a line of code: if we use + ;; the following char, then when you hit backspace, the following + ;; line of code turns the comment color.) this is a bit of a hack ;; but allows us to use text properties for everything. (if (= beg end) - (cond ((/= end (point-max)) (setq end (1+ end))) + (cond ((not (save-excursion (goto-char end) (eolp))) + (setq end (1+ end))) ((/= beg (point-min)) (setq beg (1- beg))) (t nil))) (put-text-property beg end 'font-lock-pending t)