[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/paredit 5114a62 193/224: If in a string, slurp into the en
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/paredit 5114a62 193/224: If in a string, slurp into the enclosing list if necessary. |
Date: |
Sat, 7 Aug 2021 09:22:48 -0400 (EDT) |
branch: elpa/paredit
commit 5114a626d0ee62d4afb10633df1dad934b793e13
Author: Taylor R Campbell <campbell@mumble.net>
Commit: Taylor R Campbell <campbell@mumble.net>
If in a string, slurp into the enclosing list if necessary.
---
paredit.el | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/paredit.el b/paredit.el
index 6f88eef..225dc05 100644
--- a/paredit.el
+++ b/paredit.el
@@ -2233,7 +2233,16 @@ If in a string, move the opening double-quote forward by
one
(cond ((paredit-in-comment-p)
(error "Invalid context for slurping S-expressions."))
((paredit-in-string-p)
- (paredit-forward-slurp-into-string))
+ ;; If there is anything to slurp into the string, take that.
+ ;; Otherwise, try to slurp into the enclosing list.
+ (if (save-excursion
+ (goto-char (paredit-enclosing-string-end))
+ (paredit-handle-sexp-errors (progn (forward-sexp) nil)
+ t))
+ (progn
+ (goto-char (paredit-enclosing-string-end))
+ (paredit-forward-slurp-into-list))
+ (paredit-forward-slurp-into-string)))
(t
(paredit-forward-slurp-into-list)))))
@@ -2318,7 +2327,16 @@ If in a string, move the opening double-quote backward
by one
(cond ((paredit-in-comment-p)
(error "Invalid context for slurping S-expressions."))
((paredit-in-string-p)
- (paredit-backward-slurp-into-string))
+ ;; If there is anything to slurp into the string, take that.
+ ;; Otherwise, try to slurp into the enclosing list.
+ (if (save-excursion
+ (goto-char (paredit-enclosing-string-start))
+ (paredit-handle-sexp-errors (progn (backward-sexp) nil)
+ t))
+ (progn
+ (goto-char (paredit-enclosing-string-start))
+ (paredit-backward-slurp-into-list))
+ (paredit-backward-slurp-into-string)))
(t
(paredit-backward-slurp-into-list)))))
- [nongnu] elpa/paredit 5840f55 165/224: Preserve column better in `paredit-join'., (continued)
- [nongnu] elpa/paredit 5840f55 165/224: Preserve column better in `paredit-join'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 9838fe2 174/224: In check.sh, use $EMACS if set, defaulting to `emacs'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 3bdd840 175/224: Rework paredit-semicolon and add some tests for it., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 014cdfe 177/224: Handle shift selection in motion commands in recent GNU Emacs., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit be28e85 178/224: Mention shift selection for motion commands in NEWS., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 42a0494 179/224: Use $EMACS in genhtml.sh too., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 856d927 180/224: Use `paredit-preserving-column' in `paredit-reindent-defun'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit a26c148 182/224: Bind M-[ to paredit-wrap-square., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 4e5ba81 184/224: Make slurping `(|) foo' yield `(|foo)', not `(| foo)'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 0c805ec 188/224: Rework HTML output to simplify and prettify everything., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 5114a62 193/224: If in a string, slurp into the enclosing list if necessary.,
ELPA Syncer <=
- [nongnu] elpa/paredit 8b38538 190/224: A little more HTML tweaking. Not perfect, but enough for the day., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 6304b64 191/224: Suggest `M-x enable-paredit-mode RET'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit b68216f 197/224: Add news item about changes to HTML reference., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit cde0dbb 199/224: Note nicer slurpage into an empty list in NEWS., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit d36f200 200/224: Add autoload cookie for `enable-paredit-mode'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit bf19566 198/224: Note omission of `backward-down-list' in NEWS., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 848a68b 204/224: Bump version number 24->25., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 35dc7b1 207/224: Appease `version-to-list' syntax in Version: keyword., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 9a696fd 208/224: Make the mode line lighter a configurable variable., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 7c27746 211/224: Fix some wording about paredit-space-for-delmiter-predicates., ELPA Syncer, 2021/08/07