Mercurial > emacs
comparison lisp/fast-lock.el @ 49549:99be3a1e2589
Cygwin support patch.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Fri, 31 Jan 2003 15:24:20 +0000 |
parents | 05e79d32e0c7 |
children | 695cf19ef79e |
comparison
equal
deleted
inserted
replaced
49548:8b1c605f8c9b | 49549:99be3a1e2589 |
---|---|
32 ;; | 32 ;; |
33 ;; See caveats and feedback below. | 33 ;; See caveats and feedback below. |
34 ;; See also the lazy-lock package. (But don't use the two at the same time!) | 34 ;; See also the lazy-lock package. (But don't use the two at the same time!) |
35 | 35 |
36 ;; Installation: | 36 ;; Installation: |
37 ;; | 37 ;; |
38 ;; Put in your ~/.emacs: | 38 ;; Put in your ~/.emacs: |
39 ;; | 39 ;; |
40 ;; (setq font-lock-support-mode 'fast-lock-mode) | 40 ;; (setq font-lock-support-mode 'fast-lock-mode) |
41 ;; | 41 ;; |
42 ;; Start up a new Emacs and use font-lock as usual (except that you can use the | 42 ;; Start up a new Emacs and use font-lock as usual (except that you can use the |
65 ;; - Moved save-all conditions to `fast-lock-save-cache' | 65 ;; - Moved save-all conditions to `fast-lock-save-cache' |
66 ;; - Added `fast-lock-save-text-properties' to `kill-buffer-hook' | 66 ;; - Added `fast-lock-save-text-properties' to `kill-buffer-hook' |
67 ;; 1.01--2.00: complete rewrite---not worth the space to document | 67 ;; 1.01--2.00: complete rewrite---not worth the space to document |
68 ;; - Changed structure of text properties cache and threw out file mod checks | 68 ;; - Changed structure of text properties cache and threw out file mod checks |
69 ;; 2.00--2.01: | 69 ;; 2.00--2.01: |
70 ;; - Made `condition-case' forms understand `quit'. | 70 ;; - Made `condition-case' forms understand `quit'. |
71 ;; - Made `fast-lock' require `font-lock' | 71 ;; - Made `fast-lock' require `font-lock' |
72 ;; - Made `fast-lock-cache-name' chase links (from Ben Liblit) | 72 ;; - Made `fast-lock-cache-name' chase links (from Ben Liblit) |
73 ;; 2.01--3.00: | 73 ;; 2.01--3.00: |
74 ;; - Changed structure of cache to include `font-lock-keywords' (from rms) | 74 ;; - Changed structure of cache to include `font-lock-keywords' (from rms) |
75 ;; - Changed `fast-lock-cache-mechanisms' to `fast-lock-cache-directories' | 75 ;; - Changed `fast-lock-cache-mechanisms' to `fast-lock-cache-directories' |
228 (when temp-message | 228 (when temp-message |
229 (message current-message)))))) | 229 (message current-message)))))) |
230 ;; | 230 ;; |
231 ;; We use this for compatibility with a future Emacs. | 231 ;; We use this for compatibility with a future Emacs. |
232 (or (fboundp 'defcustom) | 232 (or (fboundp 'defcustom) |
233 (defmacro defcustom (symbol value doc &rest args) | 233 (defmacro defcustom (symbol value doc &rest args) |
234 `(defvar ,symbol ,value ,doc)))) | 234 `(defvar ,symbol ,value ,doc)))) |
235 | 235 |
236 ;(defun fast-lock-submit-bug-report () | 236 ;(defun fast-lock-submit-bug-report () |
237 ; "Submit via mail a bug report on fast-lock.el." | 237 ; "Submit via mail a bug report on fast-lock.el." |
238 ; (interactive) | 238 ; (interactive) |
551 See `fast-lock-cache-directory'." | 551 See `fast-lock-cache-directory'." |
552 (if (string-equal directory ".") | 552 (if (string-equal directory ".") |
553 (concat buffer-file-name ".flc") | 553 (concat buffer-file-name ".flc") |
554 (let* ((bufile (expand-file-name buffer-file-truename)) | 554 (let* ((bufile (expand-file-name buffer-file-truename)) |
555 (chars-alist | 555 (chars-alist |
556 (if (memq system-type '(emx windows-nt)) | 556 (if (memq system-type '(emx windows-nt cygwin)) |
557 '((?/ . (?#)) (?# . (?# ?#)) (?: . (?\;)) (?\; . (?\; ?\;))) | 557 '((?/ . (?#)) (?# . (?# ?#)) (?: . (?\;)) (?\; . (?\; ?\;))) |
558 '((?/ . (?#)) (?# . (?# ?#))))) | 558 '((?/ . (?#)) (?# . (?# ?#))))) |
559 (mapchars | 559 (mapchars |
560 (function (lambda (c) (or (cdr (assq c chars-alist)) (list c)))))) | 560 (function (lambda (c) (or (cdr (assq c chars-alist)) (list c)))))) |
561 (concat | 561 (concat |
805 (regions (cdr (car face-properties)))) | 805 (regions (cdr (car face-properties)))) |
806 (while regions | 806 (while regions |
807 (font-lock-set-face (nth 0 regions) (nth 1 regions) face) | 807 (font-lock-set-face (nth 0 regions) (nth 1 regions) face) |
808 (setq regions (nthcdr 2 regions))) | 808 (setq regions (nthcdr 2 regions))) |
809 (setq face-properties (cdr face-properties)))) | 809 (setq face-properties (cdr face-properties)))) |
810 ;; XEmacs does not support the `syntax-table' text property. | 810 ;; XEmacs does not support the `syntax-table' text property. |
811 )) | 811 )) |
812 ;; | 812 ;; |
813 ;; XEmacs 19.12 font-lock.el's `font-lock-fontify-buffer' runs a hook. | 813 ;; XEmacs 19.12 font-lock.el's `font-lock-fontify-buffer' runs a hook. |
814 (add-hook 'font-lock-after-fontify-buffer-hook | 814 (add-hook 'font-lock-after-fontify-buffer-hook |
815 'fast-lock-after-fontify-buffer)) | 815 'fast-lock-after-fontify-buffer)) |