changeset 61798:994a6fb78d4c

(syntax-after): Doc fix. (syntax-class): If argument is nil, return nil.
author Eli Zaretskii <eliz@gnu.org>
date Sun, 24 Apr 2005 14:48:58 +0000
parents a7edd5d648fa
children e80931baa7c7
files lisp/subr.el
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/subr.el	Sun Apr 24 14:45:08 2005 +0000
+++ b/lisp/subr.el	Sun Apr 24 14:48:58 2005 +0000
@@ -2279,7 +2279,8 @@
     table))
 
 (defun syntax-after (pos)
-  "Return the raw syntax of the char after POS."
+  "Return the raw syntax of the char after POS.
+If POS is outside the buffer's accessible portion, return nil."
   (unless (or (< pos (point-min)) (>= pos (point-max)))
     (let ((st (if parse-sexp-lookup-properties
 		  (get-char-property pos 'syntax-table))))
@@ -2287,8 +2288,9 @@
 	(aref (or st (syntax-table)) (char-after pos))))))
 
 (defun syntax-class (syntax)
-  "Return the syntax class part of the syntax descriptor SYNTAX."
-  (logand (car syntax) 255))
+  "Return the syntax class part of the syntax descriptor SYNTAX.
+If SYNTAX is nil, return nil."
+  (and syntax (logand (car syntax) 65535)))
 
 (defun add-to-invisibility-spec (arg)
   "Add elements to `buffer-invisibility-spec'.