branch: master commit bbebea1bd2836a9d6d23f112966e2028798d674f Merge: f3ab262 f9c3de8 Author: Jackson Ray Hamilton <jack...@jacksonrayhamilton.com> Commit: Jackson Ray Hamilton <jack...@jacksonrayhamilton.com>
Merge branch 'develop' --- Makefile | 1 + context-coloring.el | 29 ++++++++++++++++------------- languages/javascript/binaries/scopifier | 1 + test/context-coloring-test.el | 2 +- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index e718601..1df5088 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,7 @@ bench: compile: ${EMACS} -Q -batch \ + -L . \ -L libraries \ -f batch-byte-compile *.el libraries/*.el diff --git a/context-coloring.el b/context-coloring.el index cd5a8b4..8e9c49e 100644 --- a/context-coloring.el +++ b/context-coloring.el @@ -5,7 +5,7 @@ ;; Author: Jackson Ray Hamilton <jack...@jacksonrayhamilton.com> ;; URL: https://github.com/jacksonrayhamilton/context-coloring ;; Keywords: context coloring syntax highlighting -;; Version: 3.1.0 +;; Version: 3.1.1 ;; Package-Requires: ((emacs "24") (js2-mode "20150126")) ;; This file is part of GNU Emacs. @@ -251,9 +251,9 @@ generated by js2-mode." enclosing-scope (js2-name-node-name node)))) ;; The tree seems to be walked lexically, so an entire scope will - ;; be colored, including its name nodes, before they are - ;; reached. Coloring the nodes defined in that scope would be - ;; redundant, so don't do it. + ;; be colored, including its name nodes, before they are reached. + ;; Coloring the nodes defined in that scope would be redundant, so + ;; don't do it. (when (not (eq defining-scope enclosing-scope)) (context-coloring-js2-colorize-node node @@ -310,7 +310,7 @@ Invokes CALLBACK when complete." (let ((output "") (buffer context-coloring-buffer)) - ;; The process may produce output in multiple chunks. This filter + ;; The process may produce output in multiple chunks. This filter ;; accumulates the chunks into a message. (set-process-filter context-coloring-scopifier-process @@ -356,12 +356,12 @@ Invokes CALLBACK when complete." "Define a new dispatch named SYMBOL with PROPERTIES. A \"dispatch\" is a property list describing a strategy for -coloring a buffer. There are three possible strategies: Parse and -color in a single function (`:colorizer'), parse in a function -that returns scope data (`:scopifier'), or parse with a shell -command that returns scope data (`:command'). In the latter two -cases, the scope data will be used to automatically color the -buffer. +coloring a buffer. There are three possible strategies: Parse +and color in a single function (`:colorizer'), parse in a +function that returns scope data (`:scopifier'), or parse with a +shell command that returns scope data (`:command'). In the +latter two cases, the scope data will be used to automatically +color the buffer. PROPERTIES must include `:modes' and one of `:colorizer', `:scopifier' or `:command'. @@ -412,7 +412,7 @@ level data returned via stdout." "Determines the optimal track for scopification / colorization of the current buffer, then executes it. -Invokes CALLBACK when complete. It is invoked synchronously for +Invokes CALLBACK when complete. It is invoked synchronously for elisp tracks, and asynchronously for shell command tracks." (let ((dispatch (gethash major-mode context-coloring-mode-hash-table))) (if (null dispatch) @@ -430,9 +430,12 @@ elisp tracks, and asynchronously for shell command tracks." (if callback (funcall callback))) ((setq command (plist-get dispatch :command)) (setq executable (plist-get dispatch :executable)) - (if (and (not (null executable)) + (if (and executable (null (executable-find executable))) (message "Executable \"%s\" not found" executable) + (if (and executable + (eq system-type 'windows-nt)) + (setq command (concat executable " " command))) (context-coloring-scopify-shell-command command callback))))))) diff --git a/languages/javascript/binaries/scopifier b/languages/javascript/binaries/scopifier index 82ea34e..0c0a149 100755 --- a/languages/javascript/binaries/scopifier +++ b/languages/javascript/binaries/scopifier @@ -32,5 +32,6 @@ process.stdin.on('readable', function () { }); process.stdin.on('end', function () { + whole = whole.replace(/\r\n/g, '\n'); // Windows console.log(JSON.stringify(scopifier(whole))); }); diff --git a/test/context-coloring-test.el b/test/context-coloring-test.el index 4c62d7a..607882b 100644 --- a/test/context-coloring-test.el +++ b/test/context-coloring-test.el @@ -248,7 +248,7 @@ is FOREGROUND." (ert-deftest context-coloring-test-set-colors () ;; This test has an irreversible side-effect in that it defines faces beyond - ;; 7. Faces 0 through 7 are reset to their default states, so it might not + ;; 7. Faces 0 through 7 are reset to their default states, so it might not ;; matter, but be aware anyway. (context-coloring-set-colors "#000000"