# HG changeset patch # User Stefan Monnier # Date 961545545 0 # Node ID dd9436a06050efa7e6d75d7177693abf6939052b # Parent 05c0499d035a3afe1bf5fb0c6009d8de1b8f8a7d (jit-lock-after-change): Don't assume point is at START. diff -r 05c0499d035a -r dd9436a06050 lisp/jit-lock.el --- a/lisp/jit-lock.el Tue Jun 20 23:58:18 2000 +0000 +++ b/lisp/jit-lock.el Tue Jun 20 23:59:05 2000 +0000 @@ -439,20 +439,22 @@ in case the syntax of those lines has changed. Refontification will take place when text is fontified stealthily." (when jit-lock-mode - ;; It's important that the `fontified' property be set from the - ;; beginning of the line, else font-lock will properly change the - ;; text's face, but the display will have been done already and will - ;; be inconsistent with the buffer's content. - (setq start (line-beginning-position)) - ;; Make sure we change at least one char (in case of deletions). - (setq end (min (max end (1+ start)) (point-max))) - ;; Request refontification. - (with-buffer-prepared-for-jit-lock - (put-text-property start end 'fontified nil)) - ;; Mark the change for deferred contextual refontification. - (when jit-lock-first-unfontify-pos - (setq jit-lock-first-unfontify-pos - (min jit-lock-first-unfontify-pos start))))) + (save-excursion + (with-buffer-prepared-for-jit-lock + ;; It's important that the `fontified' property be set from the + ;; beginning of the line, else font-lock will properly change the + ;; text's face, but the display will have been done already and will + ;; be inconsistent with the buffer's content. + (goto-char start) + (setq start (line-beginning-position)) + ;; Make sure we change at least one char (in case of deletions). + (setq end (min (max end (1+ start)) (point-max))) + ;; Request refontification. + (put-text-property start end 'fontified nil)) + ;; Mark the change for deferred contextual refontification. + (when jit-lock-first-unfontify-pos + (setq jit-lock-first-unfontify-pos + (min jit-lock-first-unfontify-pos start)))))) (provide 'jit-lock)