[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master a80f95c 007/110: Add "X" dispatch to kill a word without m
From: |
Oleh Krehel |
Subject: |
[elpa] master a80f95c 007/110: Add "X" dispatch to kill a word without moving there |
Date: |
Sat, 11 May 2019 10:15:33 -0400 (EDT) |
branch: master
commit a80f95c015b32d8bd79d6fb93f27eaad3a603e8f
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Add "X" dispatch to kill a word without moving there
* avy.el (avy-dispatch-alist): Extend.
(avy-action-kill-move): Rename from `avy-action-kill'.
(avy-action-kill-stay): New defun.
To kill a word without moving there:
1. `avy-goto-word-1' or `avy-goto-char'.
2. word's letter.
3. X.
4. words' overlay chars.
---
avy.el | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/avy.el b/avy.el
index a94b87b..20edd7b 100644
--- a/avy.el
+++ b/avy.el
@@ -120,7 +120,8 @@ If the commands isn't on the list, `avy-style' is used."
(const :tag "De Bruijn" de-bruijn))))
(defcustom avy-dispatch-alist
- '((?x . avy-action-kill)
+ '((?x . avy-action-kill-move)
+ (?X . avy-action-kill-stay)
(?m . avy-action-mark)
(?n . avy-action-copy))
"List of actions for `avy-handler-default'.
@@ -134,7 +135,8 @@ pressed during the dispatch, ACTION is set to replace the
default
:value-type (choice
(const :tag "Mark" avy-action-mark)
(const :tag "Copy" avy-action-copy)
- (const :tag "Kill" avy-action-kill))))
+ (const :tag "Kill and move point" avy-action-kill-move)
+ (const :tag "Kill" avy-action-kill-stay))))
(defcustom avy-background nil
"When non-nil, a gray background will be added during the selection."
@@ -505,13 +507,22 @@ Set `avy-style' according to COMMMAND as well."
(select-window (cdr dat))
(goto-char (car dat))))
-(defun avy-action-kill (pt)
- "Kill sexp at PT."
+(defun avy-action-kill-move (pt)
+ "Kill sexp at PT and move there."
(goto-char pt)
(forward-sexp)
(kill-region pt (point))
(message "Killed: %s" (current-kill 0)))
+(defun avy-action-kill-stay (pt)
+ "Kill sexp at PT."
+ (save-excursion
+ (goto-char pt)
+ (forward-sexp)
+ (kill-region pt (point))
+ (just-one-space))
+ (message "Killed: %s" (current-kill 0)))
+
(defun avy--process (candidates overlay-fn)
"Select one of CANDIDATES using `avy-read'.
Use OVERLAY-FN to visualize the decision overlay."
- [elpa] master 0f5e99b 030/110: avy.el: Use next-char-property-change, not next-overlay-change, (continued)
- [elpa] master 0f5e99b 030/110: avy.el: Use next-char-property-change, not next-overlay-change, Oleh Krehel, 2019/05/11
- [elpa] master 33af738 017/110: avy.el (avy-goto-word-1-above): Add, Oleh Krehel, 2019/05/11
- [elpa] master 105efc8 037/110: avy.el (avy-action-copy): Copy line for avy-goto-line, Oleh Krehel, 2019/05/11
- [elpa] master 4e4c488 020/110: Add avy-linum-mode, Oleh Krehel, 2019/05/11
- [elpa] master d644be1 016/110: avy.el (avy-goto-char-2-above): Simplify, Oleh Krehel, 2019/05/11
- [elpa] master 4dcf0a9 018/110: avy.el (avy-goto-char-2): Translate "RET" to "C-j", Oleh Krehel, 2019/05/11
- [elpa] master ba950a0 015/110: avy.el (avy-goto-char-2-above): Add, Oleh Krehel, 2019/05/11
- [elpa] master 58bc417 014/110: Escape regex metacharacters for standard isearch, Oleh Krehel, 2019/05/11
- [elpa] master 2e3c2f7 013/110: Add new command `avy-move-region', Oleh Krehel, 2019/05/11
- [elpa] master 85a384a 012/110: Add char at window start for avy-goto-subword-0, Oleh Krehel, 2019/05/11
- [elpa] master a80f95c 007/110: Add "X" dispatch to kill a word without moving there,
Oleh Krehel <=
- [elpa] master 9e61f78 006/110: avy.el: Improve defcustom :type, Oleh Krehel, 2019/05/11
- [elpa] master 5ba3602 009/110: Assign avy-action-ispell to "i", Oleh Krehel, 2019/05/11
- [elpa] master 53706d2 011/110: avy.el (avy-all-windows-alt): Change the default to nil, Oleh Krehel, 2019/05/11
- [elpa] master 4c072be 010/110: README.md (avy-goto-char-timer): Add entry, Oleh Krehel, 2019/05/11
- [elpa] master c0db364 008/110: Add avy-action-ispell to avy.el, Oleh Krehel, 2019/05/11
- [elpa] master 3b75d95 005/110: Make "C-g" and "ESC" fail silently when reading char, Oleh Krehel, 2019/05/11
- [elpa] master 5f76c9d 004/110: avy.el (avy-goto-word-0-regexp): New defcustom, Oleh Krehel, 2019/05/11
- [elpa] master 5f6dd00 001/110: avy.el (avy-action-copy): Save window and frame, Oleh Krehel, 2019/05/11
- [elpa] master 16370f9 003/110: avy.el (avy--goto): Remove obsolete alias, Oleh Krehel, 2019/05/11
- [elpa] master 730581a 002/110: avy.el: Fix compilation warning, Oleh Krehel, 2019/05/11