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

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

[elpa] externals/xr 7ba1fc6: * xr.el: Fix compilation and use valid emai


From: Stefan Monnier
Subject: [elpa] externals/xr 7ba1fc6: * xr.el: Fix compilation and use valid email address
Date: Tue, 5 Feb 2019 11:10:16 -0500 (EST)

branch: externals/xr
commit 7ba1fc646d5a37ab982ac06cbceb207b9899a9b0
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>

    * xr.el: Fix compilation and use valid email address
    
    Call `provide` before running the tests, and call `require` so we don't
    fail during compilation.
---
 xr.el | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/xr.el b/xr.el
index 3c8e3d3..199f0e3 100644
--- a/xr.el
+++ b/xr.el
@@ -2,7 +2,7 @@
 
 ;; Copyright (C) 2019 Free Software Foundation, Inc.
 
-;; Author: Mattias EngdegÄrd <mattiase at acm dot org>
+;; Author: Mattias EngdegÄrd <address@hidden>
 ;; Version: 1.0
 ;; Keywords: lisp, maint, regexps
 
@@ -50,6 +50,10 @@
 ;; maximum readability, consistency and personal preference when
 ;; replacing existing regexps in elisp code.
 
+;; Similar functionality is provided by the `lex' package in the form of the
+;; `lex-parse-re' function, but `xr' does not depend on `lex' and does
+;; a more thorough job of handling all corner cases of Elisp's regexp syntax.
+
 ;;; Code:
 
 (require 'rx)
@@ -500,7 +504,18 @@ Returns nil."
   "Verify (xr--pp-rx-to-str RX) against EXPECTED-STR."
   (xr--expect-result 'xr--pp-rx-to-str rx expected-str))
 
+(provide 'xr)
+
 (eval-when-compile
+  ;; FIXME: When byte-compiling the file, this `eval-when-compile' block
+  ;; will be executed at a time where the above functions have been compiled
+  ;; but they're not necessarily known by the current Emacs session yet
+  ;; (because the neither `xr.el' nor `xr.elc' has been loaded yet).
+  ;; As a quick fix, we (require 'xr) here to load the `xr' file (and fail
+  ;; silently if the file is not in `load-path').
+  ;; Maybe a better fix is to move those tests to a separate file, and/or
+  ;; to wrap them in an `ert-deftest'.
+  (when (require 'xr nil 'noerror)
   (xr--expect "a\\$b\\\\c\\[\\]\\q"
               "a$b\\c[]q")
   (xr--expect "\\(?:ab\\|c*d\\)?"
@@ -660,8 +675,6 @@ Returns nil."
                  "(?? nonl)\n")
   (xr--expect-pp '(repeat 1 63 "a")
                  "(repeat 1 63 \"a\")\n")
-  )
-
-(provide 'xr)
+  ))
 
 ;;; xr.el ends here



reply via email to

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