branch: elpa/paredit
commit 951813a685cab22b8d20118fa2823ed7c6ed0cc4
Author: Taylor R Campbell <[email protected]>
Commit: Taylor R Campbell <[email protected]>
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
---
paredit.el | 36 +++++++++++++++++++-----------------
1 file changed, 19 insertions(+), 17 deletions(-)
diff --git a/paredit.el b/paredit.el
index 860caed..b13ca92 100644
--- a/paredit.el
+++ b/paredit.el
@@ -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.