[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master c1deb05 03/13: Don't use looking-back
From: |
Artur Malabarba |
Subject: |
[elpa] master c1deb05 03/13: Don't use looking-back |
Date: |
Wed, 05 Aug 2015 21:54:09 +0000 |
branch: master
commit c1deb0528e11e93e982b9b7e445c3fef7fad2911
Author: Artur Malabarba <address@hidden>
Commit: Artur Malabarba <address@hidden>
Don't use looking-back
---
sotlisp.el | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/sotlisp.el b/sotlisp.el
index d9d2492..d1a34b9 100644
--- a/sotlisp.el
+++ b/sotlisp.el
@@ -90,16 +90,24 @@
(bound-and-true-p paredit-mode)
(bound-and-true-p smartparens-mode)))
+(defun sotlisp--looking-back (regexp)
+ (string-match
+ (concat regexp "\\'")
+ (buffer-substring (line-beginning-position) (point))))
+
(defun sotlisp--function-form-p ()
"Non-nil if point is at the start of a sexp.
Specially, avoids matching inside argument lists."
(and (eq (char-before) ?\()
- (not (looking-back "(\\(defun\\s-+.*\\|lambda\\s-+\\)("))
+ (not (sotlisp--looking-back "(\\(defun\\s-+.*\\|lambda\\s-+\\)("))
(not (string-match (rx (syntax symbol)) (string last-command-event)))))
(defun sotlisp--function-quote-p ()
"Non-nil if point is at a sharp-quote."
- (looking-back "#'"))
+ (ignore-errors
+ (save-excursion
+ (forward-char -2)
+ (looking-at-p "#'"))))
(defun sotlisp--function-p ()
"Non-nil if point is at reasonable place for a function name.
- [elpa] master updated (e18833b -> 0bb0ee6), Artur Malabarba, 2015/08/05
- [elpa] master 785d35c 01/13: After expanding, eat up space ahead if convenient, Artur Malabarba, 2015/08/05
- [elpa] master 960ea2f 02/13: Avoid errors on false positives, Artur Malabarba, 2015/08/05
- [elpa] master f7b4937 04/13: Refactor whitespace detection, Artur Malabarba, 2015/08/05
- [elpa] master c1deb05 03/13: Don't use looking-back,
Artur Malabarba <=
- [elpa] master 7f38383 05/13: Don't expand in strings or comments, Artur Malabarba, 2015/08/05
- [elpa] master b957752 07/13: Don't indent if the user is starting to type a comment. Fix #51, Artur Malabarba, 2015/08/05
- [elpa] master 1e6676a 06/13: Version bump, Artur Malabarba, 2015/08/05
- [elpa] master f2c0fe9 08/13: Don't indent if undo-in-progress, Artur Malabarba, 2015/08/05
- [elpa] master 6ccb05d 10/13: More abbrevs, Artur Malabarba, 2015/08/05
- [elpa] master 3557254 09/13: Version bump, Artur Malabarba, 2015/08/05
- [elpa] master 98fe00f 11/13: Version bump, Artur Malabarba, 2015/08/05
- [elpa] master 0bb0ee6 13/13: Merge commit '3557254c6873aeb0b5070248aa0faf2ff0d29d04', Artur Malabarba, 2015/08/05
- [elpa] master 5b702fc 12/13: Merge commit '98fe00fbd6a71ba1e79cf616f22c026c9d84adc7', Artur Malabarba, 2015/08/05