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

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

[nongnu] elpa/hl-block-mode 0ea43d3202 34/64: Cleanup: disable auto-load


From: ELPA Syncer
Subject: [nongnu] elpa/hl-block-mode 0ea43d3202 34/64: Cleanup: disable auto-load for internal function
Date: Thu, 7 Jul 2022 12:00:07 -0400 (EDT)

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

    Cleanup: disable auto-load for internal function
---
 hl-block-mode.el | 27 +++++++++++++--------------
 1 file changed, 13 insertions(+), 14 deletions(-)

diff --git a/hl-block-mode.el b/hl-block-mode.el
index ba5a060d95..0c61fd2236 100644
--- a/hl-block-mode.el
+++ b/hl-block-mode.el
@@ -142,6 +142,12 @@ Inverse of `color-values'."
 ;; Timer
 (defvar hl-block--delay-timer nil)
 
+(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)))
+
 (defun hl-block--overlay-delay ()
   "Recalculate overlays using a delay (to avoid slow-down)."
   (when (timerp hl-block--delay-timer)
@@ -160,6 +166,11 @@ Inverse of `color-values'."
     (cancel-timer hl-block--delay-timer))
   (remove-hook 'post-command-hook #'hl-block--overlay-delay t))
 
+(defun hl-block-mode-turn-on ()
+  "Enable command `hl-block-mode'."
+  (when (and (not (minibufferp)) (not hl-block-mode))
+    (hl-block-mode 1)))
+
 ;;;###autoload
 (define-minor-mode hl-block-mode
   "Highlight block under the cursor."
@@ -175,24 +186,12 @@ Inverse of `color-values'."
       (jit-lock-unregister 'hl-block-mode-enable)
       (hl-block-mode-disable))))
 
-(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)))
-
 ;;;###autoload
 (define-globalized-minor-mode
   global-hl-block-mode
-  hl-block-mode
-  hl-block-mode-turn-on
-  :group 'hl-block-mode)
 
-;;;###autoload
-(defun hl-block-mode-turn-on ()
-  "Enable command `hl-block-mode'."
-  (when (and (not (minibufferp)) (not hl-block-mode))
-    (hl-block-mode 1)))
+  hl-block-mode hl-block-mode-turn-on
+  :group 'hl-block-mode)
 
 (provide 'hl-block-mode)
 ;; Local Variables:



reply via email to

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