[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-surround c96499e91e 030/175: Extract surround-operato
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-surround c96499e91e 030/175: Extract surround-operator-alist to a customizeable variable |
Date: |
Mon, 9 Oct 2023 13:01:01 -0400 (EDT) |
branch: elpa/evil-surround
commit c96499e91e46e6a950c7870524e95d10af9870c2
Author: aheaume <aheaume@gmail.com>
Commit: Tim Harper <timcharper@gmail.com>
Extract surround-operator-alist to a customizeable variable
* Documentation to show how to integrate with paredit-evil
---
README.md | 13 +++++++++++++
surround.el | 12 ++++++++++--
2 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
old mode 100644
new mode 100755
index a01aca40cb..7a1170e359
--- a/README.md
+++ b/README.md
@@ -61,6 +61,19 @@ or to add a pair that surrounds with two ` if you enter ~:
(setq-default surround-pairs-alist (cons '(?~ ("``" . "``"))
surround-pairs-alist))
+## Add new supported operators ##
+You can add support for new operators by adding them to
`surround-operator-alist`.
+For more information do: `C-h v surround-operator-alist`.
+
+By default, surround works with `evil-change` and `evil-delete`.
+To add support for the evil-paredit package, you need to add
`evil-paredit-change`
+and `evil-paredit-delete` to `surround-operator-alist`, like so:
+
+ (add-to-list 'surround-operator-alist
+ '(evil-paredit-change . change))
+ (add-to-list 'surround-operator-alist
+ '(evil-paredit-delete . delete))
+
## Usage examples ##
Here are some usage examples (taken from
diff --git a/surround.el b/surround.el
old mode 100644
new mode 100755
index 72d726df7f..6564c3dbd6
--- a/surround.el
+++ b/surround.el
@@ -65,6 +65,15 @@ This only affects inserting pairs, not deleting or changing
them."
(symbol :tag "Surround pair"))))
(make-variable-buffer-local 'surround-pairs-alist)
+(defcustom surround-operator-alist
+ '((evil-change . change)
+ (evil-delete . delete))
+ "Association list of operators to their fundamental operation.
+Each item is of the form (OPERATOR . OPERATION)."
+ :group 'surround
+ :type '(repeat (cons (symbol :tag "Operator")
+ (symbol :tag "Operation"))))
+
(defvar surround-read-tag-map
(let ((map (copy-keymap minibuffer-local-map)))
(define-key map ">" 'exit-minibuffer)
@@ -197,8 +206,7 @@ Otherwise call `surround-delete'."
;; abort the calling operator
(setq evil-inhibit-operator t)
(list (assoc-default evil-this-operator
- '((evil-change . change)
- (evil-delete . delete))))))
+ surround-operator-alist))))
(cond
((eq operation 'change)
(call-interactively 'surround-change))
- [nongnu] elpa/evil-surround 822a0f61c3 111/175: Make `ysw` work like `cw`, not `ce`, (continued)
- [nongnu] elpa/evil-surround 822a0f61c3 111/175: Make `ysw` work like `cw`, not `ce`, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 68f7033322 138/175: optionally keep xml attributes, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 31b895f1e1 128/175: fix #143: add readme entry on how to add new pairs through evil, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 5ad01dfa86 139/175: optionally keep xml attrs: add more tests, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround b670e5f338 143/175: Checking minibuffer window doesn't seem to make a difference either, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround f6162a7b5a 117/175: closes #112, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 4fbe6bf9ca 161/175: Limit global activation to text-, prog- and comint-mode, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 0d860be741 174/175: Fix get-delims to allow functions as values, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 648da3c544 159/175: Merge pull request #190 from MintSoup/master, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 0f629b8f9c 133/175: tweak implementation file header, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround c96499e91e 030/175: Extract surround-operator-alist to a customizeable variable,
ELPA Syncer <=
- [nongnu] elpa/evil-surround bd3909bc3e 152/175: update make emacs, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 271e22db17 001/175: Initial commit, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround fac48838ea 043/175: fixed inconsistency with vim-surround. fixes #47 and #26., ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 123b30135b 162/175: Merge pull request #191 from dalanicolai/master, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround e4e592ecee 010/175: Merge pull request #2 from epsilon47/master, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 43a2664615 104/175: update melpa badge link. thanks @agsdot, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 9b0b17f06c 145/175: merge @jamesnvc PRs #160 and #162, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround c9e1449bf3 163/175: Revert "Merge pull request #191 from dalanicolai/master", ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 07915c08d8 156/175: Fix license statement, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround a5658ee1d4 170/175: Restore old deletion strategy as backup, ELPA Syncer, 2023/10/09