[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 32/77: Improve easy-kill-bounds-of-list
From: |
Leo Liu |
Subject: |
[elpa] 32/77: Improve easy-kill-bounds-of-list |
Date: |
Sat, 05 Apr 2014 04:08:17 +0000 |
leoliu pushed a commit to branch master
in repository elpa.
commit 2735f9a572674a16772506633025dcda78a8303a
Author: Leo Liu <address@hidden>
Date: Thu Oct 10 16:39:43 2013 +0800
Improve easy-kill-bounds-of-list
Stricter checking for handler in easy-kill-thing.
---
easy-kill.el | 26 +++++++++++---------------
1 files changed, 11 insertions(+), 15 deletions(-)
diff --git a/easy-kill.el b/easy-kill.el
index a208594..7674150 100644
--- a/easy-kill.el
+++ b/easy-kill.el
@@ -160,8 +160,8 @@ candidate property instead."
(n (or n 1)))
(cond
((and (not inhibit-handler)
- (intern-soft (format "easy-kill-on-%s" thing)))
- (funcall (intern-soft (format "easy-kill-on-%s" thing)) n))
+ (fboundp (intern-soft (format "easy-kill-on-%s" thing))))
+ (funcall (intern (format "easy-kill-on-%s" thing)) n))
((or (eq thing (overlay-get easy-kill-candidate 'thing))
(memq n '(+ -)))
(easy-kill-thing-forward (pcase n
@@ -304,22 +304,18 @@ inspected."
(if (and (or (not bound) (> (point) bound))
(/= point (point)))
(easy-kill-backward-down (point) bound)
- point))
- (scan-error point)))
+ (goto-char point)))
+ (scan-error (goto-char point))))
(defun easy-kill-bounds-of-list (n)
(save-excursion
- (when (pcase n
- (`+ (let ((start (overlay-start easy-kill-candidate)))
- (goto-char start)
- (easy-kill-backward-up)
- (/= start (point))))
- (`- (let ((pt (point)))
- (goto-char (easy-kill-backward-down
- (point) (overlay-start easy-kill-candidate)))
- (/= pt (point))))
- (_ (error "Unsupported argument `%s'" n)))
- (cons (point) (progn (forward-sexp 1) (point))))))
+ (pcase n
+ (`+ (goto-char (overlay-start easy-kill-candidate))
+ (easy-kill-backward-up))
+ (`- (easy-kill-backward-down
+ (point) (overlay-start easy-kill-candidate)))
+ (_ (error "Unsupported argument `%s'" n)))
+ (bounds-of-thing-at-point 'sexp)))
(defun easy-kill-on-list (n)
(if (memq n '(+ -))
- [elpa] 26/77: Fix #2: just call kill-ring-save when region is active, (continued)
- [elpa] 26/77: Fix #2: just call kill-ring-save when region is active, Leo Liu, 2014/04/05
- [elpa] 27/77: Declare dependency on emacs 24, Leo Liu, 2014/04/05
- [elpa] 29/77: Merge pull request #4 from purcell/patch-1, Leo Liu, 2014/04/05
- [elpa] 31/77: Simplify the interactive form of easy-kill-thing, Leo Liu, 2014/04/05
- [elpa] 28/77: [remap kill-ring-save] should be a better key binding for this feature., Leo Liu, 2014/04/05
- [elpa] 35/77: Doc fix and release v0.8.0, Leo Liu, 2014/04/05
- [elpa] 36/77: New variable easy-kill-base-map for customising key bindings, Leo Liu, 2014/04/05
- [elpa] 33/77: Support append kill for append-next-kill and easy-kill, Leo Liu, 2014/04/05
- [elpa] 34/77: Better support for defining commands that exit easy-kill, Leo Liu, 2014/04/05
- [elpa] 30/77: Merge pull request #6 from knu/usage-remap, Leo Liu, 2014/04/05
- [elpa] 32/77: Improve easy-kill-bounds-of-list,
Leo Liu <=
- [elpa] 37/77: Make easy-kill-backward-up work better when in strings, Leo Liu, 2014/04/05
- [elpa] 38/77: Fix #3: Add command easy-mark for marking, Leo Liu, 2014/04/05
- [elpa] 39/77: Fix doc and buglets in last change, Leo Liu, 2014/04/05
- [elpa] 40/77: Some improvements based on comments in #3, Leo Liu, 2014/04/05
- [elpa] 42/77: Must reference the actual object in easy-kill-candidate, Leo Liu, 2014/04/05
- [elpa] 43/77: Add new command easy-mark-sexp, Leo Liu, 2014/04/05
- [elpa] 41/77: Tell easy-kill-append to deactivate-mark, Leo Liu, 2014/04/05
- [elpa] 44/77: Fix #7: Add new command easy-kill-abort for key C-g, Leo Liu, 2014/04/05
- [elpa] 45/77: Better origin indicator by easy-kill-indicate-origin, Leo Liu, 2014/04/05
- [elpa] 46/77: Teach easy-kill-abort to deactivate mark immediately, Leo Liu, 2014/04/05