[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/xr 548990e952 04/18: Simplify: make second arg to xr--e
From: |
ELPA Syncer |
Subject: |
[elpa] externals/xr 548990e952 04/18: Simplify: make second arg to xr--escape-string optional |
Date: |
Thu, 1 Aug 2024 13:00:00 -0400 (EDT) |
branch: externals/xr
commit 548990e9523a2c3d9adcfa0b89f6ecbd263b4771
Author: Mattias EngdegÄrd <mattiase@acm.org>
Commit: Mattias EngdegÄrd <mattiase@acm.org>
Simplify: make second arg to xr--escape-string optional
---
xr.el | 34 +++++++++++++---------------------
1 file changed, 13 insertions(+), 21 deletions(-)
diff --git a/xr.el b/xr.el
index 2f3b68550d..e1843a941f 100644
--- a/xr.el
+++ b/xr.el
@@ -98,8 +98,7 @@
warnings (point)
(xr--escape-string
(format-message "Reversed range `%c-%c' matches nothing"
- start end)
- nil))))
+ start end)))))
(cond
;; Suppress warnings about ranges between adjacent digits,
;; like [0-1], as they are common and harmless.
@@ -107,8 +106,7 @@
(xr--report warnings (point)
(xr--escape-string
(format-message "Two-character range `%c-%c'"
- start end)
- nil)))
+ start end))))
;; This warning is not necessarily free of false positives,
;; although they are unlikely. Maybe it should be off by default?
((and (<= ?A start ?Z) (<= ?a end ?z))
@@ -126,8 +124,7 @@
(xr--escape-string
(format-message
"Suspect character range `%c-%c': should `-' be literal?"
- start end)
- nil))))
+ start end)))))
(forward-char 3)))
;; single character (including ], ^ and -)
@@ -215,7 +212,7 @@
(aref this 0) this-end
(aref next 0) (aref next 1)))))))
(xr--report warnings (max (aref this 2) (aref next 2))
- (xr--escape-string message nil))
+ (xr--escape-string message))
(setcdr s (cddr s)))
;; No overlap.
(setq s (cdr s)))))
@@ -363,7 +360,7 @@ adjacent strings. SEQUENCE is used destructively."
(?! . comment-delimiter)))))
(when (not sym)
(error "Unknown syntax code `%s'"
- (xr--escape-string (char-to-string syntax-code) nil)))
+ (xr--escape-string (char-to-string syntax-code))))
(let ((item (list 'syntax (cdr sym))))
(if negated (list 'not item) item))))
@@ -822,7 +819,7 @@ like (* (* X) ... (* X))."
(xr--report warnings item-start
(format-message "Escaped non-special character `%s'"
(xr--escape-string
- (char-to-string next-char)
nil)))))))
+ (char-to-string next-char))))))))
;; nonspecial character
(t
@@ -1596,14 +1593,12 @@ A-SETS and B-SETS are arguments to `any'."
(not (memq start '(?^ ?- ?\\))))
(xr--report warnings (point)
(xr--escape-string
- (format-message "Unnecessarily escaped `%c'" start)
- nil)))
+ (format-message "Unnecessarily escaped `%c'" start))))
(when (and (match-beginning 3)
(not (memq end '(?^ ?- ?\\))))
(xr--report warnings (1- (match-beginning 3))
(xr--escape-string
- (format-message "Unnecessarily escaped `%c'" end)
- nil)))
+ (format-message "Unnecessarily escaped `%c'" end))))
(when (and (eq start ?-)
(not end)
(match-beginning 2)
@@ -1613,21 +1608,18 @@ A-SETS and B-SETS are arguments to `any'."
(if (and end (> start end))
(xr--report warnings (point)
(xr--escape-string
- (format-message "Reversed range `%c-%c'" start end)
- nil))
+ (format-message "Reversed range `%c-%c'" start
end)))
(cond
((eq start end)
(xr--report warnings (point)
(xr--escape-string
(format-message "Single-element range `%c-%c'"
- start end)
- nil)))
+ start end))))
((eq (1+ start) end)
(xr--report warnings (point)
(xr--escape-string
(format-message "Two-element range `%c-%c'"
- start end)
- nil))))
+ start end)))))
(cond
((not end)
(push (vector start start (point)) intervals))
@@ -1692,7 +1684,7 @@ A-SETS and B-SETS are arguments to `any'."
(aref this 0) this-end
(aref next 0) (aref next 1)))))))
(xr--report warnings (max (aref this 2) (aref next 2))
- (xr--escape-string message nil))
+ (xr--escape-string message))
(setcdr s (cddr s)))
;; No overlap.
(setq s (cdr s)))))
@@ -1853,7 +1845,7 @@ in SKIP-SET-STRING."
(xr--parse-skip-set skip-set-string warnings)
(sort (car warnings) #'car-less-than-car)))
-(defun xr--escape-string (string escape-printable)
+(defun xr--escape-string (string &optional escape-printable)
"Escape non-printing characters in a string for maximum readability.
If ESCAPE-PRINTABLE, also escape \\ and \", otherwise don't."
(replace-regexp-in-string
- [elpa] externals/xr updated (71c748ed7c -> c5da86864b), ELPA Syncer, 2024/08/01
- [elpa] externals/xr 6f42ebafef 02/18: Copyright year update, ELPA Syncer, 2024/08/01
- [elpa] externals/xr d81c7e05a0 07/18: Parse the regexp string directly instead of creating a temp buffer, ELPA Syncer, 2024/08/01
- [elpa] externals/xr a3d8350cf7 09/18: Include parse errors in the diagnostics when linting, ELPA Syncer, 2024/08/01
- [elpa] externals/xr b07de9bc2c 05/18: Faster joining of chars to strings, ELPA Syncer, 2024/08/01
- [elpa] externals/xr 90cd77a251 11/18: Use ranges in warnings, ELPA Syncer, 2024/08/01
- [elpa] externals/xr f81b5de888 12/18: Extract diagnostics sorting to a function, ELPA Syncer, 2024/08/01
- [elpa] externals/xr 345b626abf 17/18: NEWS entry for upcoming version 2.0, ELPA Syncer, 2024/08/01
- [elpa] externals/xr ab11e4229d 03/18: Move version history to separate NEWS file, ELPA Syncer, 2024/08/01
- [elpa] externals/xr cbb39a2f52 06/18: Performance hack: speed up xr--superset-p for strings, ELPA Syncer, 2024/08/01
- [elpa] externals/xr 548990e952 04/18: Simplify: make second arg to xr--escape-string optional,
ELPA Syncer <=
- [elpa] externals/xr ee9870ea83 08/18: Signal new `xr-parse-error` for parsing errors, ELPA Syncer, 2024/08/01
- [elpa] externals/xr a003438b44 01/18: Check xr-lint `purpose` argument for validity., ELPA Syncer, 2024/08/01
- [elpa] externals/xr 14b639fc1e 10/18: Diagnostics now carry a range, not a single string offset, ELPA Syncer, 2024/08/01
- [elpa] externals/xr 6a708ef75a 14/18: Group diagnostics that belong together, ELPA Syncer, 2024/08/01
- [elpa] externals/xr e2455fd4bd 15/18: Add info-level messages for many warnings, ELPA Syncer, 2024/08/01
- [elpa] externals/xr 51c053d443 16/18: Require Emacs 27 or newer, ELPA Syncer, 2024/08/01
- [elpa] externals/xr 817916a07b 13/18: Add severity field (warning or error) to diagnostics, ELPA Syncer, 2024/08/01
- [elpa] externals/xr c5da86864b 18/18: Github CI: ignore changes to NEWS in actions, ELPA Syncer, 2024/08/01