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

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

[elpa] externals/sotlisp f7add76 10/11: Recognize argument lists in more


From: Stefan Monnier
Subject: [elpa] externals/sotlisp f7add76 10/11: Recognize argument lists in more def- forms
Date: Fri, 26 Mar 2021 22:43:54 -0400 (EDT)

branch: externals/sotlisp
commit f7add76b1a1b97496a4fd1374c7896fffd725392
Author: yuhan0 <qythium@gmail.com>
Commit: GitHub <noreply@github.com>

    Recognize argument lists in more def- forms
    
    Switch to rx form for readability, adds support for defmacro and
    defsubst forms along with the cl-defun and defun* variants
---
 sotlisp.el | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/sotlisp.el b/sotlisp.el
index 2434607..cdcfb1f 100644
--- a/sotlisp.el
+++ b/sotlisp.el
@@ -100,7 +100,12 @@
   "Non-nil if point is at the start of a sexp.
 Specially, avoids matching inside argument lists."
   (and (eq (char-before) ?\()
-       (not (sotlisp--looking-back 
"(\\(defun\\s-+.*\\|\\(lambda\\|dolist\\|dotimes\\)\\s-+\\)("))
+       (not (sotlisp--looking-back
+             (rx (or (seq (? "cl-") (or "defun" "defmacro" "defsubst") (? "*")
+                          symbol-end (* any))
+                     (seq (or "lambda" "dolist" "dotimes")
+                          symbol-end (+ (syntax whitespace))))
+                 "(")))
        (save-excursion
          (forward-char -1)
          (condition-case nil



reply via email to

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