emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/xr 1ed4caf4b5 6/7: Eliminate the empty string in sequen


From: ELPA Syncer
Subject: [elpa] externals/xr 1ed4caf4b5 6/7: Eliminate the empty string in sequences
Date: Sun, 29 Dec 2024 15:59:16 -0500 (EST)

branch: externals/xr
commit 1ed4caf4b5ffe9c8db9065c5fd1015567b36eab3
Author: Mattias EngdegÄrd <mattiase@acm.org>
Commit: Mattias EngdegÄrd <mattiase@acm.org>

    Eliminate the empty string in sequences
    
    Now we translate `.\(?:\)` to `nonl` instead of `(seq nonl "")`.
---
 xr-test.el | 2 ++
 xr.el      | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/xr-test.el b/xr-test.el
index bc2eeebfb9..07dd301674 100644
--- a/xr-test.el
+++ b/xr-test.el
@@ -96,6 +96,8 @@
                        symbol-start symbol-end eol)))
   (should (equal (xr-test--error (xr "\\_a"))
                  '(xr-parse-error "Invalid \\_ sequence" 0 2)))
+  (should (equal (xr "^\\(?:\\(?:\\)\\(?:\\)\\).$")
+                 '(seq bol nonl eol)))
   )
 
 (ert-deftest xr-syntax ()
diff --git a/xr.el b/xr.el
index b7846f789e..e834acaae6 100644
--- a/xr.el
+++ b/xr.el
@@ -390,7 +390,8 @@ adjacent strings. SEQUENCE is used destructively."
             (rest (cdr sequence)))
         (setq sequence
               (cond ((stringp elem)
-                     (push elem strings)
+                     (unless (equal elem "")
+                       (push elem strings))
                      rest)
                     ((eq (car-safe elem) 'seq)
                      (nconc (nreverse (cdr elem)) rest))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]