emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r116532: lisp/elec-pair.el: Fix typos.


From: Juanma Barranquero
Subject: [Emacs-diffs] trunk r116532: lisp/elec-pair.el: Fix typos.
Date: Sun, 23 Feb 2014 00:19:19 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 116532
revision-id: address@hidden
parent: address@hidden
committer: Juanma Barranquero <address@hidden>
branch nick: trunk
timestamp: Sun 2014-02-23 01:19:11 +0100
message:
  lisp/elec-pair.el: Fix typos.
  
  (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*'.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/elec-pair.el              elecpair.el-20131227124533-yaq8recs0j0ggt67-1
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-02-22 21:20:49 +0000
+++ b/lisp/ChangeLog    2014-02-23 00:19:11 +0000
@@ -1,3 +1,11 @@
+2014-02-23  Juanma Barranquero  <address@hidden>
+
+       * 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  <address@hidden>
 
        * imenu.el (imenu--generic-function): Doc fix.

=== modified file 'lisp/elec-pair.el'
--- a/lisp/elec-pair.el 2014-02-20 10:33:32 +0000
+++ b/lisp/elec-pair.el 2014-02-23 00:19:11 +0000
@@ -163,7 +163,7 @@
   "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 @@
 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 @@
 (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 a 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 @@
           (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 @@
     (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 @@
            (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 @@
 
 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]