[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master e1903f4 01/12: avoid looking-back in el-search--goto-next-
From: |
Michael Heerdegen |
Subject: |
[elpa] master e1903f4 01/12: avoid looking-back in el-search--goto-next-sexp |
Date: |
Sun, 11 Oct 2015 10:33:26 +0000 |
branch: master
commit e1903f4123da956f7f56021c3b1ff912c3eb29fe
Author: Michael Heerdegen <address@hidden>
Commit: Michael Heerdegen <address@hidden>
avoid looking-back in el-search--goto-next-sexp
because it extremely slows it down
---
packages/el-search/el-search.el | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/packages/el-search/el-search.el b/packages/el-search/el-search.el
index 3c7af29..cf9a23e 100644
--- a/packages/el-search/el-search.el
+++ b/packages/el-search/el-search.el
@@ -244,7 +244,11 @@ expression."
Don't move if already at beginning of a sexp."
(let ((not-done t) res)
(while not-done
- (let ((stop-here nil) syntax-here)
+ (let ((stop-here nil) syntax-here
+ (looking-at-from-back (lambda (regexp n)
+ (save-excursion
+ (backward-char n)
+ (looking-at regexp)))))
(while (not stop-here)
(cond
((eobp) (signal 'end-of-buffer nil))
@@ -257,10 +261,10 @@ Don't move if already at beginning of a sexp."
;; FIXME: can the rest be done more generically?
((and (looking-at (rx (or (syntax symbol) (syntax word))))
(not (looking-at "\\_<"))
- (not (looking-back ",@" 2)))
+ (not (funcall looking-at-from-back ",@" 2)))
(forward-symbol 1))
- ((or (and (looking-at "'") (looking-back "#" 1))
- (and (looking-at "@") (looking-back "," 1)))
+ ((or (and (looking-at "'") (funcall looking-at-from-back "#" 1))
+ (and (looking-at "@") (funcall looking-at-from-back "," 1)))
(forward-char))
(t (setq stop-here t)))))
(condition-case nil
- [elpa] master updated (c0489e7 -> 2d5b3ba), Michael Heerdegen, 2015/10/11
- [elpa] master 5640cd0 04/12: el-search: some comment changes, Michael Heerdegen, 2015/10/11
- [elpa] master 84282f0 08/12: avoid repeated expansion of pcase forms, Michael Heerdegen, 2015/10/11
- [elpa] master e1903f4 01/12: avoid looking-back in el-search--goto-next-sexp,
Michael Heerdegen <=
- [elpa] master 855461b 03/12: rename a function, Michael Heerdegen, 2015/10/11
- [elpa] master ca3fe58 07/12: rename a function, Michael Heerdegen, 2015/10/11
- [elpa] master fa900da 09/12: new function el-search--end-of-sexp; use it, Michael Heerdegen, 2015/10/11
- [elpa] master ae052ce 11/12: rename a local variable, Michael Heerdegen, 2015/10/11
- [elpa] master 06c2076 02/12: change default of el-search-this-expression-identifier, Michael Heerdegen, 2015/10/11
- [elpa] master 5dd08f2 05/12: fix a condition in el-search--do-subsexps, Michael Heerdegen, 2015/10/15
- [elpa] master 0f79c16 06/12: drop el-search-expression-contains-match-p, Michael Heerdegen, 2015/10/15
- [elpa] master 2d5b3ba 12/12: whitespace clean up, Michael Heerdegen, 2015/10/15
- [elpa] master 24f8de1 10/12: rename a function, Michael Heerdegen, 2015/10/15