diff options
author | John Wiegley <johnw@newartisans.com> | 2015-12-29 21:40:28 -0800 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2015-12-29 21:40:28 -0800 |
commit | 9f2f14a0725211b13a744573344636b57b9c98b9 (patch) | |
tree | 7190e0fb3d4aa06018d8cf997f06b806fb09a9c8 /lisp/emacs-lisp/smie.el | |
parent | d259328fb87db8cc67d52771efcfa653e52c5b71 (diff) | |
parent | e823c34072bf045800d91e12c7ddb61fa23c6e30 (diff) | |
download | emacs-9f2f14a0725211b13a744573344636b57b9c98b9.tar.gz emacs-9f2f14a0725211b13a744573344636b57b9c98b9.tar.bz2 emacs-9f2f14a0725211b13a744573344636b57b9c98b9.zip |
Merge emacs-25 into master (using imerge)
Diffstat (limited to 'lisp/emacs-lisp/smie.el')
-rw-r--r-- | lisp/emacs-lisp/smie.el | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el index 738bdddcddf..c9c002bc8fa 100644 --- a/lisp/emacs-lisp/smie.el +++ b/lisp/emacs-lisp/smie.el @@ -717,9 +717,10 @@ Possible return values: (goto-char pos) (throw 'return (list t epos - (buffer-substring-no-properties - epos - (+ epos (if (< (point) epos) -1 1)))))))) + (unless (= (point) epos) + (buffer-substring-no-properties + epos + (+ epos (if (< (point) epos) -1 1))))))))) (if (eq pos (point)) ;; We did not move, so let's abort the loop. (throw 'return (list t (point)))))) @@ -809,7 +810,12 @@ Possible return values: nil: we skipped over an identifier, matched parentheses, ..." (smie-next-sexp (indirect-function smie-backward-token-function) - (indirect-function #'backward-sexp) + (lambda (n) + (if (bobp) + ;; Arguably backward-sexp should signal this error for us. + (signal 'scan-error + (list "Beginning of buffer" (point) (point))) + (backward-sexp n))) (indirect-function #'smie-op-left) (indirect-function #'smie-op-right) halfsexp)) |