[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 40/77: Some improvements based on comments in #3
From: |
Leo Liu |
Subject: |
[elpa] 40/77: Some improvements based on comments in #3 |
Date: |
Sat, 05 Apr 2014 04:08:19 +0000 |
leoliu pushed a commit to branch master
in repository elpa.
commit 90bfe1824d6faf38f6a037109f47fbdba67b551d
Author: Leo Liu <address@hidden>
Date: Sat Oct 12 08:35:13 2013 +0800
Some improvements based on comments in #3
---
easy-kill.el | 24 ++++++++++++++++++------
1 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/easy-kill.el b/easy-kill.el
index 04cb42c..b7bbf76 100644
--- a/easy-kill.el
+++ b/easy-kill.el
@@ -39,16 +39,26 @@
(?l . list)
(?f . filename)
(?d . defun)
+ (?e . line)
(?b . buffer-file-name))
"A list of (CHAR . THING).
CHAR is used immediately following `easy-kill' to select THING."
:type '(repeat (cons character symbol))
:group 'killing)
+(defcustom easy-kill-try-things '(url email line)
+ "A list of things for `easy-kill' to try."
+ :type '(repeat symbol)
+ :group 'killing)
+
(defface easy-kill-selection '((t (:inherit 'secondary-selection)))
"Faced used to highlight kill candidate."
:group 'killing)
+(defface easy-kill-origin '((t (:inverse-video t :inherit 'error)))
+ "Faced used to highlight the origin."
+ :group 'killing)
+
(defvar easy-kill-base-map
(let ((map (make-sparse-keymap)))
(define-key map "-" 'easy-kill-shrink)
@@ -97,12 +107,13 @@ CHAR is used immediately following `easy-kill' to select
THING."
;; `hl-line-mode'.
(overlay-put o 'priority 999)
(when easy-kill-mark
- (let ((i (make-overlay (point) (point))))
+ (let ((i (make-overlay (point)
+ (funcall (if (eolp) #'1- #'1+) (point)))))
(overlay-put i 'priority (1+ (overlay-get o 'priority)))
- (overlay-put i 'after-string (propertize "_" 'face 'error))
+ (overlay-put i 'face 'easy-kill-origin)
(overlay-put o 'origin-indicator i)))
(setq easy-kill-candidate o)
- (dolist (thing '(url email line))
+ (dolist (thing easy-kill-try-things)
(easy-kill-thing thing n 'nomsg)
(or (string= (easy-kill-candidate) "")
(return)))
@@ -228,7 +239,7 @@ candidate property instead."
(easy-kill-adjust-candidate thing (car bounds) (cdr bounds))
(easy-kill-thing-forward (1- n))))))
(when easy-kill-mark
- (easy-kill-adjust-candidate thing))))
+ (easy-kill-adjust-candidate (overlay-get easy-kill-candidate 'thing)))))
(put 'easy-kill-region 'easy-kill-exit t)
(defun easy-kill-region ()
@@ -246,7 +257,8 @@ candidate property instead."
(let ((beg (overlay-start easy-kill-candidate))
(end (overlay-end easy-kill-candidate)))
(if (= beg end)
- (easy-kill-message-nolog "Empty region")
+ (when (called-interactively-p 'interact)
+ (easy-kill-message-nolog "Empty region"))
(set-mark beg)
(goto-char end)
(activate-mark))))
@@ -324,7 +336,7 @@ party; +, full path."
Char properties `help-echo', `shr-url' and `w3m-href-anchor' are
inspected."
(if (or easy-kill-mark (bounds-of-thing-at-point 'url))
- (easy-kill-thing 'url nil nil t)
+ (easy-kill-thing 'url nil t t)
(let ((get-url (lambda (text)
(when (stringp text)
(with-temp-buffer
- [elpa] 28/77: [remap kill-ring-save] should be a better key binding for this feature., (continued)
- [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, 2014/04/05
- [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 <=
- [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
- [elpa] 47/77: Doc fix and small tweaks, Leo Liu, 2014/04/05
- [elpa] 49/77: Work with `sexp' and `list' in nxml mode, Leo Liu, 2014/04/05
- [elpa] 52/77: Use filter-buffer-substring, Leo Liu, 2014/04/05
- [elpa] 51/77: Fix quoting error in face definitions, Leo Liu, 2014/04/05