[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 968d9f2 12/25: Make keywords in comments and strings color
From: |
Jackson Ray Hamilton |
Subject: |
[elpa] master 968d9f2 12/25: Make keywords in comments and strings coloring customizable. |
Date: |
Mon, 30 May 2016 22:10:45 +0000 (UTC) |
branch: master
commit 968d9f20d6c948cebdac753b594e98b626ce5b05
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>
Make keywords in comments and strings coloring customizable.
---
context-coloring-emacs-lisp.el | 9 +++++++--
context-coloring.el | 8 ++++----
2 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/context-coloring-emacs-lisp.el b/context-coloring-emacs-lisp.el
index dbe1354..7bda871 100644
--- a/context-coloring-emacs-lisp.el
+++ b/context-coloring-emacs-lisp.el
@@ -55,11 +55,16 @@
"Move forward through whitespace and comments."
(while (forward-comment 1)))
+(defsubst context-coloring-elisp-colorize-comments-and-strings
+ (&optional min max)
+ "Color comments and strings from MIN to MAX."
+ (context-coloring-colorize-comments-and-strings min max t))
+
(defsubst context-coloring-elisp-forward-sws ()
"Move through whitespace and comments, coloring comments."
(let ((start (point)))
(context-coloring-forward-sws)
- (context-coloring-colorize-comments-and-strings start (point))))
+ (context-coloring-elisp-colorize-comments-and-strings start (point))))
(defsubst context-coloring-elisp-forward-sexp ()
"Skip/ignore missing sexps, coloring comments and strings."
@@ -606,7 +611,7 @@ It could be a quoted or backquoted expression."
(context-coloring-elisp-increment-sexp-count)
(let ((start (point)))
(forward-sexp)
- (context-coloring-colorize-comments-and-strings start (point))))
+ (context-coloring-elisp-colorize-comments-and-strings start (point))))
;; Elisp has whitespace, words, symbols, open/close parenthesis, expression
;; prefix, string quote, comment starters/enders and escape syntax classes
only.
diff --git a/context-coloring.el b/context-coloring.el
index 52b0844..c2d6c5d 100644
--- a/context-coloring.el
+++ b/context-coloring.el
@@ -263,9 +263,10 @@ it ain't."
"Color a string according to STATE."
(if (nth 3 state) font-lock-string-face nil))
-(defsubst context-coloring-colorize-comments-and-strings (&optional min max)
+(defsubst context-coloring-colorize-comments-and-strings (&optional min max
keywords-p)
"Maybe color comments and strings in buffer from MIN to MAX.
-MIN defaults to beginning of buffer. MAX defaults to end."
+MIN defaults to beginning of buffer. MAX defaults to end. If
+KEYWORDS-P is non-nil, also color keywords from MIN to MAX."
(when (or context-coloring-syntactic-comments
context-coloring-syntactic-strings)
(let ((min (or min (point-min)))
@@ -282,8 +283,7 @@ MIN defaults to beginning of buffer. MAX defaults to end."
font-lock-syntactic-face-function))))
(save-excursion
(font-lock-fontify-syntactically-region min max)
- ;; TODO: Make configurable at the dispatch level.
- (when (eq major-mode 'emacs-lisp-mode)
+ (when keywords-p
(font-lock-fontify-keywords-region min max))))))
(defcustom context-coloring-initial-level 0
- [elpa] master 6c92cc2 19/25: Rename variable., (continued)
- [elpa] master 6c92cc2 19/25: Rename variable., Jackson Ray Hamilton, 2016/05/30
- [elpa] master ceece60 15/25: Trivial cleanup., Jackson Ray Hamilton, 2016/05/30
- [elpa] master f6401a6 17/25: Narrow scope of `make compile'., Jackson Ray Hamilton, 2016/05/30
- [elpa] master 09aef2a 09/25: Add an .elpaignore file., Jackson Ray Hamilton, 2016/05/30
- [elpa] master a9b988e 13/25: Fix improperly prepared test., Jackson Ray Hamilton, 2016/05/30
- [elpa] master 7d284ad 21/25: Remove overly-optimistic delay on Emacs Lisp coloring., Jackson Ray Hamilton, 2016/05/30
- [elpa] master d745846 07/25: Make js2-mode a development dependency., Jackson Ray Hamilton, 2016/05/30
- [elpa] master 455a743 22/25: Version 8.0.0., Jackson Ray Hamilton, 2016/05/30
- [elpa] master a164992 23/25: Don't byte compile development files., Jackson Ray Hamilton, 2016/05/30
- [elpa] master f9a2481 06/25: Autoload dispatches., Jackson Ray Hamilton, 2016/05/30
- [elpa] master 968d9f2 12/25: Make keywords in comments and strings coloring customizable.,
Jackson Ray Hamilton <=
- [elpa] master f654157 04/25: Update copyright years., Jackson Ray Hamilton, 2016/05/30
- [elpa] master 4c9a3fc 16/25: Reorganize files., Jackson Ray Hamilton, 2016/05/30
- [elpa] master 5f51ad4 03/25: Don't use derived-mode-parent dispatches., Jackson Ray Hamilton, 2016/05/30
- [elpa] master a42b53e 05/25: Separate language support into separate features., Jackson Ray Hamilton, 2016/05/30
- [elpa] master 1cb5b98 11/25: Merge branch 'plugins', Jackson Ray Hamilton, 2016/05/30
- [elpa] master 6ee4481 25/25: Merge commit '3007b2917d71a7d66eb94876536dfd80b0661d40' from context-coloring, Jackson Ray Hamilton, 2016/05/30