From: Chong Yidong Date: Tue, 7 Oct 2008 16:18:22 +0000 (+0000) Subject: (json-advance): Use forward-char. X-Git-Tag: emacs-pretest-23.0.90~2614 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ac611f4ffaa0c8d8f62f0d77f425b0df2e652602;p=emacs.git (json-advance): Use forward-char. (json-skip-whitespace): Use skip-syntax-forward. --- 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 " "))