]> code.delx.au - gnu-emacs/commitdiff
lisp/elec-pair.el: Fix typos.
authorJuanma Barranquero <lekktu@gmail.com>
Sun, 23 Feb 2014 00:19:11 +0000 (01:19 +0100)
committerJuanma Barranquero <lekktu@gmail.com>
Sun, 23 Feb 2014 00:19:11 +0000 (01:19 +0100)
(electric-pair-text-syntax-table, electric-pair-syntax-info)
(electric-pair--syntax-ppss, electric-pair--balance-info)
(electric-pair-mode): Fix docstring typos.
(electric-pair--looking-at-unterminated-string-p): Doc fix.
(electric-pair--inside-string-p): Doc fix.  Use `let', not `let*'.

lisp/ChangeLog
lisp/elec-pair.el

index 8ebb68622f5b373323a127805b7829b76a6a71d4..2dad756b618b9ecabe0b8b49baf8987f1a42f8ca 100644 (file)
@@ -1,3 +1,11 @@
+2014-02-23  Juanma Barranquero  <lekktu@gmail.com>
+
+       * elec-pair.el (electric-pair-text-syntax-table)
+       (electric-pair-syntax-info, electric-pair--syntax-ppss)
+       (electric-pair--balance-info, electric-pair-mode): Fix docstring typos.
+       (electric-pair--looking-at-unterminated-string-p): Doc fix.
+       (electric-pair--inside-string-p): Doc fix.  Use `let', not `let*'.
+
 2014-02-22  Glenn Morris  <rgm@gnu.org>
 
        * imenu.el (imenu--generic-function): Doc fix.
index 8562801979d10bc9d1bdd1c245ed2509f613ee67..52ad9bc02493d4a4254ba763016c31bcc8c3f3ed 100644 (file)
@@ -163,7 +163,7 @@ return value is considered instead."
   "Syntax table used when pairing inside comments and strings.
 
 `electric-pair-mode' considers this syntax table only when point in inside
-quotes or comments. If lookup fails here, `electric-pair-text-pairs' will
+quotes or comments.  If lookup fails here, `electric-pair-text-pairs' will
 be considered.")
 
 (defun electric-pair-backward-delete-char (n &optional killflag untabify)
@@ -214,7 +214,7 @@ SYNTAX is COMMAND-EVENT's syntax character.  PAIR is
 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."
+inside a comment or string."
   (let* ((pre-string-or-comment (or (bobp)
                                     (nth 8 (save-excursion
                                              (syntax-ppss (1- (point)))))))
@@ -252,7 +252,7 @@ inside a comment of string."
 (defun electric-pair--syntax-ppss (&optional pos where)
   "Like `syntax-ppss', but sometimes fallback to `parse-partial-sexp'.
 
-WHERE is list defaulting to '(string comment) and indicates
+WHERE is list defaulting to '(string comment) and indicates
 when to fallback to `parse-partial-sexp'."
   (let* ((pos (or pos (point)))
          (where (or where '(string comment)))
@@ -267,43 +267,42 @@ when to fallback to `parse-partial-sexp'."
           (parse-partial-sexp (point-min) pos)
         quick-ppss-at-pos))))
 
-;; Balancing means controlling pairing and skipping of parentheses so
-;; that, if possible, the buffer ends up at least as balanced as
-;; before, if not more. The algorithm is slightly complex because some
-;; situations like "()))" need pairing to occur at the end but not at
-;; the beginning. Balancing should also happen independently for
-;; different types of parentheses, so that having your {}'s unbalanced
-;; doesn't keep `electric-pair-mode' from balancing your ()'s and your
-;; []'s.
+;; Balancing means controlling pairing and skipping of parentheses
+;; so that, if possible, the buffer ends up at least as balanced as
+;; before, if not more.  The algorithm is slightly complex because
+;; some situations like "()))" need pairing to occur at the end but
+;; not at the beginning.  Balancing should also happen independently
+;; for different types of parentheses, so that having your {}'s
+;; unbalanced 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 DIRECTION's sign.
 
 STRING-OR-COMMENT is info suitable for running `parse-partial-sexp'.
 
 Return a cons of two descriptions (MATCHED-P . PAIR) for the
-innermost and outermost lists that enclose point. The outermost
+innermost and outermost lists that enclose point.  The outermost
 list enclosing point is either the first top-level or first
 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))."
+If the outermost list is matched, don't rely on its PAIR.
+If point is not enclosed by any lists, return ((t) . (t))."
   (let* (innermost
          outermost
          (table (if string-or-comment
                     electric-pair-text-syntax-table
                   (syntax-table)))
          (at-top-level-or-equivalent-fn
-          ;; called when `scan-sexps' ran perfectly, when when it
-          ;; found a parenthesis pointing in the direction of
-          ;; travel. Also when travel started inside a comment and
-          ;; exited it
+          ;; called when `scan-sexps' ran perfectly, when it found
+          ;; a parenthesis pointing in the direction of travel.
+          ;; Also when travel started inside a comment and exited it.
           #'(lambda ()
               (setq outermost (list t))
               (unless innermost
                 (setq innermost (list t)))))
          (ended-prematurely-fn
           ;; called when `scan-sexps' crashed against a parenthesis
-          ;; pointing opposite the direction of travel. After
+          ;; pointing opposite the direction of travel.  After
           ;; traversing that character, the idea is to travel one sexp
           ;; in the opposite direction looking for a matching
           ;; delimiter.
@@ -366,7 +365,7 @@ point is not enclosed by any lists, return ((T) . (T))."
     (cons innermost outermost)))
 
 (defun electric-pair--looking-at-unterminated-string-p (char)
-  "Say if following string starts with CHAR and is unterminated."
+  "Return non-nil if following string starts with CHAR and is unterminated."
   ;; FIXME: ugly/naive
   (save-excursion
     (skip-chars-forward (format "^%c" char))
@@ -380,14 +379,14 @@ point is not enclosed by any lists, return ((T) . (T))."
            (scan-error t)))))
 
 (defun electric-pair--inside-string-p (char)
-  "Say if point is inside a string started by CHAR.
+  "Return non-nil if point is inside a string started by CHAR.
 
 A comments text is parsed with `electric-pair-text-syntax-table'.
 Also consider strings within comments, but not strings within
 strings."
   ;; FIXME: could also consider strings within strings by examining
   ;; delimiters.
-  (let* ((ppss (electric-pair--syntax-ppss (point) '(comment))))
+  (let ((ppss (electric-pair--syntax-ppss (point) '(comment))))
     (memq (nth 3 ppss) (list t char))))
 
 (defun electric-pair-inhibit-if-helps-balance (char)
@@ -549,7 +548,7 @@ the mode if ARG is omitted or nil.
 
 Electric Pair mode is a global minor mode.  When enabled, typing
 an open parenthesis automatically inserts the corresponding
-closing parenthesis.  \(Likewise for brackets, etc.)."
+closing parenthesis.  (Likewise for brackets, etc.)."
   :global t :group 'electricity
   (if electric-pair-mode
       (progn