[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/idle-highlight-mode a801e7113f 43/59: Remove 'idle-highlig
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/idle-highlight-mode a801e7113f 43/59: Remove 'idle-highlight-use-hi-lock-mode' |
Date: |
Thu, 7 Jul 2022 12:00:32 -0400 (EDT) |
branch: elpa/idle-highlight-mode
commit a801e7113fa6b43a29ac380b91c21784ba55d457
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>
Remove 'idle-highlight-use-hi-lock-mode'
Always use overlays.
---
idle-highlight-mode.el | 75 ++++++++++++++++++++------------------------------
1 file changed, 30 insertions(+), 45 deletions(-)
diff --git a/idle-highlight-mode.el b/idle-highlight-mode.el
index 64b693f6b0..3d86713e33 100755
--- a/idle-highlight-mode.el
+++ b/idle-highlight-mode.el
@@ -93,9 +93,6 @@
:type '(repeat symbol)
:group 'idle-highlight)
-(defvar idle-highlight-use-hi-lock-mode nil
- "Use `hi-lock-mode' option, otherwise use a local list of overlays.")
-
(defvar-local global-idle-highlight-ignore-buffer nil
"When non-nil, the global mode will not be enabled for this buffer.
This variable can also be a predicate function, in which case
@@ -106,7 +103,6 @@ check this buffer.")
;; ---------------------------------------------------------------------------
;; Internal Variables
-(defvar-local idle-highlight--regexp nil "Buffer-local regexp to be
idle-highlighted.")
(defvar-local idle-highlight--overlays nil "Buffer-local list of overlays.")
;; ---------------------------------------------------------------------------
@@ -148,50 +144,40 @@ Argument POS return faces at this point."
(defun idle-highlight--unhighlight ()
"Clear current highlight."
- (cond
- (idle-highlight-use-hi-lock-mode
- (when idle-highlight--regexp
- (unhighlight-regexp idle-highlight--regexp)
- (setq idle-highlight--regexp nil)))
- (t
- (when idle-highlight--overlays
- (mapc 'delete-overlay idle-highlight--overlays)
- (setq idle-highlight--overlays nil)))))
+ (when idle-highlight--overlays
+ (mapc 'delete-overlay idle-highlight--overlays)
+ (setq idle-highlight--overlays nil)))
(defsubst idle-highlight--highlight (target beg end)
"Highlight TARGET found between BEG and END.h."
(idle-highlight--unhighlight)
- (setq idle-highlight--regexp (concat "\\<" (regexp-quote target) "\\>"))
- (cond
- (idle-highlight-use-hi-lock-mode
- (highlight-regexp idle-highlight--regexp 'idle-highlight))
- (t
- (save-excursion
- (let
- (
- (beg-ex
- (progn
- (goto-char (max (point-min) (min beg (window-start))))
- (beginning-of-line)
- (point)))
- (end-ex
- (progn
- (goto-char (min (point-max) (max end (window-end))))
- (beginning-of-line)
- (end-of-line)
- (point))))
- (dolist
- (range
- (cond
- (idle-highlight-exclude-point
- (list (cons beg-ex beg) (cons end end-ex)))
- (t
- (list (cons beg-ex end-ex)))))
- (goto-char (car range))
- (while (re-search-forward idle-highlight--regexp (cdr range) t)
- (let ((ov (make-overlay (match-beginning 0) (match-end 0))))
- (overlay-put ov 'face 'idle-highlight)
- (push ov idle-highlight--overlays)))))))))
+ (save-excursion
+ (let
+ (
+ (target-regexp (concat "\\<" (regexp-quote target) "\\>"))
+ (beg-ex
+ (progn
+ (goto-char (max (point-min) (min beg (window-start))))
+ (beginning-of-line)
+ (point)))
+ (end-ex
+ (progn
+ (goto-char (min (point-max) (max end (window-end))))
+ (beginning-of-line)
+ (end-of-line)
+ (point))))
+ (dolist
+ (range
+ (cond
+ (idle-highlight-exclude-point
+ (list (cons beg-ex beg) (cons end end-ex)))
+ (t
+ (list (cons beg-ex end-ex)))))
+ (goto-char (car range))
+ (while (re-search-forward target-regexp (cdr range) t)
+ (let ((ov (make-overlay (match-beginning 0) (match-end 0))))
+ (overlay-put ov 'face 'idle-highlight)
+ (push ov idle-highlight--overlays)))))))
(defun idle-highlight--word-at-point ()
"Highlight the word under the point."
@@ -324,7 +310,6 @@ Argument POS return faces at this point."
"Disable the buffer local minor mode."
(idle-highlight--time-buffer-local-disable)
(idle-highlight--unhighlight)
- (kill-local-variable 'idle-highlight--regexp)
(kill-local-variable 'idle-highlight--overlays))
(defun idle-highlight--turn-on ()
- [nongnu] elpa/idle-highlight-mode 53b4e3c855 45/59: Add option idle-highlight-exceptions-syntax, (continued)
- [nongnu] elpa/idle-highlight-mode 53b4e3c855 45/59: Add option idle-highlight-exceptions-syntax, ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode 459720cd2e 29/59: Add `global-idle-highlight-mode` (globalized minor mode), ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode defcfe2756 54/59: Fix #1 face exceptions interact badly with hl-line-mode, ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode 1f40f80921 30/59: Remove "end" from idle-highlight-exceptions, ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode 305e9d4aa0 26/59: Cleanup: remove intermediate symbol type variable, ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode eaac86a1a2 49/59: Add idle-highlight-visible-buffers to apply to all buffers, ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode 7f81263388 11/59: Add configurations for excepted words and what idle time to use., ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode 7c43cc3d7a 09/59: [Refactor] Lose some weight., ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode 3d785f0f1d 44/59: Support *-exceptions & *-exceptions-face to be callback functions, ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode e8f724fec2 35/59: Use a local list of overlays for highlighting, ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode a801e7113f 43/59: Remove 'idle-highlight-use-hi-lock-mode',
ELPA Syncer <=
- [nongnu] elpa/idle-highlight-mode 97047f2574 33/59: Add Campbell Barton as an author, ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode 98d20252d6 42/59: readme: add "Motivation" & "Other Packages" section, ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode d0fcf29c7d 46/59: Cleanup: unnecessary pcase-let* use, ELPA Syncer, 2022/07/07