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

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

[elpa] master c43b31e 3/7: Improvements to sotlisp--function-form-p


From: Artur Malabarba
Subject: [elpa] master c43b31e 3/7: Improvements to sotlisp--function-form-p
Date: Mon, 22 Feb 2016 16:16:00 +0000

branch: master
commit c43b31e21593ddaa31bcad83aaf3ed96ec37bf85
Author: Artur Malabarba <address@hidden>
Commit: Artur Malabarba <address@hidden>

    Improvements to sotlisp--function-form-p
---
 sotlisp.el |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/sotlisp.el b/sotlisp.el
index e6646d9..d9f622d 100644
--- a/sotlisp.el
+++ b/sotlisp.el
@@ -98,14 +98,17 @@
   "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\\s-+\\)("))
+       (not (sotlisp--looking-back 
"(\\(defun\\s-+.*\\|\\(lambda\\|dolist\\|dotimes\\)\\s-+\\)("))
        (save-excursion
          (forward-char -1)
-         (backward-up-list)
-         (forward-sexp -1)
-         (not
-          (looking-at-p (rx (* (or (syntax word) (syntax symbol) "-"))
-                            "let" symbol-end))))
+         (condition-case er
+             (progn
+               (backward-up-list)
+               (forward-sexp -1)
+               (not
+                (looking-at-p (rx (* (or (syntax word) (syntax symbol) "-"))
+                                  "let" symbol-end))))
+           (error t)))
        (not (string-match (rx (syntax symbol)) (string last-command-event)))))
 
 (defun sotlisp--function-quote-p ()



reply via email to

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