-;;; syntax.el --- helper functions to find syntactic context
+;;; syntax.el --- helper functions to find syntactic context -*- lexical-binding: t -*-
-;; Copyright (C) 2000, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2012 Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: internal
;; syntax-ppss-flush-cache since that would not only flush the cache but also
;; reset syntax-propertize--done which should not be done in this case).
"Mode-specific function to apply the syntax-table properties.
-Called with 2 arguments: START and END.
+Called with two arguments: START and END.
This function can call `syntax-ppss' on any position before END, but it
should not call `syntax-ppss-flush-cache', which means that it should not
call `syntax-ppss' on some position and later modify the buffer on some
(cons beg end))
(defvar syntax-propertize--done -1
- "Position upto which syntax-table properties have been set.")
+ "Position up to which syntax-table properties have been set.")
(make-variable-buffer-local 'syntax-propertize--done)
(defun syntax-propertize--shift-groups (re n)
(if syntax
(put-text-property
mb me 'syntax-table syntax))))))))
-
+
(if (or (not (cddr rule)) (zerop gn))
(setq code (nconc (nreverse thiscode) code))
(push `(if (match-beginning ,gn)
"Propertize for syntax in START..END using font-lock syntax.
KEYWORDS obeys the format used in `font-lock-syntactic-keywords'.
The return value is a function suitable for `syntax-propertize-function'."
- (lexical-let ((keywords keywords))
- (lambda (start end)
- (with-no-warnings
- (let ((font-lock-syntactic-keywords keywords))
- (font-lock-fontify-syntactic-keywords-region start end)
- ;; In case it was eval'd/compiled.
- (setq keywords font-lock-syntactic-keywords))))))
+ (lambda (start end)
+ (with-no-warnings
+ (let ((font-lock-syntactic-keywords keywords))
+ (font-lock-fontify-syntactic-keywords-region start end)
+ ;; In case it was eval'd/compiled.
+ (setq keywords font-lock-syntactic-keywords)))))
(defun syntax-propertize (pos)
- "Ensure that syntax-table properties are set upto POS."
+ "Ensure that syntax-table properties are set until POS."
(when (and syntax-propertize-function
(< syntax-propertize--done pos))
;; (message "Needs to syntax-propertize from %s to %s"
(defun syntax-ppss (&optional pos)
"Parse-Partial-Sexp State at POS, defaulting to point.
-The returned value is the same as `parse-partial-sexp' except that
-the 2nd and 6th values of the returned state cannot be relied upon.
+The returned value is the same as that of `parse-partial-sexp'
+run from point-min to POS except that values at positions 2 and 6
+in the returned list (counting from 0) cannot be relied upon.
Point is at POS when this function returns."
;; Default values.
(unless pos (setq pos (point)))
(provide 'syntax)
-;; arch-tag: 302f1eeb-e77c-4680-a8c5-c543e01161a5
;;; syntax.el ends here