[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/paredit 5bfc873 047/224: Fix `paredit-copy-as-kill' within
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/paredit 5bfc873 047/224: Fix `paredit-copy-as-kill' within strings. |
Date: |
Sat, 7 Aug 2021 09:22:16 -0400 (EDT) |
branch: elpa/paredit
commit 5bfc873de956a47ace140ee52919f6d1a9bc5a0f
Author: Taylor R Campbell <campbell@mumble.net>
Commit: Taylor R Campbell <campbell@mumble.net>
Fix `paredit-copy-as-kill' within strings.
Ignore-this: 231e8737beaee81622c52d580adad339
darcs-hash:20100918181620-00fcc-5774d34b56be2f3af88b6a75506da39927197baf
---
paredit.el | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/paredit.el b/paredit.el
index 59de8fc..58dbf0f 100644
--- a/paredit.el
+++ b/paredit.el
@@ -1551,6 +1551,28 @@ With a numeric prefix argument N, do `kill-line' that
many times."
(defun paredit-copy-as-kill ()
"Save in the kill ring the region that `paredit-kill' would kill."
(interactive)
+ (cond ((paredit-in-string-p)
+ (paredit-copy-as-kill-in-string))
+ ((paredit-in-comment-p)
+ (copy-region-as-kill (point) (point-at-eol)))
+ ((save-excursion (paredit-skip-whitespace t (point-at-eol))
+ (or (eolp) (eq (char-after) ?\; )))
+ ;** Be careful about trailing backslashes.
+ (save-excursion
+ (if (paredit-in-char-p)
+ (backward-char))
+ (copy-region-as-kill (point) (point-at-eol))))
+ (t (paredit-copy-sexps-as-kill))))
+
+(defun paredit-copy-as-kill-in-string ()
+ (save-excursion
+ (if (paredit-in-string-escape-p)
+ (backward-char))
+ (copy-region-as-kill (point)
+ (min (point-at-eol)
+ (cdr (paredit-string-start+end-points))))))
+
+(defun paredit-copy-sexps-as-kill ()
(save-excursion
(if (paredit-in-char-p)
(backward-char 2))
- [nongnu] elpa/paredit 7f89e54 014/224: Changes for version 18., (continued)
- [nongnu] elpa/paredit 7f89e54 014/224: Changes for version 18., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 17852a0 019/224: Call `comment-forward' as a symbol with `funcall'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 2f3db5f 021/224: Broaden `paredit-raise-sexp' to act sensibly on strings and characters., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 8ab1694 022/224: Change `paredit-comment-on-line-p' to use `comment-search-forward'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit e121b92 024/224: Clarify `paredit-insert-comment' and change its criteria for code comments., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 451ea5e 025/224: Add magic autoload comment for `paredit-mode'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit a386bdf 031/224: Call `end-of-defun' in `paredit-reindent-defun'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 0d7a39d 032/224: Un-deprecate `enable-paredit-mode' and `disable-paredit-mode'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit db3a581 037/224: Switch copying terms to GPLv3+., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit ab99e93 044/224: Simplify definition of `paredit-kill-line-in-string'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 5bfc873 047/224: Fix `paredit-copy-as-kill' within strings.,
ELPA Syncer <=
- [nongnu] elpa/paredit d265584 045/224: Fix `paredit-kill' on whitespace character literal with margin comment., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 7b31864 046/224: Check `eolp' before using `char-after' in `paredit-kill'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 30f564d 051/224: Add utilities for `check-parens' restricted to a region., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit d3723a0 059/224: Tweak second page. Remove rants and IRC reference., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 89aa6fb 057/224: Eliminate non-interactive use of `goto-line'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit b9f46b5 060/224: Rework third page to make it much more readable., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 24d2ade 053/224: Bump version: 22 beta -> 22., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 79fd488 058/224: Bump copyright year to 2011., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit c655f5c 052/224: Change header and footer to conform to elisp guidelines., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 2b094af 065/224: Bind M-? to `paredit-convolute-sexp'., ELPA Syncer, 2021/08/07