;;; elec-pair.el --- Automatic parenthesis pairing -*- lexical-binding:t -*-
-;; Copyright (C) 2013 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2014 Free Software Foundation, Inc.
;; Author: João Távora <joaotavora@gmail.com>
The default values of `electric-pair-inhibit-predicate' and
`electric-pair-skip-self' check this variable before delegating to other
-predicates reponsible for making decisions on whether to pair/skip some
-characters based on the actual state of the buffer's parenthesis and
+predicates responsible for making decisions on whether to pair/skip some
+characters based on the actual state of the buffer's parentheses and
quotes."
:version "24.4"
:group 'electricity
:group 'electricity
:type '(choice
(const :tag "Yes, jump over whitespace" t)
- (const :tag "Yes, and delete whitespace" 'chomp)
+ (const :tag "Yes, and delete whitespace" chomp)
(const :tag "No, no whitespace skipping" nil)
function))
(defun electric-pair-backward-delete-char (n &optional killflag untabify)
"Delete characters backward, and maybe also two adjacent paired delimiters.
-Remaining behaviour is given by `backward-delete-char' or, if UNTABIFY is
+Remaining behavior is given by `backward-delete-char' or, if UNTABIFY is
non-nil, `backward-delete-char-untabify'."
(interactive "*p\nP")
(let* ((prev (char-before))
(defun electric-pair-backward-delete-char-untabify (n &optional killflag)
"Delete characters backward, and maybe also two adjacent paired delimiters.
-Remaining behaviour is given by `backward-delete-char-untabify'."
+Remaining behavior is given by `backward-delete-char-untabify'."
(interactive "*p\nP")
(electric-pair-backward-delete-char n killflag t))
;; doesn't keep `electric-pair-mode' from balancing your ()'s and your
;; []'s.
(defun electric-pair--balance-info (direction string-or-comment)
- "Examine lists forward or backward according to DIRECTIONS's sign.
+ "Examine lists forward or backward according to DIRECTION's sign.
STRING-OR-COMMENT is info suitable for running `parse-partial-sexp'.
-Return a cons of two descritions (MATCHED-P . PAIR) for the
+Return a cons of two descriptions (MATCHED-P . PAIR) for the
innermost and outermost lists that enclose point. The outermost
list enclosing point is either the first top-level or first
-mismatched list found by uplisting.
+mismatched list found by listing up.
If the outermost list is matched, don't rely on its PAIR. If
-point is not enclosed by any lists, return ((T) (T))."
+point is not enclosed by any lists, return ((T) . (T))."
(let* (innermost
outermost
(table (if string-or-comment
(funcall electric-pair-open-newline-between-pairs)
electric-pair-open-newline-between-pairs)
(eq last-command-event ?\n)
- (not (eobp))
+ (< (1+ (point-min)) (point) (point-max))
(eq (save-excursion
(skip-chars-backward "\t\s")
(char-before (1- (point))))