summaryrefslogtreecommitdiff
path: root/lisp/elec-pair.el
diff options
context:
space:
mode:
authorJuanma Barranquero <lekktu@gmail.com>2014-02-20 11:33:32 +0100
committerJuanma Barranquero <lekktu@gmail.com>2014-02-20 11:33:32 +0100
commitee0761cad38d5b4319806b04a9bcb081d0bdd993 (patch)
tree850f023a7f8e6e02370cfadacd086aeaee14e0af /lisp/elec-pair.el
parent3242f74a7f49661348ee8f76293ed9d445524c4d (diff)
downloademacs-ee0761cad38d5b4319806b04a9bcb081d0bdd993.tar.gz
lisp/elec-pair.el: Fix bug#16799.
(electric-pair-syntax-info): Do not check syntax before the start of buffer/region.
Diffstat (limited to 'lisp/elec-pair.el')
-rw-r--r--lisp/elec-pair.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/elec-pair.el b/lisp/elec-pair.el
index bf02e5fa273..8562801979d 100644
--- a/lisp/elec-pair.el
+++ b/lisp/elec-pair.el
@@ -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))