branch: elpa/symbol-overlay
commit 6971ab0c163f653e11de18c1c4c836021c9df4c0
Author: Steve Purcell <[email protected]>
Commit: Steve Purcell <[email protected]>
Declare minor mode earlier to avoid byte compilation warnings
---
symbol-overlay.el | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/symbol-overlay.el b/symbol-overlay.el
index e6b7716be2..534ae19238 100644
--- a/symbol-overlay.el
+++ b/symbol-overlay.el
@@ -117,6 +117,17 @@ You can add more colors whatever you like.")
"Idle time after every command and before the temporary highlighting."
:type 'float)
+;;;###autoload
+(define-minor-mode symbol-overlay-mode
+ "Minor mode for auto-highlighting symbol at point."
+ nil " SO" nil
+ (if symbol-overlay-mode
+ (progn
+ (add-hook 'post-command-hook 'symbol-overlay-post-command nil t)
+ (symbol-overlay-update-timer symbol-overlay-idle-time))
+ (remove-hook 'post-command-hook 'symbol-overlay-post-command t)
+ (symbol-overlay-remove-temp)))
+
(defun symbol-overlay-get-list (&optional symbol car-or-cdr exclude)
"Get all highlighted overlays in the buffer.
If SYMBOL is non-nil, get the overlays that belong to it.
@@ -233,17 +244,6 @@ This only effects symbols in the current displayed window."
(unless (string= (symbol-overlay-get-symbol nil t)
symbol-overlay-temp-symbol)
(symbol-overlay-remove-temp)))
-;;;###autoload
-(define-minor-mode symbol-overlay-mode
- "Minor mode for auto-highlighting symbol at point."
- nil " SO" nil
- (if symbol-overlay-mode
- (progn
- (add-hook 'post-command-hook 'symbol-overlay-post-command nil t)
- (symbol-overlay-update-timer symbol-overlay-idle-time))
- (remove-hook 'post-command-hook 'symbol-overlay-post-command t)
- (symbol-overlay-remove-temp)))
-
(defun symbol-overlay-put-one (symbol &optional color)
"Put overlay on current occurrence of SYMBOL after a match.
If COLOR is non-nil, use it as the overlay face's background color.