anchor.diff:          (>= (point-charpos point)
               (1- len)))))
   
  +(defun integer-char-p (char)
  +  (< (char-code #\0) (char-code char) (char-code #\9)))
  +
  +(defun sharp-literal-p (char point)
  +  (with-point ((p point))
  +    (character-offset p -1)
  +    (and (character-at p)
  +         (char-equal (character-at p) char)
  +         (eql (character-at p -1) #\#))))
  +
  +(defun sharp-n-literal-p (char point)
  +  (with-point ((p point))
  +    (character-offset p -1)
  +    (when (char-equal char (character-at p))
  +      (character-offset p -1)
  +      (skip-chars-backward p #'integer-char-p)
  +      (and (integer-char-p (character-at p))
  +           (eql (character-at p -1) #\#)))))
  +
  +(defparameter *non-space-following-chars*
  +  '(#\Space #\( #\' #\` #\,))
  +
  +(defparameter *non-space-preceding-chars*
  +  '(#\Space #\)))
  +
   (define-command paredit-insert-paren () ()
     (let ((p (current-point)))
       (when (in-string-or-comment-p p)
  
positive.code:     (when (eql (character-at p -1) #\\)
        (insert-character p #\()
        (return-from paredit-insert-paren))
      (unless (or (eql (character-at p -1) #\Space)
                  (eql (character-at p -1) #\()
                  (eql (character-at p -1) #\')
                  (eql (character-at p -1) #\`)
                  (eql (character-at p -1) #\,)
                  (and (eql (character-at p -1) #\@)
                       (eql (character-at p -2) #\,))
                  (eql (character-at p -1) #\#)
                  (bolp p))
        (insert-character p #\Space))
      (dolist (c '(#\( #\)))
        (insert-character p c))
  
negative.code:             (not (eql (character-at p -1) #\\)))
         (insert-character p #\\)
         (insert-character p #\"))
        (t (unless (or (bolp p)
                       (find (character-at p -1)
                             *non-space-following-chars*)
                       (sharp-literal-p #\P p))
             (insert-character p #\Space))
           (dolist (c '(#\" #\"))
             (insert-character p c))
           (unless (or (eolp p)
                       (find (character-at p)
                             *non-space-preceding-chars*))
             (insert-character p #\Space)
             (character-offset p -1))
           (character-offset p -1)))))
  