[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 5fd312b 002/271: More planning and research.
From: |
Jackson Ray Hamilton |
Subject: |
[elpa] master 5fd312b 002/271: More planning and research. |
Date: |
Thu, 05 Feb 2015 18:29:20 +0000 |
branch: master
commit 5fd312b3f7b89eef5d6ec4280f42cc9c5e435894
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>
More planning and research.
---
context-coloring.el | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/context-coloring.el b/context-coloring.el
index e892a6c..16e5157 100644
--- a/context-coloring.el
+++ b/context-coloring.el
@@ -41,3 +41,28 @@
;; according to `function.level`
;; - ...
;; - Profit.
+
+;; elisp functions that may come in handy:
+
+;; save-excursion: Wrap the whole body in this.
+;; goto-line, move-to-column: Finding ranges to apply colors to.
+;; with-silent-modifications: The colorization itself.
+
+;; Probably useful, here's the rainbow-blocks colorizer.
+(defsubst rainbow-blocks-propertize-delimiter (loc depth)
+ "Highlight a single delimiter at LOC according to DEPTH.
+LOC is the location of the character to add text properties to.
+DEPTH is the nested depth at LOC, which determines the face to use.
+Sets text properties:
+`font-lock-face' to the appropriate delimiter face.
+`rear-nonsticky' to prevent color from bleeding into subsequent characters
typed by the user."
+ (with-silent-modifications
+ (let* ((delim-face (if (<= depth 0)
+ 'rainbow-blocks-unmatched-face
+ (rainbow-blocks-depth-face depth)))
+ (end-pos (save-excursion (goto-char loc)
+ (forward-sexp)
+ (point))))
+ (add-text-properties loc end-pos
+ `(font-lock-face ,delim-face
+ rear-nonsticky t)))))
- [elpa] master updated (c8087b9 -> dc9644e), Jackson Ray Hamilton, 2015/02/05
- [elpa] master e3fc05a 011/271: Create bin and scripts directories., Jackson Ray Hamilton, 2015/02/05
- [elpa] master aaf199e 006/271: Fix global wraparound., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 809d48b 020/271: Minor tweaks., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 98df7db 010/271: Optimize cli a little bit., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 5fd312b 002/271: More planning and research.,
Jackson Ray Hamilton <=
- [elpa] master ebc0b99 013/271: Add rollover font lock optimization., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 615ce2c 004/271: Wow, actually works., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 6d79b91 024/271: Idly colorizing after changes working. Cancelling seemingly not working., Jackson Ray Hamilton, 2015/02/05
- [elpa] master fd4b629 007/271: Add mode., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 6e991c4 014/271: Fix off-by-one error., Jackson Ray Hamilton, 2015/02/05
- [elpa] master b35380b 019/271: Vastly improve idle timer strategy., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 7ac8db6 012/271: Fix a bug where strings were matched., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 806398e 016/271: Use asynchronous command execution strategy., Jackson Ray Hamilton, 2015/02/05
- [elpa] master d0f5470 022/271: Successfully lexically bind buffer., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 397ef04 005/271: Detect globals., Jackson Ray Hamilton, 2015/02/05