X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/5dca7759a78e8b2a50308a9d5f276799ec46c975..2ed94e04988f8b85e43d150955d712bd6324b392:/lisp/elec-pair.el diff --git a/lisp/elec-pair.el b/lisp/elec-pair.el index bf02e5fa27..8562801979 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))