Fix `electric-pair-backward-delete-char' error at bob

* lisp/elec-pair.el (electric-pair-backward-delete-char): Don't error
when at beginning of (possibly narrowed) buffer.
This commit is contained in:
João Távora 2014-02-03 00:28:57 +00:00
parent 709085b93d
commit 5dca7759a7
2 changed files with 9 additions and 3 deletions

View file

@ -1,3 +1,8 @@
2014-02-03 João Távora <joaotavora@gmail.com>
* elec-pair.el (electric-pair-backward-delete-char): Don't error
when at beginning of (possibly narrowed) buffer.
2014-02-02 Daniel Colascione <dancol@dancol.org>
* help-at-pt.el (help-at-pt-string,help-at-pt-maybe-display): Also

View file

@ -174,13 +174,14 @@ non-nil, `backward-delete-char-untabify'."
(interactive "*p\nP")
(let* ((prev (char-before))
(next (char-after))
(syntax-info (electric-pair-syntax-info prev))
(syntax-info (and prev
(electric-pair-syntax-info prev)))
(syntax (car syntax-info))
(pair (cadr syntax-info)))
(when (and (if (functionp electric-pair-delete-adjacent-pairs)
(when (and next pair
(if (functionp electric-pair-delete-adjacent-pairs)
(funcall electric-pair-delete-adjacent-pairs)
electric-pair-delete-adjacent-pairs)
next
(memq syntax '(?\( ?\" ?\$))
(eq pair next))
(delete-char 1 killflag))