Fuco1/smartparens — pull request #153 by mlf176f2 (2013-08-26 19:50:16+00:00)
Title: Allow unbalanced expressions to be closed at point.

I don't like the default behavior for sp-up-sexp when closing expressions.

For example

```lisp
(require 'smartparens-config)
(smartparens-global-mode 1)
(define-key emacs-lisp-mode-map (kbd ")") 'sp-up-sexp)
(defun emacsmate-smartparens-emacs-mode-hook ()
"Change `sp-navigate-close-if-unbalanced' to be non-nil in emacs-buffers"
(set (make-local-variable 'sp-navigate-close-if-unbalanced) t)
(set (make-local-variable 'sp-close-at-point) t))

(add-hook 'emacs-lisp-mode-hook
'emacsmate-smartparens-emacs-mode-hook |
```

Pressing `)` will result in

```lisp
(require 'smartparens-config)
(smartparens-global-mode 1)
(define-key emacs-lisp-mode-map (kbd ")") 'sp-up-sexp)
(defun emacsmate-smartparens-emacs-mode-hook ()
"Change `sp-navigate-close-if-unbalanced' to be non-nil in emacs-buffers"
(set (make-local-variable 'sp-navigate-close-if-unbalanced) t)
(set (make-local-variable 'sp-close-at-point) t))

(add-hook 'emacs-lisp-mode-hook)|
'emacsmate-smartparens-emacs-mode-hook
```

Where I want

```lisp
(require 'smartparens-config)
(smartparens-global-mode 1)
(define-key emacs-lisp-mode-map (kbd ")") 'sp-up-sexp)
(defun emacsmate-smartparens-emacs-mode-hook ()
"Change `sp-navigate-close-if-unbalanced' to be non-nil in emacs-buffers"
(set (make-local-variable 'sp-navigate-close-if-unbalanced) t)
(set (make-local-variable 'sp-close-at-point) t))

(add-hook 'emacs-lisp-mode-hook
'emacsmate-smartparens-emacs-mode-hook)|
```

This mimics autopair's behavior.