From: João Távora Date: Mon, 3 Feb 2014 00:28:57 +0000 (+0000) Subject: Fix `electric-pair-backward-delete-char' error at bob X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~190 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5dca7759a78e8b2a50308a9d5f276799ec46c975;p=emacs.git 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. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9b692283d96..542e686dfe2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-02-03 João Távora + + * elec-pair.el (electric-pair-backward-delete-char): Don't error + when at beginning of (possibly narrowed) buffer. + 2014-02-02 Daniel Colascione * help-at-pt.el (help-at-pt-string,help-at-pt-maybe-display): Also diff --git a/lisp/elec-pair.el b/lisp/elec-pair.el index a2d637e2aea..bf02e5fa273 100644 --- a/lisp/elec-pair.el +++ b/lisp/elec-pair.el @@ -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))