[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 23/77: Use parse-partial-sexp in easy-kill-bounds-of-list
From: |
Leo Liu |
Subject: |
[elpa] 23/77: Use parse-partial-sexp in easy-kill-bounds-of-list |
Date: |
Sat, 05 Apr 2014 04:08:14 +0000 |
leoliu pushed a commit to branch master
in repository elpa.
commit f4c634a8b46eabf9125ee7525d5a7fb04fe01cd3
Author: Leo Liu <address@hidden>
Date: Tue Oct 8 23:48:41 2013 +0800
Use parse-partial-sexp in easy-kill-bounds-of-list
Use ignore-errors for less noise.
---
easy-kill.el | 20 +++++++++-----------
1 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/easy-kill.el b/easy-kill.el
index 8e56de4..82baa79 100644
--- a/easy-kill.el
+++ b/easy-kill.el
@@ -299,18 +299,16 @@ inspected."
(save-excursion
(pcase n
(`+ (goto-char (overlay-start easy-kill-candidate))
- (with-demoted-errors (up-list -1))
- (with-demoted-errors
+ (ignore-errors
+ (up-list -1)
(cons (point) (progn (forward-sexp) (point)))))
- (`- (let ((bound (or (cdr (bounds-of-thing-at-point 'sexp)) (point))))
- (goto-char (overlay-start easy-kill-candidate))
- (with-demoted-errors
- (down-list 1)
- (while (< (point) bound) (forward-sexp 1)))
- (when (>= (point) bound)
- (let ((end (point)))
- (with-demoted-errors
- (cons (progn (forward-sexp -1) (point)) end))))))
+ (`- (let ((depth (car (parse-partial-sexp
+ (overlay-start easy-kill-candidate) (point)))))
+ (if (> depth 1)
+ (ignore-errors
+ (goto-char (scan-lists (point) -1 (1- depth)))
+ (cons (point) (progn (forward-sexp 1) (point))))
+ (bounds-of-thing-at-point 'sexp))))
(_ (error "Unsupported argument `%s'" n)))))
(defun easy-kill-on-list (n)
- [elpa] 06/77: Various bug fixes and improvements, (continued)
- [elpa] 06/77: Various bug fixes and improvements, Leo Liu, 2014/04/05
- [elpa] 09/77: Restore the ability to inspect char properties for URLs, Leo Liu, 2014/04/05
- [elpa] 04/77: Use overlay for storing kill candidate and change +/-, Leo Liu, 2014/04/05
- [elpa] 11/77: Minor tweaks to easy-kill-on-url, Leo Liu, 2014/04/05
- [elpa] 12/77: Tweak the definition of thing `region', Leo Liu, 2014/04/05
- [elpa] 13/77: New command easy-kill-region to kill current selection, Leo Liu, 2014/04/05
- [elpa] 10/77: New function easy-kill-adjust-candidate and doc fix, Leo Liu, 2014/04/05
- [elpa] 16/77: Make function easy-kill-candidate always return string, Leo Liu, 2014/04/05
- [elpa] 17/77: Fix error: (args-out-of-range 1009 1035), Leo Liu, 2014/04/05
- [elpa] 15/77: Some string and comment fixes, Leo Liu, 2014/04/05
- [elpa] 23/77: Use parse-partial-sexp in easy-kill-bounds-of-list,
Leo Liu <=
- [elpa] 20/77: Replace `enlarge' with `expand' in strings and comments, Leo Liu, 2014/04/05
- [elpa] 19/77: Add lispy treatment for +/- on list and sexp, Leo Liu, 2014/04/05
- [elpa] 14/77: Doc fix and release v0.7.0, Leo Liu, 2014/04/05
- [elpa] 22/77: Handle the case when overlay has already been destroyed, Leo Liu, 2014/04/05
- [elpa] 25/77: Fix thinko in easy-kill-backward-down, Leo Liu, 2014/04/05
- [elpa] 21/77: New command easy-kill-mark-region, Leo Liu, 2014/04/05
- [elpa] 24/77: Improve list expand/shrink support in smie-based modes, Leo Liu, 2014/04/05
- [elpa] 18/77: Consolidate all kill features in easy-kill-thing, Leo Liu, 2014/04/05
- [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