[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 08/77: Give overlay by easy-kill-candidate higher priority
From: |
Leo Liu |
Subject: |
[elpa] 08/77: Give overlay by easy-kill-candidate higher priority |
Date: |
Sat, 05 Apr 2014 04:08:11 +0000 |
leoliu pushed a commit to branch master
in repository elpa.
commit 854d6ca006bda90dda6cb36c2514e15a0c5f1ceb
Author: Leo Liu <address@hidden>
Date: Sun Oct 6 22:20:10 2013 +0800
Give overlay by easy-kill-candidate higher priority
to avoid shadowing by other modes such as hl-line-mode. Doc fix.
---
easy-kill.el | 18 +++++++++++++-----
1 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/easy-kill.el b/easy-kill.el
index de01e73..453225d 100644
--- a/easy-kill.el
+++ b/easy-kill.el
@@ -46,6 +46,7 @@
(let ((map (make-sparse-keymap)))
(define-key map "-" 'easy-kill-shrink)
(define-key map "+" 'easy-kill-enlarge)
+ (define-key map "=" 'easy-kill-enlarge)
(mapc (lambda (d)
(define-key map (number-to-string d) 'easy-kill-digit-argument))
(number-sequence 0 9))
@@ -72,6 +73,10 @@
(defvar easy-kill-candidate nil)
(defun easy-kill-candidate ()
+ "Get the kill candidate as a string.
+If the overlay specified by variable `easy-kill-candidate' has
+non-zero length, it is the string covered by the overlay.
+Otherwise, it is the value of the overlay's candidate property."
(easy-kill-strip-trailing
(if (/= (overlay-start easy-kill-candidate)
(overlay-end easy-kill-candidate))
@@ -176,9 +181,13 @@
;;;###autoload
(defun easy-kill ()
(interactive)
- (setq easy-kill-candidate (let ((o (make-overlay (point) (point))))
- (overlay-put o 'face 'easy-kill-face)
- o))
+ (setq easy-kill-candidate
+ (let ((o (make-overlay (point) (point))))
+ (overlay-put o 'face 'easy-kill-face)
+ ;; Use higher priority to avoid shadowing by, for example,
+ ;; `hl-line-mode'.
+ (overlay-put o 'priority 999)
+ o))
(setq deactivate-mark t)
(dolist (thing (if (use-region-p)
'(region url email line)
@@ -206,8 +215,7 @@
(easy-kill-message-nolog "%s" text))
t)))
-(put 'buffer-file-name 'easy-kill-enlarge
- 'easy-kill-on-buffer-file-name)
+(put 'buffer-file-name 'easy-kill-enlarge 'easy-kill-on-buffer-file-name)
(provide 'easy-kill)
;;; easy-kill.el ends here
- [elpa] branch master updated (769f2f2 -> 0a73626), Leo Liu, 2014/04/05
- [elpa] 03/77: Fix error: wrong-type-argument number-or-marker-p nil, Leo Liu, 2014/04/05
- [elpa] 02/77: Fix error when interprogram-cut-function unset, Leo Liu, 2014/04/05
- [elpa] 05/77: Call interprogram-cut-function in easy-kill-forward, Leo Liu, 2014/04/05
- [elpa] 01/77: Initial commit, Leo Liu, 2014/04/05
- [elpa] 07/77: Rename easy-kill-forward/backward to easy-kill-enlarge/shrink, Leo Liu, 2014/04/05
- [elpa] 08/77: Give overlay by easy-kill-candidate higher priority,
Leo Liu <=
- [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