]> git.eshelyaron.com Git - emacs.git/commitdiff
lisp/elec-pair.el: Fix bug#16799.
authorJuanma Barranquero <lekktu@gmail.com>
Thu, 20 Feb 2014 10:33:32 +0000 (11:33 +0100)
committerJuanma Barranquero <lekktu@gmail.com>
Thu, 20 Feb 2014 10:33:32 +0000 (11:33 +0100)
(electric-pair-syntax-info): Do not check syntax
before the start of buffer/region.

lisp/ChangeLog
lisp/elec-pair.el

index 9b6b370c45234e60d8b4903ae8246bfb2561cff5..a3d78dcddade8fb6b29693e377ce55d82b64fc6d 100644 (file)
@@ -1,3 +1,8 @@
+2014-02-20  Juanma Barranquero  <lekktu@gmail.com>
+
+       * elec-pair.el (electric-pair-syntax-info): Do not check syntax
+       before the start of buffer/region (bug#16799).
+
 2014-02-20  Glenn Morris  <rgm@gnu.org>
 
        * isearch.el (search-invisible): Doc fix.
index bf02e5fa2730daf2ffaaa4b4288e4bdb1f288a23..8562801979d10bc9d1bdd1c245ed2509f613ee67 100644 (file)
@@ -215,8 +215,9 @@ COMMAND-EVENT's pair.  UNCONDITIONAL indicates the variables
 `electric-pair-pairs' or `electric-pair-text-pairs' were used to
 lookup syntax.  STRING-OR-COMMENT-START indicates that point is
 inside a comment of string."
-  (let* ((pre-string-or-comment (nth 8 (save-excursion
-                                         (syntax-ppss (1- (point))))))
+  (let* ((pre-string-or-comment (or (bobp)
+                                    (nth 8 (save-excursion
+                                             (syntax-ppss (1- (point)))))))
          (post-string-or-comment (nth 8 (syntax-ppss (point))))
          (string-or-comment (and post-string-or-comment
                                  pre-string-or-comment))