emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/hl-block-mode bd54144b34 49/64: Cleanup: re-organize secti


From: ELPA Syncer
Subject: [nongnu] elpa/hl-block-mode bd54144b34 49/64: Cleanup: re-organize sections
Date: Thu, 7 Jul 2022 12:00:08 -0400 (EDT)

branch: elpa/hl-block-mode
commit bd54144b344ef5f81fab7565c1677e8d8e3f1693
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>

    Cleanup: re-organize sections
---
 hl-block-mode.el | 25 +++++++++++++++++++------
 1 file changed, 19 insertions(+), 6 deletions(-)

diff --git a/hl-block-mode.el b/hl-block-mode.el
index d6edeea26b..1ad5dad6f8 100644
--- a/hl-block-mode.el
+++ b/hl-block-mode.el
@@ -96,8 +96,9 @@ Useful for languages that use S-expressions to avoid overly 
nested highlighting.
 
 (defvar-local hl-block-overlay nil)
 
+
 ;; ---------------------------------------------------------------------------
-;; Internal Functions/Macros
+;; Internal Bracket Functions
 
 (defun hl-block--syntax-prev-bracket (pt)
   "A version of `syntax-ppss' to match curly braces.
@@ -155,11 +156,15 @@ The point will only ever be moved backward."
         (setq end (ignore-errors (scan-sexps beg 1)))))))
 
 
+;; ---------------------------------------------------------------------------
+;; Internal Color Tint (Draw Style)
+
 (defun hl-block--color-values-as-string (color)
   "Build a color from COLOR.
 Inverse of `color-values'."
   (format "#%02x%02x%02x" (ash (aref color 0) -8) (ash (aref color 1) -8) (ash 
(aref color 2) -8)))
 
+
 (defun hl-block--color-tint-add (a b tint)
   "Tint color lighter from A to B by TINT amount."
   (vector
@@ -167,6 +172,7 @@ Inverse of `color-values'."
     (+ (aref a 1) (* tint (aref b 1)))
     (+ (aref a 2) (* tint (aref b 2)))))
 
+
 (defun hl-block--color-tint-sub (a b tint)
   "Tint colors darker from A to B by TINT amount."
   (vector
@@ -174,11 +180,6 @@ Inverse of `color-values'."
     (- (aref a 1) (* tint (aref b 1)))
     (- (aref a 2) (* tint (aref b 2)))))
 
-(defun hl-block--overlay-clear ()
-  "Clear all overlays."
-  (mapc 'delete-overlay hl-block-overlay)
-  (setq hl-block-overlay nil))
-
 
 (defun hl-block--overlay-create-color-tint (block-list)
   "Update the overlays based on the cursor location.
@@ -222,6 +223,9 @@ Argument BLOCK-LIST represents start-end ranges of braces."
           (setq i (1+ i)))))))
 
 
+;; ---------------------------------------------------------------------------
+;; Internal Color Tint (Draw Style)
+
 (defun hl-block--overlay-create-bracket (block-list)
   "Update the overlays based on the cursor location.
 Argument BLOCK-LIST represents start-end ranges of braces."
@@ -238,6 +242,15 @@ Argument BLOCK-LIST represents start-end ranges of braces."
         (push elem-overlay-beg hl-block-overlay)))))
 
 
+;; ---------------------------------------------------------------------------
+;; Internal Refresh Function
+
+(defun hl-block--overlay-clear ()
+  "Clear all overlays."
+  (mapc 'delete-overlay hl-block-overlay)
+  (setq hl-block-overlay nil))
+
+
 (defun hl-block--overlay-refresh ()
   "Update the overlays based on the cursor location."
   (hl-block--overlay-clear)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]