[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/hl-block-mode 0f1abe46d5 27/64: Apply auto-format
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/hl-block-mode 0f1abe46d5 27/64: Apply auto-format |
Date: |
Thu, 7 Jul 2022 12:00:06 -0400 (EDT) |
branch: elpa/hl-block-mode
commit 0f1abe46d552318a3aafa9ee4279b2ea6e48c462
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>
Apply auto-format
---
hl-block-mode.el | 50 ++++++++++++++++++++------------------------------
1 file changed, 20 insertions(+), 30 deletions(-)
diff --git a/hl-block-mode.el b/hl-block-mode.el
index 77611fb464..f1ba41329d 100644
--- a/hl-block-mode.el
+++ b/hl-block-mode.el
@@ -41,17 +41,17 @@
"Character to use as a starting bracket (defaults to '{').
Set to nil to use all brackets."
:group 'hl-block-mode
- :type 'symbol)
+ :type 'symbol)
(defcustom hl-block-delay 0.2
- "Idle time before highlighting."
+ "Idle time to wait before highlighting."
:group 'hl-block-mode
- :type 'float)
+ :type 'float)
(defcustom hl-block-color-tint "#040404"
"Color to add/subtract from the background each scope step."
:group 'hl-block-mode
- :type 'float)
+ :type 'float)
(defcustom hl-block-mode-lighter ""
"Lighter for hl-block-mode."
@@ -61,9 +61,7 @@ Set to nil to use all brackets."
(defun hl-block--syntax-prev-bracket (pt)
"A version of `syntax-ppss' to match curly braces.
PT is typically the '(point)'."
- (let
- (
- (start (ignore-errors (elt (syntax-ppss pt) 1))))
+ (let ((start (ignore-errors (elt (syntax-ppss pt) 1))))
(when start
(if (char-equal hl-block-bracket (char-after start))
start
@@ -79,9 +77,11 @@ PT is typically the '(point)'."
(hl-block--syntax-prev-bracket pt)
(ignore-errors (elt (syntax-ppss pt) 1))))
(end
- (when start (or (ignore-errors (scan-sexps start 1)) pt)))
+ (when start
+ (or (ignore-errors (scan-sexps start 1)) pt)))
(range-prev
- (when start (hl-block--find-all-ranges start))))
+ (when start
+ (hl-block--find-all-ranges start))))
(when start
(if range-prev
(cons (list start end) range-prev)
@@ -90,11 +90,7 @@ PT is typically the '(point)'."
(defun hl-block--color-values-as-string (r g b)
"Build a color from R G B.
Inverse of `color-values'."
- (format
- "#%02x%02x%02x"
- (ash r -8)
- (ash g -8)
- (ash b -8)))
+ (format "#%02x%02x%02x" (ash r -8) (ash g -8) (ash b -8)))
(defvar-local hl-block-overlay nil)
@@ -106,9 +102,7 @@ Inverse of `color-values'."
(defun hl-block--overlay-refresh ()
"Update the overlays based on the cursor location."
(hl-block--overlay-clear)
- (let
- (
- (block-list (save-excursion (hl-block--find-all-ranges (point)))))
+ (let ((block-list (save-excursion (hl-block--find-all-ranges (point)))))
(when block-list
(let*
(
@@ -135,14 +129,10 @@ Inverse of `color-values'."
(bg-color-blend
(apply 'hl-block--color-values-as-string
(if do-highlight
- (cl-mapcar '(lambda (a b) (+ a (* i-tint b)))
- bg-color bg-color-tint)
- (cl-mapcar '(lambda (a b) (- a (* i-tint b)))
- bg-color bg-color-tint)))))
- (overlay-put elem-overlay-start
- 'face `(:background ,bg-color-blend :extend t))
- (overlay-put elem-overlay-end
- 'face `(:background ,bg-color-blend :extend t))
+ (cl-mapcar '(lambda (a b) (+ a (* i-tint b))) bg-color
bg-color-tint)
+ (cl-mapcar '(lambda (a b) (- a (* i-tint b))) bg-color
bg-color-tint)))))
+ (overlay-put elem-overlay-start 'face `(:background
,bg-color-blend :extend t))
+ (overlay-put elem-overlay-end 'face `(:background
,bg-color-blend :extend t))
(add-to-list 'hl-block-overlay elem-overlay-start)
(add-to-list 'hl-block-overlay elem-overlay-end)
(setq start-prev start)
@@ -157,8 +147,7 @@ Inverse of `color-values'."
(when (timerp hl-block--delay-timer)
(cancel-timer hl-block--delay-timer))
(setq hl-block--delay-timer
- (run-with-idle-timer hl-block-delay t
- 'hl-block--overlay-refresh-from-timer)))
+ (run-with-idle-timer hl-block-delay t
'hl-block--overlay-refresh-from-timer)))
(defun hl-block-mode-enable ()
"Turn on 'hl-block-mode' for the current buffer."
@@ -176,6 +165,7 @@ Inverse of `color-values'."
"Highlight block under the cursor."
:global nil
:lighter hl-block-mode-lighter
+
(cond
(hl-block-mode
(jit-lock-unregister 'hl-block-mode-enable)
@@ -187,11 +177,11 @@ Inverse of `color-values'."
(defun hl-block--overlay-refresh-from-timer ()
"Ensure this mode has not been disabled before highlighting.
This can happen when switching buffers."
- (when hl-block-mode (hl-block--overlay-refresh)))
+ (when hl-block-mode
+ (hl-block--overlay-refresh)))
;;;###autoload
-(define-globalized-minor-mode global-hl-block-mode hl-block-mode
- hl-block-mode-turn-on)
+(define-globalized-minor-mode global-hl-block-mode hl-block-mode
hl-block-mode-turn-on)
;;;###autoload
(defun hl-block-mode-turn-on ()
- [nongnu] elpa/hl-block-mode 82f42045c1 31/64: Enable lexical binding, (continued)
- [nongnu] elpa/hl-block-mode 82f42045c1 31/64: Enable lexical binding, ELPA Syncer, 2022/07/07
- [nongnu] elpa/hl-block-mode dc5b0153bb 35/64: Cleanup: byte-code compilation warnings, ELPA Syncer, 2022/07/07
- [nongnu] elpa/hl-block-mode 4e28df960d 40/64: Remove local variables when disabling the mode, ELPA Syncer, 2022/07/07
- [nongnu] elpa/hl-block-mode d47c372b06 03/64: Update readme.rst, ELPA Syncer, 2022/07/07
- [nongnu] elpa/hl-block-mode f763fff94e 09/64: Follow lisp and emacs-lisp conventions, ELPA Syncer, 2022/07/07
- [nongnu] elpa/hl-block-mode b98c83d8cb 14/64: Add global-hl-block-mode, ELPA Syncer, 2022/07/07
- [nongnu] elpa/hl-block-mode 326e026b66 13/64: Use character literal for '{', ELPA Syncer, 2022/07/07
- [nongnu] elpa/hl-block-mode 9f39593c4f 19/64: make hl-bock-mode lighter customizable, ELPA Syncer, 2022/07/07
- [nongnu] elpa/hl-block-mode 00914d2938 22/64: Reduce default delay to 200ms, ELPA Syncer, 2022/07/07
- [nongnu] elpa/hl-block-mode 74b5a89360 23/64: FIx typo, ELPA Syncer, 2022/07/07
- [nongnu] elpa/hl-block-mode 0f1abe46d5 27/64: Apply auto-format,
ELPA Syncer <=
- [nongnu] elpa/hl-block-mode 59cdbd4d27 39/64: Use "push" instead of add-to-list, ELPA Syncer, 2022/07/07
- [nongnu] elpa/hl-block-mode 0ea43d3202 34/64: Cleanup: disable auto-load for internal function, ELPA Syncer, 2022/07/07
- [nongnu] elpa/hl-block-mode 27e3ab4195 42/64: Cleanup: minor naming changes, ELPA Syncer, 2022/07/07
- [nongnu] elpa/hl-block-mode 59458a4b2b 54/64: Initialize brackets from the syntax table, ELPA Syncer, 2022/07/07
- [nongnu] elpa/hl-block-mode 81c692d654 55/64: Cleanup: define a group with defgroup, ELPA Syncer, 2022/07/07
- [nongnu] elpa/hl-block-mode a165ce51fb 56/64: Fix bracket draw style highlighting point-min/max, ELPA Syncer, 2022/07/07
- [nongnu] elpa/hl-block-mode 5f532fef33 12/64: Cleanup: indentation, ELPA Syncer, 2022/07/07
- [nongnu] elpa/hl-block-mode 6a8f871d7a 28/64: Add .elisp-autofmt to enable auto-formatting, ELPA Syncer, 2022/07/07
- [nongnu] elpa/hl-block-mode c85c9335f7 07/64: Cleanup: warnings, docs, ELPA Syncer, 2022/07/07
- [nongnu] elpa/hl-block-mode 6dc75e71b0 29/64: Fix global-hl-block-mode activating with the minibuffer, ELPA Syncer, 2022/07/07