diff options
author | Taylor R Campbell <campbell@mumble.net> | 2011-04-11 22:50:30 +0000 |
---|---|---|
committer | Taylor R Campbell <campbell@mumble.net> | 2011-04-11 22:50:30 +0000 |
commit | 951813a685cab22b8d20118fa2823ed7c6ed0cc4 (patch) | |
tree | e98b57c5aab0dd7eff6b32221bc6e7fa00f80003 /paredit.el | |
parent | 2463273cabb1ac803ef6765fe2d2f9ec4902ce60 (diff) |
Fix `paredit-move-past-close' within a character escape.
Ignore-this: ed55179d0138b72dbe408836bb9f9403
It should move past the close, not stay where it is.
`paredit-move-past-close-and-newline' already did this; the two now
share the common code.
darcs-hash:20110411225030-00fcc-202b9f3f93aab76ddae1c8bb10f9f605fee949d4
Diffstat (limited to 'paredit.el')
-rw-r--r-- | paredit.el | 36 |
1 files changed, 19 insertions, 17 deletions
@@ -676,30 +676,32 @@ Used by `paredit-yank-pop'; for internal paredit use only.") 'paredit-close-square-and-newline) (defun paredit-move-past-close (close) - (cond ((or (paredit-in-string-p) - (paredit-in-comment-p)) - (insert close)) - ((not (paredit-in-char-p)) - (paredit-move-past-close-and-reindent close) - (paredit-blink-paren-match nil)))) + (paredit-move-past-close-and close + (lambda () + (paredit-blink-paren-match nil)))) (defun paredit-move-past-close-and-newline (close) + (paredit-move-past-close-and close + (lambda () + (let ((comment.point (paredit-find-comment-on-line))) + (newline) + (if comment.point + (save-excursion + (forward-line -1) + (end-of-line) + (indent-to (cdr comment.point)) + (insert (car comment.point))))) + (lisp-indent-line) + (paredit-ignore-sexp-errors (indent-sexp)) + (paredit-blink-paren-match t)))) + +(defun paredit-move-past-close-and (close if-moved) (if (or (paredit-in-string-p) (paredit-in-comment-p)) (insert close) (if (paredit-in-char-p) (forward-char)) (paredit-move-past-close-and-reindent close) - (let ((comment.point (paredit-find-comment-on-line))) - (newline) - (if comment.point - (save-excursion - (forward-line -1) - (end-of-line) - (indent-to (cdr comment.point)) - (insert (car comment.point))))) - (lisp-indent-line) - (paredit-ignore-sexp-errors (indent-sexp)) - (paredit-blink-paren-match t))) + (funcall if-moved))) (defun paredit-find-comment-on-line () "Find a margin comment on the current line. |