[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/easy-kill 5226660 01/14: Fix #16: New user variable eas
From: |
Stefan Monnier |
Subject: |
[elpa] externals/easy-kill 5226660 01/14: Fix #16: New user variable easy-kill-unhighlight-key |
Date: |
Mon, 15 Mar 2021 22:20:15 -0400 (EDT) |
branch: externals/easy-kill
commit 522666061a1e7c8cbe3fea79238e9a988ebdba31
Author: Leo Liu <sdl.web@gmail.com>
Commit: Leo Liu <sdl.web@gmail.com>
Fix #16: New user variable easy-kill-unhighlight-key
---
README.rst | 5 +++++
easy-kill.el | 34 ++++++++++++++++++++++++----------
2 files changed, 29 insertions(+), 10 deletions(-)
diff --git a/README.rst b/README.rst
index 02ad57b..4e109f8 100644
--- a/README.rst
+++ b/README.rst
@@ -95,6 +95,11 @@ convention, or by defining new functions named like
NEWS
~~~~
+0.9.4
++++++
+
+#. New user variable ``easy-kill-unhighlight-key``.
+
0.9.3
+++++
diff --git a/easy-kill.el b/easy-kill.el
index 5db6823..449a763 100644
--- a/easy-kill.el
+++ b/easy-kill.el
@@ -3,7 +3,8 @@
;; Copyright (C) 2013-2014 Free Software Foundation, Inc.
;; Author: Leo Liu <sdl.web@gmail.com>
-;; Version: 0.9.3
+;; Version: 0.9.4
+;; Package-Type: simple
;; Package-Requires: ((emacs "24") (cl-lib "0.5"))
;; Keywords: killing, convenience
;; Created: 2013-08-12
@@ -88,6 +89,11 @@ deprecated."
(choice string (const :tag "None" nil))))
:group 'killing)
+(defcustom easy-kill-unhighlight-key nil
+ "Key sequence if non-nil to unhighlight the kill candidate."
+ :type '(choice (const :tag "None" nil) key-sequence)
+ :group 'killing)
+
(defcustom easy-kill-try-things '(url email line)
"A list of things for `easy-kill' to try."
:type '(repeat symbol)
@@ -171,6 +177,9 @@ The value is the function's symbol if non-nil."
"Build the keymap according to `easy-kill-alist'."
(let ((map (make-sparse-keymap)))
(set-keymap-parent map easy-kill-base-map)
+ (when easy-kill-unhighlight-key
+ (with-demoted-errors "easy-kill-unhighlight-key: %S"
+ (define-key map easy-kill-unhighlight-key 'easy-kill-unhighlight)))
(mapc (lambda (c)
;; (define-key map (vector meta-prefix-char c) 'easy-kill-select)
(define-key map (char-to-string c) 'easy-kill-thing))
@@ -339,10 +348,10 @@ candidate property instead."
(interprogram-paste-function nil))
(kill-new (if (and (easy-kill-get append) kill-ring)
(cl-labels ((join (x sep y)
- (if sep (concat (easy-kill-trim x 'right)
- sep
- (easy-kill-trim y 'left))
- (concat x y))))
+ (if sep (concat (easy-kill-trim x 'right)
+ sep
+ (easy-kill-trim y 'left))
+ (concat x y))))
(join (car kill-ring)
(nth 2 (cl-rassoc (easy-kill-get thing)
easy-kill-alist :key #'car))
@@ -522,6 +531,11 @@ checked."
(setq deactivate-mark t)
(easy-kill-echo "Appended")))
+(put 'easy-kill-unhighlight 'easy-kill-exit t)
+(defun easy-kill-unhighlight ()
+ (interactive)
+ (easy-kill-echo "`%s' copied" (easy-kill-get thing)))
+
(defun easy-kill-exit-p (cmd)
(and (symbolp cmd) (get cmd 'easy-kill-exit)))
@@ -625,11 +639,11 @@ inspected."
(if (or (easy-kill-get mark) (easy-kill-bounds-of-thing-at-point 'url))
(easy-kill-thing 'url nil t)
(cl-labels ((get-url (text)
- (when (stringp text)
- (with-temp-buffer
- (insert text)
- (pcase (easy-kill-bounds-of-thing-at-point 'url)
- (`(,beg . ,end) (buffer-substring beg end)))))))
+ (when (stringp text)
+ (with-temp-buffer
+ (insert text)
+ (pcase (easy-kill-bounds-of-thing-at-point 'url)
+ (`(,beg . ,end) (buffer-substring beg end)))))))
(cl-dolist (p '(help-echo shr-url w3m-href-anchor))
(pcase (get-char-property-and-overlay (point) p)
(`(,text . ,ov)
- [elpa] externals/easy-kill 02dcebc 02/14: Implement easy-kill-delete-region., (continued)
- [elpa] externals/easy-kill 02dcebc 02/14: Implement easy-kill-delete-region., Stefan Monnier, 2021/03/15
- [elpa] externals/easy-kill 288f309 03/14: Fix a compiler warning on 24.4+, Stefan Monnier, 2021/03/15
- [elpa] externals/easy-kill bf28f77 04/14: Add `D' for selecting current defun name, Stefan Monnier, 2021/03/15
- [elpa] externals/easy-kill 5060d01 11/14: Fix #29: New command easy-kill-cycle, Stefan Monnier, 2021/03/15
- [elpa] externals/easy-kill 3ca8018 05/14: Check boundary in easy-kill-bounds-of-thing-at-point, Stefan Monnier, 2021/03/15
- [elpa] externals/easy-kill e2b667f 10/14: Merge pull request #27 from syohex/fix-doc, Stefan Monnier, 2021/03/15
- [elpa] externals/easy-kill c73aa3b 12/14: New macro easy-kill-defun to simplify defining some commands, Stefan Monnier, 2021/03/15
- [elpa] externals/easy-kill 7056376 07/14: Fix #25: Avoid using `<=' feature from 24.4, Stefan Monnier, 2021/03/15
- [elpa] externals/easy-kill 2a6309d 14/14: Limit easy-kill-exchange-point-and-mark to easy-mark only, Stefan Monnier, 2021/03/15
- [elpa] externals/easy-kill af56568 08/14: Fix #26: Make easy-kill-unhighlight save selection candidate, Stefan Monnier, 2021/03/15
- [elpa] externals/easy-kill 5226660 01/14: Fix #16: New user variable easy-kill-unhighlight-key,
Stefan Monnier <=
- [elpa] externals/easy-kill 17994a0 09/14: Fix document, Stefan Monnier, 2021/03/15
- [elpa] externals/easy-kill 5b4ae1e 13/14: Introduce easy-kill-cycle-ignored to opt out of cycling, Stefan Monnier, 2021/03/15
- [elpa] externals/easy-kill cf5488a 06/14: Merge pull request #20 from knu/delete-region, Stefan Monnier, 2021/03/15