[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/spell-fu 866044304f 50/86: Check if faces can be used on p
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/spell-fu 866044304f 50/86: Check if faces can be used on property change |
Date: |
Thu, 7 Jul 2022 12:03:42 -0400 (EDT) |
branch: elpa/spell-fu
commit 866044304fc8f00a1f66a3afa09ca6811f10141c
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>
Check if faces can be used on property change
No need to check the faces for each word as the face property
is already being stepped over.
---
spell-fu.el | 45 +++++++++++++++++++++++++++++----------------
1 file changed, 29 insertions(+), 16 deletions(-)
diff --git a/spell-fu.el b/spell-fu.el
index da1c2d6006..93986cac3d 100644
--- a/spell-fu.el
+++ b/spell-fu.el
@@ -300,6 +300,14 @@ Argument POS return faces at this point."
(push face faces)))))
faces))
+(defun spell-fu--next-faces-prop-change (pos limit)
+ "Return the next face change from POS restricted by LIMIT."
+ (next-single-property-change
+ pos
+ 'read-face-name
+ nil
+ (next-single-property-change pos 'face nil limit)))
+
(defun spell-fu--file-is-older-list (file-test file-list)
"Return t when FILE-TEST is older than any files in FILE-LIST."
(catch 'result
@@ -599,25 +607,30 @@ Argument FACES-EXCLUDE faces to check POS excludes or
ignored when nil."
;; In practice this is likely caused by escape characters, e.g.
;; "test\nthe text" where "\n" may have separate highlighting.
(while (< point-start point-end)
- (let ((point-end-iter (next-single-property-change point-start
'face nil point-end)))
- ;; Use narrowing so the regex correctly handles boundaries
- ;; that happen to fall on face changes.
- (narrow-to-region point-start point-end-iter)
- (goto-char point-start)
- (while (re-search-forward spell-fu-word-regexp point-end-iter t)
- (let
- (
- (word-start (match-beginning 0))
- (word-end (match-end 0)))
- (when
- (spell-fu--check-faces-at-point
- word-start
- spell-fu-faces-include
- spell-fu-faces-exclude)
+ (let ((point-end-iter (spell-fu--next-faces-prop-change
point-start point-end)))
+ ;; No need to check faces of each word
+ ;; as face-changes are being stepped over.
+ (when
+ (spell-fu--check-faces-at-point
+ point-start
+ spell-fu-faces-include
+ spell-fu-faces-exclude)
+
+ ;; Use narrowing so the regex correctly handles boundaries
+ ;; that happen to fall on face changes.
+ (narrow-to-region point-start point-end-iter)
+ (goto-char point-start)
+ (while (re-search-forward spell-fu-word-regexp point-end-iter
t)
+ (let
+ (
+ (word-start (match-beginning 0))
+ (word-end (match-end 0)))
(spell-fu-check-word
word-start
word-end
- (buffer-substring-no-properties word-start word-end)))))
+ (buffer-substring-no-properties word-start word-end))))
+ (widen))
+
(setq point-start point-end-iter))))))))
(defun spell-fu--check-range-without-faces (point-start point-end)
- [nongnu] branch elpa/spell-fu created (now cbe5cd84c3), ELPA Syncer, 2022/07/07
- [nongnu] elpa/spell-fu eeda8ef28e 06/86: Cleanup: minor non-functional changes, ELPA Syncer, 2022/07/07
- [nongnu] elpa/spell-fu 676498f757 13/86: Support buffer local dictionaries, ELPA Syncer, 2022/07/07
- [nongnu] elpa/spell-fu 073932be78 16/86: Cleanup: replace '(nth 5 ...' with file-attribute-modification-time, ELPA Syncer, 2022/07/07
- [nongnu] elpa/spell-fu 2c792330ac 18/86: Case insensitive sort lines as a list (not in the buffer), ELPA Syncer, 2022/07/07
- [nongnu] elpa/spell-fu 03114080c8 20/86: Add requirements at the top of the file, ELPA Syncer, 2022/07/07
- [nongnu] elpa/spell-fu fe557e3dff 21/86: Be explicit about using macro that sets values in-place, ELPA Syncer, 2022/07/07
- [nongnu] elpa/spell-fu 33a28e0df5 41/86: fix: encode word to utf-8 generating the cache, ELPA Syncer, 2022/07/07
- [nongnu] elpa/spell-fu 7770c005c4 47/86: Cleanup minor name change for spell-fu function name, ELPA Syncer, 2022/07/07
- [nongnu] elpa/spell-fu 866044304f 50/86: Check if faces can be used on property change,
ELPA Syncer <=
- [nongnu] elpa/spell-fu 8f780a874c 66/86: Reduce idle overlay fragmentation, ELPA Syncer, 2022/07/07
- [nongnu] elpa/spell-fu 4fc84a9028 69/86: Fix spell-fu-directory's documentation, ELPA Syncer, 2022/07/07
- [nongnu] elpa/spell-fu 53bd2b24c6 81/86: Cleanup: add spell-fu--canonicalize-word utility function, ELPA Syncer, 2022/07/07
- [nongnu] elpa/spell-fu a5a06e150a 02/86: Fix error comparing times of cache to word-list, ELPA Syncer, 2022/07/07
- [nongnu] elpa/spell-fu bd00417a0e 09/86: Improve status messages when generating word-list & cache, ELPA Syncer, 2022/07/07
- [nongnu] elpa/spell-fu afeb1fd46f 10/86: readme: add some TODO's, ELPA Syncer, 2022/07/07
- [nongnu] elpa/spell-fu b7e5cf3d73 11/86: Fix missing checks that ispell variables are bound before use, ELPA Syncer, 2022/07/07
- [nongnu] elpa/spell-fu 30be3683b2 12/86: readme: update settings docs, ELPA Syncer, 2022/07/07
- [nongnu] elpa/spell-fu 18724c2e53 14/86: Avoid potentially accessing the same files time multiple times, ELPA Syncer, 2022/07/07
- [nongnu] elpa/spell-fu 8e8711f1fa 22/86: Add TODO's to the readme, ELPA Syncer, 2022/07/07