[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master c125d9f 12/26: Reorganize defvars and defcustoms.
From: |
Jackson Ray Hamilton |
Subject: |
[elpa] master c125d9f 12/26: Reorganize defvars and defcustoms. |
Date: |
Sat, 14 Feb 2015 08:19:35 +0000 |
branch: master
commit c125d9fc9e6eeb8ba5a315dd7a061e6b32f17f4d
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>
Reorganize defvars and defcustoms.
---
context-coloring.el | 83 ++++++++++++++++++++++++--------------------------
1 files changed, 40 insertions(+), 43 deletions(-)
diff --git a/context-coloring.el b/context-coloring.el
index aa9e4ca..5d18157 100644
--- a/context-coloring.el
+++ b/context-coloring.el
@@ -56,54 +56,11 @@
(require 'js2-mode)
-;;; Customizable options
-
-(defcustom context-coloring-delay 0.25
- "Delay between a buffer update and colorization.
-
-Increase this if your machine is high-performing. Decrease it if
-it ain't.
-
-Supported modes: `js-mode', `js3-mode'"
- :group 'context-coloring)
-
-(defcustom context-coloring-comments-and-strings t
- "If non-nil, also color comments and strings using `font-lock'."
- :group 'context-coloring)
-
-(defcustom context-coloring-js-block-scopes nil
- "If non-nil, also color block scopes in the scope hierarchy in JavaScript.
-
-The block-scoped `let' and `const' are introduced in ES6. If you
-are writing ES6 code, enable this; otherwise, don't.
-
-Supported modes: `js2-mode'"
- :group 'context-coloring)
-
-(defcustom context-coloring-benchmark-colorization nil
- "If non-nil, track how long colorization takes and print
-messages with the colorization duration."
- :group 'context-coloring)
-
-
;;; Local variables
(defvar-local context-coloring-buffer nil
"Reference to this buffer (for timers).")
-(defvar-local context-coloring-scopifier-process nil
- "Reference to the single scopifier process that can be
- running.")
-
-(defvar-local context-coloring-colorize-idle-timer nil
- "Reference to the currently-running idle timer.")
-
-(defvar-local context-coloring-changed nil
- "Indication that the buffer has changed recently, which would
-imply that it should be colorized again by
-`context-coloring-colorize-idle-timer' if that timer is being
-used.")
-
;;; Faces
@@ -186,6 +143,10 @@ END (exclusive) with the face corresponding to LEVEL."
end
`(face ,(context-coloring-level-face level))))
+(defcustom context-coloring-comments-and-strings t
+ "If non-nil, also color comments and strings using `font-lock'."
+ :group 'context-coloring)
+
(defsubst context-coloring-maybe-colorize-comments-and-strings ()
"Colorizes the current buffer's comments and strings if
`context-coloring-comments-and-strings' is non-nil."
@@ -200,6 +161,15 @@ END (exclusive) with the face corresponding to LEVEL."
"Associates `js2-scope' structures and with their scope
levels.")
+(defcustom context-coloring-js-block-scopes nil
+ "If non-nil, also color block scopes in the scope hierarchy in JavaScript.
+
+The block-scoped `let' and `const' are introduced in ES6. If you
+are writing ES6 code, enable this; otherwise, don't.
+
+Supported modes: `js2-mode'"
+ :group 'context-coloring)
+
(defsubst context-coloring-js2-scope-level (scope)
"Gets the level of SCOPE."
(cond ((gethash scope context-coloring-js2-scope-level-hash-table))
@@ -296,6 +266,10 @@ element."
(vconcat
(mapcar 'string-to-number (split-string (substring input 1 -1) ","))))
+(defvar-local context-coloring-scopifier-process nil
+ "Reference to the single scopifier process that can be
+ running.")
+
(defun context-coloring-kill-scopifier ()
"Kills the currently-running scopifier process for this
buffer."
@@ -451,6 +425,11 @@ elisp tracks, and asynchronously for shell command tracks."
;;; Colorization
+(defcustom context-coloring-benchmark-colorization nil
+ "If non-nil, track how long colorization takes and print
+messages with the colorization duration."
+ :group 'context-coloring)
+
(defun context-coloring-colorize (&optional callback)
"Colors the current buffer by function context.
@@ -463,6 +442,12 @@ Invokes CALLBACK when complete; see
`context-coloring-dispatch'."
(message "Colorization took %.3f seconds" (- (float-time)
start-time)))
(when callback (funcall callback))))))
+(defvar-local context-coloring-changed nil
+ "Indication that the buffer has changed recently, which would
+imply that it should be colorized again by
+`context-coloring-colorize-idle-timer' if that timer is being
+used.")
+
(defun context-coloring-change-function (_start _end _length)
"Registers a change so that a buffer can be colorized soon."
;; Tokenization is obsolete if there was a change.
@@ -829,6 +814,18 @@ faces for custom themes that might not exist yet."
;;; Minor mode
+(defvar-local context-coloring-colorize-idle-timer nil
+ "Reference to the currently-running idle timer.")
+
+(defcustom context-coloring-delay 0.25
+ "Delay between a buffer update and colorization.
+
+Increase this if your machine is high-performing. Decrease it if
+it ain't.
+
+Supported modes: `js-mode', `js3-mode'"
+ :group 'context-coloring)
+
;;;###autoload
(define-minor-mode context-coloring-mode
"Context-based code coloring, inspired by Douglas Crockford."
- [elpa] master 75e624c 01/26: Todo., (continued)
- [elpa] master 75e624c 01/26: Todo., Jackson Ray Hamilton, 2015/02/14
- [elpa] master bd11b35 03/26: Avoid using the `font-lock-string-face' color for zenburn., Jackson Ray Hamilton, 2015/02/14
- [elpa] master ebbc2f1 04/26: Fix documentation for `context-coloring-maximum-face'., Jackson Ray Hamilton, 2015/02/14
- [elpa] master 62c38d8 05/26: Fix comment., Jackson Ray Hamilton, 2015/02/14
- [elpa] master 880ab8a 02/26: Use `maximum-face' instead of `face-count'., Jackson Ray Hamilton, 2015/02/14
- [elpa] master e451d29 06/26: Restore original `context-coloring-maximum-face' value., Jackson Ray Hamilton, 2015/02/14
- [elpa] master a1b7f3e 08/26: Define extra faces in `context-coloring-set-colors-default'., Jackson Ray Hamilton, 2015/02/14
- [elpa] master ca15a60 09/26: Whitespace., Jackson Ray Hamilton, 2015/02/14
- [elpa] master 351142e 07/26: More disciplined use of `if'., Jackson Ray Hamilton, 2015/02/14
- [elpa] master e68d00b 11/26: Whitespace., Jackson Ray Hamilton, 2015/02/14
- [elpa] master c125d9f 12/26: Reorganize defvars and defcustoms.,
Jackson Ray Hamilton <=
- [elpa] master a49b024 15/26: Whitespace., Jackson Ray Hamilton, 2015/02/14
- [elpa] master 0681e94 13/26: Remove `set-colors' and `set-colors-default'., Jackson Ray Hamilton, 2015/02/14
- [elpa] master e5d512f 10/26: "Misfeature.", Jackson Ray Hamilton, 2015/02/14
- [elpa] master 25a8d13 16/26: Documentation., Jackson Ray Hamilton, 2015/02/14
- [elpa] master 4c3d1da 17/26: Rename `defface-default' to `defface-neutral'., Jackson Ray Hamilton, 2015/02/14
- [elpa] master 8367e19 18/26: Rename `level-face' functions., Jackson Ray Hamilton, 2015/02/14
- [elpa] master 3d91840 22/26: Remove `context-coloring-benchmark-colorization'., Jackson Ray Hamilton, 2015/02/14
- [elpa] master 3805110 14/26: Reorganize faces. Remove eval macroexpand., Jackson Ray Hamilton, 2015/02/14
- [elpa] master a7db850 20/26: Cleanup documentation., Jackson Ray Hamilton, 2015/02/14
- [elpa] master bae456d 19/26: Use imperative for documentation., Jackson Ray Hamilton, 2015/02/14