]> git.eshelyaron.com Git - emacs.git/commitdiff
; Minor cleanup in re-builder after my last commit
authorStefan Kangas <stefan@marxist.se>
Fri, 3 Dec 2021 16:18:33 +0000 (17:18 +0100)
committerStefan Kangas <stefan@marxist.se>
Fri, 3 Dec 2021 16:18:33 +0000 (17:18 +0100)
* lisp/emacs-lisp/re-builder.el (reb-lisp-mode, reb-cook-regexp):
Very minor cleanup (by popular demand).

lisp/emacs-lisp/re-builder.el

index 8a87b5be27465b24643e22ba42543f045f92eac2..9be6ac649f3827f9d4c2fb8356f1e43bba04864c 100644 (file)
@@ -274,8 +274,8 @@ Except for Lisp syntax this is the same as `reb-regexp'.")
   emacs-lisp-mode "RE Builder Lisp"
   "Major mode for interactively building symbolic Regular Expressions."
   ;; Pull in packages as needed
-  (cond ((eq reb-re-syntax 'rx)            ; rx-to-string is autoloaded
-         (require 'rx)))                   ; require rx anyway
+  (when (eq reb-re-syntax 'rx)          ; rx-to-string is autoloaded
+    (require 'rx))                      ; require rx anyway
   (reb-mode-common))
 
 (defvar reb-subexp-mode-map
@@ -606,9 +606,9 @@ optional fourth argument FORCE is non-nil."
 
 (defun reb-cook-regexp (re)
   "Return RE after processing it according to `reb-re-syntax'."
-  (cond ((eq reb-re-syntax 'rx)
-        (rx-to-string (eval (car (read-from-string re)))))
-       (t re)))
+  (if (eq reb-re-syntax 'rx)
+      (rx-to-string (eval (car (read-from-string re))))
+    re))
 
 (defun reb-update-regexp ()
   "Update the regexp for the target buffer.