branch: master commit c43b31e21593ddaa31bcad83aaf3ed96ec37bf85 Author: Artur Malabarba <bruce.connor...@gmail.com> Commit: Artur Malabarba <bruce.connor...@gmail.com>
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 ()