Mercurial > hg > xemacs-beta
comparison lisp/font-lock.el @ 670:12095b04a9b6
[xemacs-hg @ 2001-09-29 08:02:03 by ben]
font-lock.el: fix problem with last patch, reported by Katsumi Yamaoka.
author | ben |
---|---|
date | Sat, 29 Sep 2001 08:03:01 +0000 |
parents | 6e99cc8c6ca5 |
children | cd697e94b3d4 |
comparison
equal
deleted
inserted
replaced
669:5c696033aec4 | 670:12095b04a9b6 |
---|---|
1 ;;; font-lock.el --- decorating source files with fonts/colors based on syntax | 1 ;;; font-lock.el --- decorating source files with fonts/colors based on syntax |
2 | 2 |
3 ;; Copyright (C) 1992-1995, 1997 Free Software Foundation, Inc. | 3 ;; Copyright (C) 1992-1995, 1997 Free Software Foundation, Inc. |
4 ;; Copyright (C) 1995 Amdahl Corporation. | 4 ;; Copyright (C) 1995 Amdahl Corporation. |
5 ;; Copyright (C) 1996, 2000 Ben Wing. | 5 ;; Copyright (C) 1996, 2000, 2001 Ben Wing. |
6 | 6 |
7 ;; Author: Jamie Zawinski <jwz@jwz.org>, for the LISPM Preservation Society. | 7 ;; Author: Jamie Zawinski <jwz@jwz.org>, for the LISPM Preservation Society. |
8 ;; Minimally merged with FSF 19.34 by Barry Warsaw <bwarsaw@python.org> | 8 ;; Minimally merged with FSF 19.34 by Barry Warsaw <bwarsaw@python.org> |
9 ;; Then (partially) synched with FSF 19.30, leading to: | 9 ;; Then (partially) synched with FSF 19.30, leading to: |
10 ;; Next Author: RMS | 10 ;; Next Author: RMS |
1208 ;; insert a comment on the line before a line of code: if we use | 1208 ;; insert a comment on the line before a line of code: if we use |
1209 ;; the following char, then when you hit backspace, the following | 1209 ;; the following char, then when you hit backspace, the following |
1210 ;; line of code turns the comment color.) this is a bit of a hack | 1210 ;; line of code turns the comment color.) this is a bit of a hack |
1211 ;; but allows us to use text properties for everything. | 1211 ;; but allows us to use text properties for everything. |
1212 (if (= beg end) | 1212 (if (= beg end) |
1213 (cond ((not (eolp)) (setq end (1+ end))) | 1213 (cond ((not (save-excursion (goto-char end) (eolp))) |
1214 (setq end (1+ end))) | |
1214 ((/= beg (point-min)) (setq beg (1- beg))) | 1215 ((/= beg (point-min)) (setq beg (1- beg))) |
1215 (t nil))) | 1216 (t nil))) |
1216 (put-text-property beg end 'font-lock-pending t) | 1217 (put-text-property beg end 'font-lock-pending t) |
1217 (puthash (current-buffer) t font-lock-pending-buffer-table) | 1218 (puthash (current-buffer) t font-lock-pending-buffer-table) |
1218 (if font-lock-always-fontify-immediately | 1219 (if font-lock-always-fontify-immediately |