[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 10d7726 077/271: Use custom JSON parser.
From: |
Jackson Ray Hamilton |
Subject: |
[elpa] master 10d7726 077/271: Use custom JSON parser. |
Date: |
Thu, 05 Feb 2015 18:29:54 +0000 |
branch: master
commit 10d77261d796ea1b90c6f7bd5924ad73f5c81c61
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>
Use custom JSON parser.
---
context-coloring.el | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/context-coloring.el b/context-coloring.el
index ecebce6..d821f72 100644
--- a/context-coloring.el
+++ b/context-coloring.el
@@ -37,8 +37,6 @@
;;; Code:
-(require 'json)
-
;;; Faces
(defface context-coloring-depth--1-face
@@ -224,6 +222,10 @@ buffer."
(delete-process context-coloring-scopifier-process)
(setq context-coloring-scopifier-process nil)))
+(defun context-coloring-parse-array (input)
+ "Specialized alternative JSON parser."
+ (apply 'vector (mapcar 'string-to-number (split-string (substring input 1
-1) ","))))
+
(defun context-coloring-scopify ()
"Invokes the external scopifier with the current buffer's
contents, reading the scopifier's response asynchronously and
@@ -253,7 +255,7 @@ applying a parsed list of tokens to
(set-process-sentinel context-coloring-scopifier-process
(lambda (process event)
(when (equal "finished\n" event)
- (let ((tokens (json-read-from-string output)))
+ (let ((tokens (context-coloring-parse-array
output)))
(with-current-buffer buffer
(context-coloring-apply-tokens tokens))
(setq context-coloring-scopifier-process nil)
- [elpa] master c1f9f11 063/271: Switch to concat., (continued)
- [elpa] master c1f9f11 063/271: Switch to concat., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 183ac4e 081/271: Add emacs benchmark., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 59b1c99 074/271: Documentation and cleanup., Jackson Ray Hamilton, 2015/02/05
- [elpa] master c81c3fd 068/271: Make declarations bold., Jackson Ray Hamilton, 2015/02/05
- [elpa] master f9eb4a1 080/271: Revert "Use alist of faces.", Jackson Ray Hamilton, 2015/02/05
- [elpa] master ea3fd79 071/271: Make implicit global variables bold., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 1039a74 073/271: Update microoptimized version., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 18e35dd 069/271: Shift token properties., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 49f5e3e 079/271: Use alist of faces., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 8615688 089/271: Create tests., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 10d7726 077/271: Use custom JSON parser.,
Jackson Ray Hamilton <=
- [elpa] master 099f434 082/271: Add optimizations for byte-compilation., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 0bfdbcd 085/271: Remove naive timers., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 4874e1e 086/271: Improve documentation and Makefile., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 43d2ca0 090/271: Remove unused monad., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 820becb 084/271: Fix test., Jackson Ray Hamilton, 2015/02/05
- [elpa] master fb57258 088/271: Reorder readme., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 426a7cd 083/271: Fix regression where existent definitions were missed., Jackson Ray Hamilton, 2015/02/05
- [elpa] master f8120d4 092/271: Update scenarios. Update readme., Jackson Ray Hamilton, 2015/02/05
- [elpa] master f50880d 091/271: Update header., Jackson Ray Hamilton, 2015/02/05
- [elpa] master a0139c3 087/271: Cleanup Makefile., Jackson Ray Hamilton, 2015/02/05