diff options
author | Pierre Courtieu <Pierre.Courtieu@cnam.fr> | 2015-12-05 00:20:06 +0100 |
---|---|---|
committer | Pierre Courtieu <Pierre.Courtieu@cnam.fr> | 2015-12-05 00:20:06 +0100 |
commit | 4a4a8c5e3ce8b5db1e893ac9c800f76a2c29d124 (patch) | |
tree | bd78f28a529bb46654554d90e5a694288c0dea55 /coq/coq-smie.el | |
parent | c480238a9369b11f7f415c9c97324a5cfa61f40d (diff) |
Fixed #15 + more speedup of indentation.
Experimenting on more regexp and less adhoc searching in the smie lexer.
In particular the regexp for bullet seems now capture only real bullets.
Diffstat (limited to 'coq/coq-smie.el')
-rw-r--r-- | coq/coq-smie.el | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/coq/coq-smie.el b/coq/coq-smie.el index 2dc5482c..939e0cc3 100644 --- a/coq/coq-smie.el +++ b/coq/coq-smie.el @@ -35,11 +35,12 @@ (require 'coq-indent) (require 'smie nil 'noerror) -(defmacro measure-time (&rest body) - "Measure the time it takes to evaluate BODY." - `(let ((time (current-time))) - ,@body - (message "%.06f" (float-time (time-since time))))) +; debugging +;(defmacro measure-time (&rest body) +; "Measure the time it takes to evaluate BODY." +; `(let ((time (current-time))) +; ,@body +; (message "%.06f" (float-time (time-since time))))) (defun coq-string-suffix-p (str1 str2 &optional ignore-case) @@ -209,7 +210,8 @@ command (and inside parenthesis)." (equal (char-syntax ?\)) (char-syntax (char-after))))) (throw 'found nil)) ((zerop (length next)) ;; capture other characters than closing parent - (let ((forward-sexp-function nil)) (forward-sexp -1))) + ;; don't use smmie-forward-sexp here + (let ((forward-sexp-function nil)) (forward-sexp 1))) ((member next tokens) (throw 'found next)))))))) (scan-error nil))) @@ -256,7 +258,9 @@ command (and inside parenthesis). " (or (equal (point) (point-min)) ; protecting char-before next line (equal (char-syntax ?\() (char-syntax (char-before))))) (throw 'found nil)) - ((zerop (length next)) (let ((forward-sexp-function nil)) (forward-sexp -1))) + ((zerop (length next)) + ;; don't use smmie-forward-sexp here + (let ((forward-sexp-function nil)) (forward-sexp -1))) ((member next tokens) (throw 'found next)))))))) (scan-error nil))) |