Changeset 4079 for trunk/lisp/emacs-lisp/syntax.el
- Timestamp:
- 05/13/06 11:31:18 (3 years ago)
- Files:
-
- trunk/lisp/emacs-lisp/syntax.el (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lisp/emacs-lisp/syntax.el
r4037 r4079 28 28 ;; The main exported function is `syntax-ppss'. You might also need 29 29 ;; to call `syntax-ppss-flush-cache' or to add it to 30 ;; after-change-functions'(although this is automatically done by30 ;; before-change-functions'(although this is automatically done by 31 31 ;; syntax-ppss when needed, but that might fail if syntax-ppss is 32 ;; called in a context where after-change-functions is temporarily32 ;; called in a context where before-change-functions is temporarily 33 33 ;; let-bound to nil). 34 34 … … 95 95 (setcar syntax-ppss-last nil))) 96 96 ;; Unregister if there's no cache left. Sadly this doesn't work 97 ;; because ` after-change-functions' is temporarily bound to nil here.97 ;; because `before-change-functions' is temporarily bound to nil here. 98 98 ;; (unless syntax-ppss-cache 99 ;; (remove-hook 'after-change-functions 100 ;; 'syntax-ppss-after-change-function t)) 99 ;; (remove-hook 'before-change-functions 'syntax-ppss-flush-cache t)) 101 100 ) 102 101 … … 149 148 ;; in (nth 9 old-ppss), but that doesn't seem to happen in 150 149 ;; practice and it would complicate this code (and the 151 ;; after-change-function code even more). But maybe it150 ;; before-change-function code even more). But maybe it 152 151 ;; would be useful in "degenerate" cases such as when the 153 152 ;; whole file is wrapped in a set of parenthesis. … … 177 176 (if cache (setq pt-min (caar cache) ppss (cdar cache))) 178 177 179 ;; Setup the after-change function if necessary.178 ;; Setup the before-change function if necessary. 180 179 (unless (or syntax-ppss-cache syntax-ppss-last) 181 (add-hook ' after-change-functions182 'syntax-ppss-flush-cache nilt))180 (add-hook 'before-change-functions 181 'syntax-ppss-flush-cache t t)) 183 182 184 183 ;; Use the best of OLD-POS and CACHE.
