comparison lisp/subr.el @ 58009:07de2e31fd49

(syntax-after): Return the syntax letter, not the raw code.
author Richard M. Stallman <rms@gnu.org>
date Sun, 07 Nov 2004 04:10:38 +0000
parents 6a6fe71c779d
children a683f1bc6fbe
comparison
equal deleted inserted replaced
58008:df086ccddd21 58009:07de2e31fd49
2207 (let ((table (make-char-table 'syntax-table nil))) 2207 (let ((table (make-char-table 'syntax-table nil)))
2208 (set-char-table-parent table (or oldtable (standard-syntax-table))) 2208 (set-char-table-parent table (or oldtable (standard-syntax-table)))
2209 table)) 2209 table))
2210 2210
2211 (defun syntax-after (pos) 2211 (defun syntax-after (pos)
2212 "Return the syntax of the char after POS." 2212 "Return the syntax of the char after POS.
2213 The value is either a syntax character (a character that designates
2214 a syntax in `modify-syntax-entry'), or a cons cell
2215 of the form (CODE . MATCH), where CODE is the syntax character
2216 and MATCH is the matching parenthesis."
2213 (unless (or (< pos (point-min)) (>= pos (point-max))) 2217 (unless (or (< pos (point-min)) (>= pos (point-max)))
2214 (let ((st (if parse-sexp-lookup-properties 2218 (let* ((st (if parse-sexp-lookup-properties
2215 (get-char-property pos 'syntax-table)))) 2219 (get-char-property pos 'syntax-table)))
2216 (if (consp st) st 2220 (value
2217 (aref (or st (syntax-table)) (char-after pos)))))) 2221 (if (consp st) st
2222 (aref (or st (syntax-table)) (char-after pos))))
2223 (code (if (consp value) (car value) value)))
2224 (setq code (aref "-.w_()'\"$\\/<>@!|" code))
2225 (if (consp value) (cons code (cdr value)) code))))
2218 2226
2219 (defun add-to-invisibility-spec (arg) 2227 (defun add-to-invisibility-spec (arg)
2220 "Add elements to `buffer-invisibility-spec'. 2228 "Add elements to `buffer-invisibility-spec'.
2221 See documentation for `buffer-invisibility-spec' for the kind of elements 2229 See documentation for `buffer-invisibility-spec' for the kind of elements
2222 that can be added." 2230 that can be added."