[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/paredit 67d6a4f 202/224: Let C-d and DEL delete the other
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/paredit 67d6a4f 202/224: Let C-d and DEL delete the other spurious delimiters too. |
Date: |
Sat, 7 Aug 2021 09:22:50 -0400 (EDT) |
branch: elpa/paredit
commit 67d6a4f5ad505af98a311bd955dbe7bd2fc4e0b1
Author: Taylor R Campbell <campbell@mumble.net>
Commit: Taylor R Campbell <campbell@mumble.net>
Let C-d and DEL delete the other spurious delimiters too.
---
paredit.el | 21 ++++++++++++++++++---
test.el | 8 ++++++--
2 files changed, 24 insertions(+), 5 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
diff --git a/test.el b/test.el
index 229c0bf..f3444af 100644
--- a/test.el
+++ b/test.el
@@ -287,7 +287,9 @@ Four arguments: the paredit command, the text of the buffer
("|\\\\\\\\" "|\\\\" "|" error)
("\\\\|\\\\" "\\\\|" error)
("(|\\\\\\\\)" "(|\\\\)" "(|)" "|" error)
- ("(\\\\|\\\\)" "(\\\\|)" "(\\\\|)")))
+ ("(\\\\|\\\\)" "(\\\\|)" "(\\\\|)")
+ ("|(" "|" error)
+ ("|)" "|" error)))
(paredit-test 'paredit-backward-delete
'(("fo|o" "f|o")
@@ -304,7 +306,9 @@ Four arguments: the paredit command, the text of the buffer
("\\\\\\\\|" "\\\\|" "|" error)
("\\\\|\\\\" "|\\\\" error)
("(\\\\\\\\|)" "(\\\\|)" "(|)" "|" error)
- ("(\\\\|\\\\)" "(|\\\\)" "(|\\\\)")))
+ ("(\\\\|\\\\)" "(|\\\\)" "(|\\\\)")
+ ("(|" "|" error)
+ (")|" "|" error)))
(dolist (command '(paredit-delete-region paredit-kill-region))
;++ Need to check whether `paredit-kill-region' updates the kill ring
- [nongnu] elpa/paredit db99ca6 176/224: Note `backward-delete-char' lossage in NEWS., (continued)
- [nongnu] elpa/paredit db99ca6 176/224: Note `backward-delete-char' lossage in NEWS., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit aa26b48 181/224: Make sure M-? leaves space appropriately when there was none., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit da5b1e0 183/224: Flesh out paredit-wrap-... tests a little., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 3ab28ec 185/224: Revert "Bind M-[ to paredit-wrap-square.", ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit c33e134 186/224: Fix reference to `backward-down-list', which is no more., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit e775e43 187/224: Tweak whitespace in `paredit-split-sexp'. No functional change., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 66d6374 189/224: Tweak HTML output a little more., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit f8bf24c 192/224: Allow slurping while in a character., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 146a434 194/224: Add some slurp tests with characters and strings., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit c92197a 196/224: Tweak comment about barfage error., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 67d6a4f 202/224: Let C-d and DEL delete the other spurious delimiters too.,
ELPA Syncer <=
- [nongnu] elpa/paredit ad27e64 203/224: Remove beta marker from 24 in NEWS., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit aec81db 206/224: Quote M-mode-hook for add-hook in example .emacs fragment., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 2f6f672 210/224: Add email address., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 6ee9f06 213/224: Bump copyright year to 2017., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 0b523c3 215/224: Switch http://mumble.net to https://mumble.net., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 8330a41 224/224: Use `-q --no-site-file' for genhtml.sh too., ELPA Syncer, 2021/08/07