paredit.el.diff (3540B)
1 --- /usr/share/emacs/site-lisp/paredit/paredit.el 2009-07-28 20:43:11.000000000 -0300 2 +++ src/el/paredit.el 2009-12-15 04:39:31.000000000 -0300 3 @@ -683,7 +683,8 @@ 4 (defun paredit-move-past-close (close) 5 (cond ((or (paredit-in-string-p) 6 (paredit-in-comment-p)) 7 - (insert close)) 8 + (insert close) 9 + (paredit-delete-leading-whitespace)) 10 ((not (paredit-in-char-p)) 11 (paredit-move-past-close-and-reindent close) 12 (paredit-blink-paren-match nil)))) 13 @@ -691,7 +692,8 @@ 14 (defun paredit-move-past-close-and-newline (close) 15 (if (or (paredit-in-string-p) 16 (paredit-in-comment-p)) 17 - (insert close) 18 + (progn (insert close) 19 + (paredit-delete-leading-whitespace)) 20 (if (paredit-in-char-p) (forward-char)) 21 (paredit-move-past-close-and-reindent close) 22 (let ((comment.point (paredit-find-comment-on-line))) 23 @@ -747,6 +749,7 @@ 24 (point)))) 25 (regionp (funcall forward (+ end (if spacep 2 1))))) 26 (insert close) 27 + (paredit-delete-leading-whitespace) 28 (if (paredit-space-for-delimiter-p t close) 29 (insert " ")))))) 30 31 @@ -784,7 +787,8 @@ 32 (if (eq close (matching-paren open)) 33 (save-excursion 34 (message "Missing closing delimiter: %c" close) 35 - (insert close)) 36 + (insert close) 37 + (paredit-delete-leading-whitespace)) 38 (error "Mismatched missing closing delimiter: %c ... %c" 39 open close)))) 40 (let ((orig (point))) 41 @@ -1543,6 +1547,7 @@ 42 ((paredit-region-active-p) nil) 43 (t 1))) 44 (insert close) 45 + (paredit-delete-leading-whitespace) 46 (backward-char))) 47 (save-excursion (backward-up-list) (indent-sexp))) 48 49 @@ -1791,8 +1796,10 @@ 50 (setq close ; adjusting for mixed 51 (prog1 (char-before) ; delimiters as necessary, 52 (backward-delete-char 1) 53 - (insert close)))))) 54 - (insert close))) ; to insert that delimiter. 55 + (insert close) 56 + (paredit-delete-leading-whitespace)))))) 57 + (insert close) ; to insert that delimiter. 58 + (paredit-delete-leading-whitespace))) 59 60 (defun paredit-forward-slurp-into-string () 61 (goto-char (1+ (cdr (paredit-string-start+end-points)))) 62 @@ -1802,7 +1809,8 @@ 63 (let ((close (char-before))) 64 (backward-delete-char 1) 65 (paredit-forward-for-quote (save-excursion (forward-sexp) (point))) 66 - (insert close))) 67 + (insert close) 68 + (paredit-delete-leading-whitespace))) 69 70 (defun paredit-forward-barf-sexp () 71 "Remove the last S-expression in the current list from that list 72 @@ -1822,7 +1830,8 @@ 73 (error "Barfing all subexpressions with no open-paren?")) 74 ((paredit-in-comment-p) ; Don't put the close-paren in 75 (newline-and-indent))) ; a comment. 76 - (insert close)) 77 + (insert close) 78 + (paredit-delete-leading-whitespace)) 79 ;; Reindent all of the newly barfed S-expressions. 80 (paredit-forward-and-indent))) 81 82 @@ -1919,6 +1928,7 @@ 83 (char-before)))) 84 (delete-horizontal-space) 85 (insert close) 86 + (paredit-delete-leading-whitespace) 87 (save-excursion (insert ?\ ) 88 (insert open) 89 (backward-char)