[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/paredit d1b562b 133/224: Fix `paredit-backslash' within a
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/paredit d1b562b 133/224: Fix `paredit-backslash' within a character literal. |
Date: |
Sat, 7 Aug 2021 09:22:35 -0400 (EDT) |
branch: elpa/paredit
commit d1b562b9c81c5582f943e2a8958fb96f9820f420
Author: Taylor R Campbell <campbell@mumble.net>
Commit: Taylor R Campbell <campbell@mumble.net>
Fix `paredit-backslash' within a character literal.
Ignore-this: ce30323a4077d83acc1967af18604e40
Put the new escape after the one the point is on; don't split it.
darcs-hash:20110411225316-00fcc-1c65c221a9878047104d5fed02a60f48f0641f7b
---
paredit.el | 38 ++++++++++++++++++++------------------
1 file changed, 20 insertions(+), 18 deletions(-)
diff --git a/paredit.el b/paredit.el
index b13ca92..611c9b6 100644
--- a/paredit.el
+++ b/paredit.el
@@ -966,25 +966,27 @@ If not in a string, act as `paredit-doublequote'; if no
prefix argument
(defun paredit-backslash ()
"Insert a backslash followed by a character to escape."
(interactive)
+ (cond ((paredit-in-string-p) (paredit-backslash-interactive))
+ ((paredit-in-comment-p) (insert ?\\))
+ ((paredit-in-char-p) (forward-char) (paredit-backslash-interactive))
+ (t (paredit-backslash-interactive))))
+
+(defun paredit-backslash-interactive ()
(insert ?\\ )
- ;; Can't call `paredit-in-comment-p' unless `paredit-in-string-p'
- ;; gives false. Read this as simply (not (paredit-in-comment-p)).
- (if (or (paredit-in-string-p)
- (not (paredit-in-comment-p)))
- ;; Read a character to insert after the backslash. If anything
- ;; goes wrong -- the user hits delete (entering the rubout
- ;; `character'), aborts with C-g, or enters non-character input
- ;; -- then delete the backslash to avoid a dangling escape.
- (let ((delete-p t))
- (unwind-protect
- (let ((char (read-char "Character to escape: ")))
- (if (not (eq char ?\^?))
- (progn (message "Character to escape: %c" char)
- (insert char)
- (setq delete-p nil))))
- (if delete-p
- (progn (message "Deleting escape.")
- (backward-delete-char 1)))))))
+ ;; Read a character to insert after the backslash. If anything
+ ;; goes wrong -- the user hits delete (entering the rubout
+ ;; `character'), aborts with C-g, or enters non-character input
+ ;; -- then delete the backslash to avoid a dangling escape.
+ (let ((delete-p t))
+ (unwind-protect
+ (let ((char (read-char "Character to escape: ")))
+ (if (not (eq char ?\^?))
+ (progn (message "Character to escape: %c" char)
+ (insert char)
+ (setq delete-p nil))))
+ (if delete-p
+ (progn (message "Deleting escape.")
+ (backward-delete-char 1))))))
(defun paredit-newline ()
"Insert a newline and indent it.
- [nongnu] elpa/paredit b033174 015/224: Changes for version 19., (continued)
- [nongnu] elpa/paredit b033174 015/224: Changes for version 19., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit ff2cbab 018/224: Bump version number: 21 -> 22 beta., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 27a4b80 020/224: Fix indentation in definition of `paredit-initialize-comment-dwim'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit cd079c4 026/224: Bump copyright year., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 25e444c 056/224: Omit optional argument `yank-handler' in `paredit-kill-region'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 125b8b6 097/224: Fix docstring for `paredit-test-failure-function' in test.el., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 135c940 068/224: Count carefully at end of buffer in `paredit-count-sexps-forward'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 26ddb8a 076/224: Show point in `paredit-open-square' example., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit de2dc8e 127/224: Add some trivial tests for `paredit-wrap-sexp'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 2463273 130/224: Add tests for region deletion across comment boundaries., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit d1b562b 133/224: Fix `paredit-backslash' within a character literal.,
ELPA Syncer <=
- [nongnu] elpa/paredit 239e065 136/224: Expand `paredit-kill' tests a little., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 9780ff5 150/224: Add CREDITS file from 2011-05-08. Needs some additions since then., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit e01d5d9 151/224: Add `megane' from a slightly newer list of credits, 2011-08-30., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 72b1fc7 152/224: Bump copyright year to 2013., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 2186c7e 155/224: Update URI references: nix paredit-23.el, add Git repository., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 427d8e1 160/224: Add a pile of `paredit-backward-barf-sexp' tests., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 758c896 170/224: Add some notes for version 24., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 4fdd1b7 172/224: In test.el, use (delete-char -1), not backward-delete-char., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 4c7ac6e 173/224: Avoid `backward-delete-char', which GNU Emacs 24 broke., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit db99ca6 176/224: Note `backward-delete-char' lossage in NEWS., ELPA Syncer, 2021/08/07