emacs-diffs
[Top][All Lists]
Advanced

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

master 839a9e7: * lisp/nxml/xmltok.el (xmltok-defregexp): Don't quote la


From: Stefan Monnier
Subject: master 839a9e7: * lisp/nxml/xmltok.el (xmltok-defregexp): Don't quote lambda
Date: Tue, 13 Apr 2021 23:34:47 -0400 (EDT)

branch: master
commit 839a9e74e0263f4e75a0c34df39c2e0a57c49438
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    * lisp/nxml/xmltok.el (xmltok-defregexp): Don't quote lambda
---
 lisp/nxml/xmltok.el | 45 +++++++++++++++++++++++----------------------
 1 file changed, 23 insertions(+), 22 deletions(-)

diff --git a/lisp/nxml/xmltok.el b/lisp/nxml/xmltok.el
index 8f89598..9824eeb 100644
--- a/lisp/nxml/xmltok.el
+++ b/lisp/nxml/xmltok.el
@@ -324,8 +324,8 @@ and VALUE-END, otherwise a STRING giving the value."
            (setq strs (cons (car arg) strs))
            (setq names (cons (cdr arg) names)))
          (setq args (cdr args))))
-      (cons (apply 'concat (nreverse strs))
-           (apply 'append (nreverse names))))))
+      (cons (apply #'concat (nreverse strs))
+           (apply #'append (nreverse names))))))
 
 (eval-when-compile
   ;; Make a symbolic group named NAME from the regexp R.
@@ -338,7 +338,7 @@ and VALUE-END, otherwise a STRING giving the value."
           (cons (concat "\\(" (car ,sym) "\\)") (cons ',name (cdr ,sym)))))))
 
   (defun xmltok-p (&rest r) (xmltok+ "\\(?:"
-                                    (apply 'xmltok+ r)
+                                    (apply #'xmltok+ r)
                                     "\\)"))
 
   ;; Get the group index of ELEM in a LIST of symbols.
@@ -372,22 +372,23 @@ and VALUE-END, otherwise a STRING giving the value."
   (defmacro xmltok-defregexp (sym r)
     `(defalias ',sym
        (let ((r ,r))
-        `(macro lambda (action &optional group-name)
-                (cond ((eq action 'regexp)
-                       ,(car r))
-                      ((or (eq action 'start) (eq action 'beginning))
-                       (list 'match-beginning (xmltok-get-index group-name
-                                                                ',(cdr r))))
-                      ((eq action 'end)
-                       (list 'match-end (xmltok-get-index group-name
-                                                          ',(cdr r))))
-                      ((eq action 'string)
-                       (list 'match-string
-                             (xmltok-get-index group-name ',(cdr r))))
-                      ((eq action 'string-no-properties)
-                       (list 'match-string-no-properties
-                             (xmltok-get-index group-name ',(cdr r))))
-                      (t (error "Invalid action: %s" action))))))))
+        `(macro
+          . ,(lambda (action &optional group-name)
+               (cond ((eq action 'regexp)
+                      (car r))
+                     ((or (eq action 'start) (eq action 'beginning))
+                      (list 'match-beginning (xmltok-get-index group-name
+                                                               (cdr r))))
+                     ((eq action 'end)
+                      (list 'match-end (xmltok-get-index group-name
+                                                         (cdr r))))
+                     ((eq action 'string)
+                      (list 'match-string
+                            (xmltok-get-index group-name (cdr r))))
+                     ((eq action 'string-no-properties)
+                      (list 'match-string-no-properties
+                            (xmltok-get-index group-name (cdr r))))
+                     (t (error "Invalid action: %s" action)))))))))
 
 
 (eval-when-compile
@@ -878,7 +879,7 @@ and VALUE-END, otherwise a STRING giving the value."
                                (cons " " value-parts)))))
               (< (point) end))))
     (when well-formed
-      (aset att 5 (apply 'concat (nreverse value-parts))))
+      (aset att 5 (apply #'concat (nreverse value-parts))))
     (aset att 6 (nreverse refs))))
 
 (defun xmltok-scan-after-amp (entity-handler)
@@ -1333,7 +1334,7 @@ If LIMIT is non-nil, then do not consider characters 
beyond LIMIT."
                 t))))
     (if (not well-formed)
        nil
-      (apply 'concat
+      (apply #'concat
             (nreverse (cons (buffer-substring-no-properties start lim)
                             value-parts))))))
 
@@ -1358,7 +1359,7 @@ If LIMIT is non-nil, then do not consider characters 
beyond LIMIT."
 
 (defun xmltok-require-next-token (&rest types)
   (xmltok-next-prolog-token)
-  (apply 'xmltok-require-token types))
+  (apply #'xmltok-require-token types))
 
 (defun xmltok-require-token (&rest types)
   ;; XXX Generate a more helpful error message



reply via email to

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