summaryrefslogtreecommitdiff
path: root/paredit.el
diff options
context:
space:
mode:
Diffstat (limited to 'paredit.el')
-rw-r--r--paredit.el21
1 files changed, 18 insertions, 3 deletions
diff --git a/paredit.el b/paredit.el
index 773e047..61a7050 100644
--- a/paredit.el
+++ b/paredit.el
@@ -1228,11 +1228,18 @@ With a `C-u' prefix argument, simply delete a character forward,
(delete-char +1)) ; delimiters.
((eq ?\; (char-after))
(paredit-forward-delete-comment-start))
+ ((eq (char-syntax (char-after)) ?\) )
+ (if (paredit-handle-sexp-errors
+ (save-excursion (forward-char) (backward-sexp) t)
+ nil)
+ (message "End of list!")
+ (progn
+ (message "Deleting spurious closing delimiter.")
+ (delete-char +1))))
;; Just delete a single character, if it's not a closing
;; delimiter. (The character literal case is already handled
;; by now.)
- ((not (eq (char-syntax (char-after)) ?\) ))
- (delete-char +1))))
+ (t (delete-char +1))))
(defun paredit-forward-delete-in-string ()
(let ((start+end (paredit-string-start+end-points)))
@@ -1320,9 +1327,17 @@ With a `C-u' prefix argument, simply delete a character backward,
(delete-char +1)) ; delimiters.
((bolp)
(paredit-backward-delete-maybe-comment-end))
+ ((eq (char-syntax (char-before)) ?\( )
+ (if (paredit-handle-sexp-errors
+ (save-excursion (backward-char) (forward-sexp) t)
+ nil)
+ (message "Beginning of list!")
+ (progn
+ (message "Deleting spurious closing delimiter.")
+ (delete-char -1))))
;; Delete it, unless it's an opening delimiter. The case of
;; character literals is already handled by now.
- ((not (eq (char-syntax (char-before)) ?\( ))
+ (t
;; Turn off the @#&*&!^&(%^ botch in GNU Emacs 24 that changed
;; `backward-delete-char' and `backward-delete-char-untabify'
;; semantically so that they delete the region in transient