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

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

[elpa] externals/objed 4d0503c 067/166: Allow using rx for regex objects


From: Clemens Radermacher
Subject: [elpa] externals/objed 4d0503c 067/166: Allow using rx for regex objects, too
Date: Sun, 29 Dec 2019 08:21:02 -0500 (EST)

branch: externals/objed
commit 4d0503c4ca4a45fbf2f510366da562b0fb749162
Author: Clemens Radermacher <address@hidden>
Commit: Clemens Radermacher <address@hidden>

    Allow using rx for regex objects, too
---
 objed-objects.el | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/objed-objects.el b/objed-objects.el
index 78fe8af..561386d 100644
--- a/objed-objects.el
+++ b/objed-objects.el
@@ -68,6 +68,7 @@
 
 
 (eval-and-compile
+  (require 'rx)
   (defun objed--get-regex-object (bregex eregex)
   "Return regex object if point is within region limited by BREGEX, EREGEX.
 
@@ -165,6 +166,7 @@ in it's first regex group is considered to be part of the 
inner object."
            (t
             (user-error "Malformed macro"))))
 
+
   (defun objed--get-arg-plist (keylst valid &optional wrapped)
     "Wraps any forms of keys in keylst in `progn' and returns property list.
 KEYLST is the list of keys and forms for object creation. VALID
@@ -189,9 +191,12 @@ property list where each key has an associated progn."
                     (if (and (not (cdr forms))
                              (stringp (car forms)))
                         (push (car forms) wrapped)
-                      (push `(let ((objed--block-p t))
-                               ,@(nreverse forms))
-                            wrapped)))
+                      (if (eq (caar forms) 'rx)
+                          (push (macroexpand-1 (car forms))
+                                wrapped)
+                        (push `(let ((objed--block-p t))
+                                 ,@(nreverse forms))
+                              wrapped))))
                    (t
                     ;; objed--block-p: dont run objeds advices here...
                     (push `(let ((objed--block-p t))



reply via email to

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