diff options
| author | Richard M. Stallman | 2004-11-07 04:10:38 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2004-11-07 04:10:38 +0000 |
| commit | e710efbbb3dc0fd89f51f82f0556270c5f032381 (patch) | |
| tree | 3962ea11e46bbe1527c06d0f4cc993312fef23ea | |
| parent | da355cba85f3b1b4d79f224f04e314ab9f9b84d7 (diff) | |
| download | emacs-e710efbbb3dc0fd89f51f82f0556270c5f032381.tar.gz emacs-e710efbbb3dc0fd89f51f82f0556270c5f032381.zip | |
(syntax-after): Return the syntax letter, not the raw code.
| -rw-r--r-- | lisp/subr.el | 18 |
1 files changed, 13 insertions, 5 deletions
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." | |||
| 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'. |