[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/paredit 901acb8 012/224: Changes for version 16.
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/paredit 901acb8 012/224: Changes for version 16. |
Date: |
Sat, 7 Aug 2021 09:22:08 -0400 (EDT) |
branch: elpa/paredit
commit 901acb8a614c9f309365d933889e7433bed1ee90
Author: Taylor R Campbell <campbell@mumble.net>
Commit: Taylor R Campbell <campbell@mumble.net>
Changes for version 16.
- Introduced M-S (paredit-split-sexp) to split lists or strings from
the middle.
- Fixed the definition of M-; to use (kbd "M-;") to correctly
identify the key sequence meta-semicolon, not "M-;" for M hyphen
semicolon.
darcs-hash:20080928134120-00fcc-f3d0c5f1318c5cc1c4de78c69666bbc126f305fd
---
paredit.el | 31 +++++++++++++++++++++++++++----
1 file changed, 27 insertions(+), 4 deletions(-)
diff --git a/paredit.el b/paredit.el
index a887893..4fb7f0c 100644
--- a/paredit.el
+++ b/paredit.el
@@ -1,7 +1,7 @@
;;; -*- mode: emacs-lisp -*-
;;;;;; paredit: Parenthesis editing minor mode
-;;;;;; Version 15
+;;;;;; Version 16
;;; This code is written by Taylor Campbell (except where explicitly
;;; noted) and placed in the Public Domain. All warranties are
@@ -66,7 +66,7 @@
;;; This assumes Unix-style LF line endings.
-(defconst paredit-version 15)
+(defconst paredit-version 16)
@@ -86,7 +86,7 @@
(define-key keymap "\"" 'paredit-doublequote)
(define-key keymap "\\" 'paredit-backslash)
(define-key keymap ";" 'paredit-semicolon)
- (define-key keymap "M-;" 'paredit-comment-dwim)
+ (define-key keymap (kbd "M-;") 'paredit-comment-dwim)
;; This defies ordinary conventions, but I believe it is justified
;; and more convenient this way, to have RET be fancy and C-j
@@ -139,7 +139,8 @@
(define-key keymap (kbd "C-}") 'paredit-forward-barf-sexp)
(define-key keymap (kbd "C-(") 'paredit-backward-slurp-sexp)
(define-key keymap (kbd "C-{") 'paredit-backward-barf-sexp)
-
+ (define-key keymap (kbd "M-S") 'paredit-split-sexp)
+
keymap)
"Keymap for the paredit minor mode.
Does not work in `emacs -nw' running under Unix terminals, only in
@@ -777,6 +778,7 @@ forward past the S-expression following the point."
(interactive)
(condition-case ()
(forward-sexp)
+ ;++ Is it necessary to use UP-LIST and not just FORWARD-CHAR?
(scan-error (if (paredit-in-string-p) (forward-char) (up-list)))))
(defun paredit-backward ()
@@ -1043,6 +1045,27 @@ it was barfed."
(indent-sexp))
(goto-char beg))))
+(defun paredit-split-sexp ()
+ "Splits the list or string the point is on into two."
+ (interactive)
+ (cond ((paredit-in-string-p)
+ (delete-horizontal-space)
+ (insert "\"")
+ (save-excursion (insert " \"")))
+ ((or (paredit-in-comment-p)
+ (paredit-in-char-p))
+ (error "Invalid context for `paredit-split-sexp'"))
+ (t (let ((open (save-excursion (backward-up-list)
+ (char-after)))
+ (close (save-excursion (up-list)
+ (char-before))))
+ (delete-horizontal-space)
+ (insert close)
+ (save-excursion (insert ?\ )
+ (insert open)
+ (backward-char)
+ (indent-sexp))))))
+
;;; ----------------
- [nongnu] elpa/paredit 3f6b294 062/224: Fix comment in `paredit-forward' on `up-list' vs `forward-char'., (continued)
- [nongnu] elpa/paredit 3f6b294 062/224: Fix comment in `paredit-forward' on `up-list' vs `forward-char'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit f9ab2e7 080/224: Show point in `paredit-splice-sexp-killing-backward' example., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 0efc755 088/224: Fix typo: `imbalanced' -> `unbalanced' in `paredit-mode' docstring., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 2ed66de 092/224: Use `?\ ' rather than `?\s' to appease GNU Emacs 21., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit ace4f62 074/224: Count S-expressions more carefully in `paredit-insert-pair'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 43bf81f 028/224: Implement `paredit-copy-as-kill'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit e80ffcc 112/224: Check for expected errors in `paredit-backward-delete'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 3bf30f9 115/224: Omit redundant `paredit-backward-delete' test., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit ba0de55 120/224: Add brief docstring to `paredit-check-region-state'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 951813a 131/224: Fix `paredit-move-past-close' within a character escape., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 901acb8 012/224: Changes for version 16.,
ELPA Syncer <=
- [nongnu] elpa/paredit 602e328 011/224: Changes for version 15., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 760ae70 004/224: Changes for version 8., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 004d257 013/224: Changes for version 17., ELPA Syncer, 2021/08/07
- [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