[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: json.el speed-ups
From: |
T. V. Raman |
Subject: |
Re: json.el speed-ups |
Date: |
Tue, 7 Oct 2008 20:21:11 -0700 |
Yes, the \b should be added as you suggest to be equivalent.
Eventually I think json.el should be sped up by creating a json
specific syntax table. This would help enormously in things like
parsing numbers etc; for now, json-read-number loops through each
char making up the number. As does json-read-keyword, and many
other functions.
>>>>> "Stefan" == Stefan Monnier <address@hidden> writes:
>> I've been using the following mods to json.el with good
>> results, am attaching diff output.
Stefan>
Stefan> Please use unified diffs (or context diffs).
Stefan>
>> < (forward-char n))
>> ---
>>> (unless n (setq n 1)) (let ((goal (+ (point) n)))
>>> (goto-char goal) (when (< (point) goal) (signal
>>> 'end-of-file nil))))
Stefan>
Stefan> That looks OK, as long as the code doesn't catch
Stefan> `end-of-file' or `end-of-buffer' explicitly
Stefan> elsewhere.
Stefan>
>> 144c147,148 < (skip-syntax-forward " "))
>> ---
>>> (while (looking-at "[\t\r\n\f\b ]") (goto-char (match-end
>>> 0))))
Stefan>
Stefan> Using (skip-chars-forward "\t\r\n\f\b ") would make
Stefan> the diff more obviously correct. Have you checked
Stefan> that all those chars have the "whitespace" syntax in
Stefan> the syntax-table?
Stefan>
Stefan>
Stefan> Stefan
--
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