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

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

[elpa] externals/xr d7a6480 8/9: Translate [^\n] into nonl


From: Mattias Engdegård
Subject: [elpa] externals/xr d7a6480 8/9: Translate [^\n] into nonl
Date: Sat, 29 Feb 2020 17:22:13 -0500 (EST)

branch: externals/xr
commit d7a64801ad055bf4dadea226b4e1af38bf09bc47
Author: Mattias Engdegård <address@hidden>
Commit: Mattias Engdegård <address@hidden>

    Translate [^\n] into nonl
---
 xr-test.el | 2 ++
 xr.el      | 6 ++++++
 2 files changed, 8 insertions(+)

diff --git a/xr-test.el b/xr-test.el
index 1bebbfa..a0dae58 100644
--- a/xr-test.el
+++ b/xr-test.el
@@ -185,6 +185,8 @@
                  '(any "z-" digit)))
   (should (equal (xr "[A-[:digit:]]")
                  '(seq (any "A-[" ":dgit") "]")))
+  (should (equal (xr "[^\n]")
+                 'nonl))
   (should-error (xr "[[::]]"))
   (should-error (xr "[[:=:]]"))
   (should-error (xr "[[:letter:]]"))
diff --git a/xr.el b/xr.el
index d1f481d..945400e 100644
--- a/xr.el
+++ b/xr.el
@@ -255,6 +255,12 @@
           (if negated
               (list 'not (car classes))
             (car classes)))
+         ;; [^\n]: nonl.
+         ((and negated
+               (equal chars '(?\n))
+               (null ranges)
+               (null classes))
+          'nonl)
          ;; Anything else: produce (any ...)
          (t
           ;; Put dash last of all single characters.



reply via email to

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