113 |
Point is at POS when this function returns." |
Point is at POS when this function returns." |
114 |
;; Default values. |
;; Default values. |
115 |
(unless pos (setq pos (point))) |
(unless pos (setq pos (point))) |
116 |
;; |
;; |
117 |
(let ((old-ppss (cdr syntax-ppss-last)) |
(let ((old-ppss (cdr syntax-ppss-last)) |
118 |
(old-pos (car syntax-ppss-last)) |
(old-pos (car syntax-ppss-last)) |
119 |
(ppss nil) |
(ppss nil) |
129 |
(incf (car (aref syntax-ppss-stats 0))) |
(incf (car (aref syntax-ppss-stats 0))) |
130 |
(incf (cdr (aref syntax-ppss-stats 0)) (- pos old-pos)) |
(incf (cdr (aref syntax-ppss-stats 0)) (- pos old-pos)) |
131 |
(parse-partial-sexp old-pos pos nil nil old-ppss)) |
(parse-partial-sexp old-pos pos nil nil old-ppss)) |
132 |
|
|
133 |
(cond |
(cond |
134 |
;; Use OLD-PPSS if possible and close enough. |
;; Use OLD-PPSS if possible and close enough. |
135 |
((and (not old-pos) old-ppss |
((and (not old-pos) old-ppss |
253 |
syntax-ppss-max-span)) |
syntax-ppss-max-span)) |
254 |
(push pair syntax-ppss-cache) |
(push pair syntax-ppss-cache) |
255 |
(setcar syntax-ppss-cache pair))))))))) |
(setcar syntax-ppss-cache pair))))))))) |
256 |
|
|
257 |
(setq syntax-ppss-last (cons pos ppss)) |
(setq syntax-ppss-last (cons pos ppss)) |
258 |
ppss))) |
ppss))) |
259 |
|
|
282 |
;; (with-current-buffer (or buffer (current-buffer)) |
;; (with-current-buffer (or buffer (current-buffer)) |
283 |
;; (syntax-ppss-depth (syntax-ppss)))) |
;; (syntax-ppss-depth (syntax-ppss)))) |
284 |
|
|
|
(defun syntax-after (pos) |
|
|
"Return the syntax of the char after POS." |
|
|
(unless (or (< pos (point-min)) (>= pos (point-max))) |
|
|
(let ((st (if parse-sexp-lookup-properties |
|
|
(get-char-property pos 'syntax-table)))) |
|
|
(if (consp st) st |
|
|
(aref (or st (syntax-table)) (char-after pos)))))) |
|
|
|
|
285 |
(provide 'syntax) |
(provide 'syntax) |
286 |
;;; syntax.el ends here |
;;; syntax.el ends here |