summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2005-04-24 14:50:20 +0000
committerEli Zaretskii <eliz@gnu.org>2005-04-24 14:50:20 +0000
commit9d1ffd5a916c6de9d332141520fda67521ec2dbb (patch)
treeb197f9055a1552fe4d85269837077b38785925a2
parent993746115ba48e3e4feb4d3f0df15103b783ca10 (diff)
downloademacs-9d1ffd5a916c6de9d332141520fda67521ec2dbb.tar.gz
(syntax-after): Doc fix.
(syntax-class): If argument is nil, return nil.
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/subr.el8
2 files changed, 8 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index be485c306d1..1d6c32e3f06 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
2005-04-24 Eli Zaretskii <eliz@gnu.org>
+ * subr.el (syntax-after): Doc fix.
+ (syntax-class): If argument is nil, return nil.
+
* files.el (mode-require-final-newline): Doc fix.
(backup-buffer-copy): Fix last change.
diff --git a/lisp/subr.el b/lisp/subr.el
index f791faffd91..d4210e562cd 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2279,7 +2279,8 @@ from `standard-syntax-table' otherwise."
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 @@ from `standard-syntax-table' otherwise."
(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'.