emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

json.el speed-ups


From: T. V. Raman
Subject: json.el speed-ups
Date: Tue, 7 Oct 2008 06:29:24 -0700

I've been using the following mods to json.el with good results,
am attaching diff output.

Change Summary:

Use forward-char in json-advance 
Use skip-syntax-forward to implement skipping whitespace

diff json.el  ~/sourceforge/emacs/lisp/json.el
126,127c126,130
<   (forward-char n))
< 
---
>   (unless n (setq n 1))
>   (let ((goal (+ (point) n)))
>     (goto-char goal)
>     (when (< (point) goal)
>       (signal 'end-of-file nil))))
142c145
< (defsubst json-skip-whitespace ()
---
> (defun json-skip-whitespace ()
144c147,148
<   (skip-syntax-forward " "))
---
>   (while (looking-at "[\t\r\n\f\b ]")
>     (goto-char (match-end 0))))
06:28:10 labrador g-client $ 

-- 
Best Regards,
--raman

      
Email:  address@hidden
WWW:    http://emacspeak.sf.net/raman/
AIM:    emacspeak       GTalk: address@hidden
PGP:    http://emacspeak.sf.net/raman/raman-almaden.asc
Google: tv+raman 
IRC:    irc://irc.freenode.net/#emacs




reply via email to

[Prev in Thread] Current Thread [Next in Thread]