From: Richard M. Stallman Date: Sun, 7 Nov 2004 04:10:38 +0000 (+0000) Subject: (syntax-after): Return the syntax letter, not the raw code. X-Git-Tag: ttn-vms-21-2-B4~4129 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e710efbbb3dc0fd89f51f82f0556270c5f032381;p=emacs.git (syntax-after): Return the syntax letter, not the raw code. --- diff --git a/lisp/subr.el b/lisp/subr.el index d84aebceba4..faf9e6c2f13 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2209,12 +2209,20 @@ from `standard-syntax-table' otherwise." table)) (defun syntax-after (pos) - "Return the syntax of the char after POS." + "Return the syntax of the char after POS. +The value is either a syntax character (a character that designates +a syntax in `modify-syntax-entry'), or a cons cell +of the form (CODE . MATCH), where CODE is the syntax character +and MATCH is the matching parenthesis." (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)))))) + (let* ((st (if parse-sexp-lookup-properties + (get-char-property pos 'syntax-table))) + (value + (if (consp st) st + (aref (or st (syntax-table)) (char-after pos)))) + (code (if (consp value) (car value) value))) + (setq code (aref "-.w_()'\"$\\/<>@!|" code)) + (if (consp value) (cons code (cdr value)) code)))) (defun add-to-invisibility-spec (arg) "Add elements to `buffer-invisibility-spec'.