]> code.delx.au - gnu-emacs/blobdiff - lisp/emacs-lisp/smie.el
Update copyright year to 2016
[gnu-emacs] / lisp / emacs-lisp / smie.el
index 197861fbae2968d4d2235026b1996d699b03d505..495ba7cb859af7db8cbce257db65a7699cb30a20 100644 (file)
@@ -1,6 +1,6 @@
 ;;; smie.el --- Simple Minded Indentation Engine -*- lexical-binding: t -*-
 
-;; Copyright (C) 2010-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2016 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords: languages, lisp, internal, parsing, indentation
@@ -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))))))
@@ -811,7 +812,7 @@ Possible return values:
    (indirect-function smie-backward-token-function)
    (lambda (n)
      (if (bobp)
-         ;; Arguably backward-sexp hould signal this error for us.
+         ;; Arguably backward-sexp should signal this error for us.
          (signal 'scan-error
                  (list "Beginning of buffer" (point) (point)))
        (backward-sexp n)))