[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-numbers 6483ab668b 103/145: Cleanup: use '?' instead
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-numbers 6483ab668b 103/145: Cleanup: use '?' instead of '*' for matching sign |
Date: |
Thu, 6 Jan 2022 03:00:22 -0500 (EST) |
branch: elpa/evil-numbers
commit 6483ab668be769aaf84a81767f9186b7cda5c60c
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>
Cleanup: use '?' instead of '*' for matching sign
While the difference isn't significant in this case,
matching a single character as whats intended.
---
evil-numbers.el | 71 ++++++++++++++++++++++++++++++++++-----------------------
1 file changed, 42 insertions(+), 29 deletions(-)
diff --git a/evil-numbers.el b/evil-numbers.el
index d69752e158..3e1118792e 100644
--- a/evil-numbers.el
+++ b/evil-numbers.el
@@ -142,10 +142,10 @@ Return non-nil on success, leaving the point at the end
of the number."
;; Find binary literals.
((evil-numbers--search-and-replace
- '(("+-" . *)
- ("0" . 1)
- ("bB" . 1)
- ("01" . +))
+ '(("+-" . \?)
+ ("0" . 1)
+ ("bB" . 1)
+ ("01" . +))
1 ;; Sign group.
4 ;; Number group.
amount 2 padded
@@ -154,10 +154,10 @@ Return non-nil on success, leaving the point at the end
of the number."
;; Find octal literals.
((evil-numbers--search-and-replace
- '(("+-" . *)
- ("0" . 1)
- ("oO" . 1)
- ("0-7" . +))
+ '(("+-" . \?)
+ ("0" . 1)
+ ("oO" . 1)
+ ("0-7" . +))
1 ;; Sign group.
4 ;; Number group.
amount 8 padded
@@ -166,10 +166,10 @@ Return non-nil on success, leaving the point at the end
of the number."
;; Find hex literals.
((evil-numbers--search-and-replace
- '(("+-" . *)
- ("0" . 1)
- ("xX" . 1)
- ("[:xdigit:]" . +))
+ '(("+-" . \?)
+ ("0" . 1)
+ ("xX" . 1)
+ ("[:xdigit:]" . +))
1 ;; Sign group.
4 ;; Number group.
amount 16 padded
@@ -178,8 +178,8 @@ Return non-nil on success, leaving the point at the end of
the number."
;; Find decimal literals.
((evil-numbers--search-and-replace
- '(("+-" . *)
- ("0123456789" . +))
+ '(("+-" . \?)
+ ("0123456789" . +))
1 ;; Sign group.
2 ;; Number group.
amount 10 padded
@@ -188,8 +188,8 @@ Return non-nil on success, leaving the point at the end of
the number."
;; Find decimal literals (super-script).
((evil-numbers--search-and-replace
- '(("⁺⁻" . *)
- ("⁰¹²³⁴⁵⁶⁷⁸⁹" . +))
+ '(("⁺⁻" . \?)
+ ("⁰¹²³⁴⁵⁶⁷⁸⁹" . +))
1 ;; Sign group.
2 ;; Number group.
amount 10 padded
@@ -199,8 +199,8 @@ Return non-nil on success, leaving the point at the end of
the number."
;; Find decimal literals (sub-script).
((evil-numbers--search-and-replace
- '(("₊₋" . *)
- ("₀₁₂₃₄₅₆₇₈₉" . +))
+ '(("₊₋" . \?)
+ ("₀₁₂₃₄₅₆₇₈₉" . +))
1 ;; Sign group.
2 ;; Number group.
amount 10 padded
@@ -392,22 +392,35 @@ Each item in SKIP-CHARS is a cons pair.
(cond
((integerp ch-num)
- (let ((skipped (funcall
- skip-chars-fn
- ch-skip
- (funcall
- clamp-fn
- (+ (point) (* ch-num dir)) limit))))
+ (let ((skipped
+ (funcall
+ skip-chars-fn
+ ch-skip
+ (funcall clamp-fn (+ (point) (* ch-num dir)) limit))))
(when do-check
(unless (eq skipped ch-num)
(throw 'result nil)))))
- ((memq ch-num (list '+ '*))
- (let ((skipped (funcall
- skip-chars-fn
- ch-skip limit)))
+ ((eq ch-num '+)
+ (let ((skipped
+ (funcall
+ skip-chars-fn
+ ch-skip limit)))
(when do-check
- (unless (>= skipped (if (eq ch-num '+) 1 0))
+ (unless (>= skipped 1)
(throw 'result nil)))))
+
+ ;; No length checking needed as zero is acceptable.
+ ;; Skip these characters if they exist.
+ ((eq ch-num '*)
+ (funcall
+ skip-chars-fn
+ ch-skip
+ limit))
+ ((eq ch-num '\?)
+ (funcall
+ skip-chars-fn
+ ch-skip
+ (funcall clamp-fn (+ (point) dir) limit)))
(t
(error (format "Unknown type %S" ch-skip))))
- [nongnu] elpa/evil-numbers 02de70f481 062/145: Quiet checkdoc warnings, (continued)
- [nongnu] elpa/evil-numbers 02de70f481 062/145: Quiet checkdoc warnings, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers 6fa8e02e3b 073/145: Cleanup: avoid right shift, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers 963e78cb44 069/145: Change repo URLs in Readme too, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers 26ec2d4a52 066/145: Use lexical binding, remove unused function 'pad', ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers a75c4b0a24 071/145: Cleanup: replace tabs with spaces, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers 626ea72a21 084/145: Cleanup: add missing argument to doc-string, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers 15dcea1be0 087/145: Fix #20 The cursor moves when increment/decrement fails, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers 5622da311d 070/145: Cleanup: spelling, use full sentences, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers ab6d436454 074/145: Cleanup: use '--' separator for private functions, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers ff3bcf4efd 068/145: Change repo URLs, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers 6483ab668b 103/145: Cleanup: use '?' instead of '*' for matching sign,
ELPA Syncer <=
- [nongnu] elpa/evil-numbers 43036127c1 105/145: Cleanup: line length < 80, spelling, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers 0bbf3a8161 109/145: Cleanup: store unicode subscript/superscript in constants, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers d09a0e676a 125/145: Fix #25 increment steps to the next line, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers 08f0c1ee93 145/145: Cleanup: warnings for tests, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers e1b60f3b75 133/145: Fix #27 Number directly before the cursor manipulated in some cases, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers 3bd94723f8 134/145: Cleanup: indentation, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers 0d66b63f42 116/145: CHANGELOG.org: update with recent fixes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers 1acf90638b 128/145: Bump to 0.6, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers c39f8f1c19 122/145: Cleanup: auto-indent the changelog, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers ef72a4fea1 135/145: Cleanup: correct doc-strings, ELPA Syncer, 2022/01/06