From ac611f4ffaa0c8d8f62f0d77f425b0df2e652602 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Tue, 7 Oct 2008 16:18:22 +0000 Subject: [PATCH] (json-advance): Use forward-char. (json-skip-whitespace): Use skip-syntax-forward. --- lisp/json.el | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lisp/json.el b/lisp/json.el index 38ec16f5db7..203ec596980 100644 --- a/lisp/json.el +++ b/lisp/json.el @@ -123,11 +123,7 @@ this around your call to `json-read' instead of `setq'ing it.") (defsubst json-advance (&optional n) "Skip past the following N characters." - (unless n (setq n 1)) - (let ((goal (+ (point) n))) - (goto-char goal) - (when (< (point) goal) - (signal 'end-of-file nil)))) + (forward-char n)) (defsubst json-peek () "Return the character at point." @@ -144,8 +140,7 @@ this around your call to `json-read' instead of `setq'ing it.") (defun json-skip-whitespace () "Skip past the whitespace at point." - (while (looking-at "[\t\r\n\f\b ]") - (goto-char (match-end 0)))) + (skip-syntax-forward " ")) -- 2.39.5