emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/embark 388201d 1/4: Add `embark-kill-ring-map` and `emb


From: ELPA Syncer
Subject: [elpa] externals/embark 388201d 1/4: Add `embark-kill-ring-map` and `embark-kill-ring-remove`
Date: Fri, 19 Nov 2021 07:57:19 -0500 (EST)

branch: externals/embark
commit 388201dbb08a83dbd5d07a7c6f1672e3cf8b0222
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Add `embark-kill-ring-map` and `embark-kill-ring-remove`
    
    See also:
    
    * 
https://github.com/minad/marginalia/commit/440e2b969ba8c33509c1e78b76ecf652c61a01d1
    * 
https://github.com/minad/consult/commit/378365f13d600b31ec23b1440bb7b239e7e18d7c
---
 embark-consult.el |  5 -----
 embark.el         | 13 +++++++++++++
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/embark-consult.el b/embark-consult.el
index bf3c17a..6c1167d 100644
--- a/embark-consult.el
+++ b/embark-consult.el
@@ -224,11 +224,6 @@ actual type."
 (setf (alist-get 'consult-register embark-collect-initial-view-alist)
       'zebra)
 
-;;; Support for consult-yank*
-
-(setf (alist-get 'consult-yank embark-collect-initial-view-alist)
-      'zebra)
-
 ;;; Bindings for consult commands in embark keymaps
 
 (define-key embark-file-map "x" #'consult-file-externally)
diff --git a/embark.el b/embark.el
index 8cf7e96..e80b636 100644
--- a/embark.el
+++ b/embark.el
@@ -138,6 +138,7 @@
     (region . embark-region-map)
     (sentence . embark-sentence-map)
     (paragraph . embark-paragraph-map)
+    (kill-ring . embark-kill-ring-map)
     (t . embark-general-map))
   "Alist of action types and corresponding keymaps.
 For any type not listed here, `embark-act' will use
@@ -471,6 +472,7 @@ arguments and more details."
   '((bookmark-delete embark--restart)
     (bookmark-rename embark--restart)
     (delete-file embark--restart)
+    (embark-kill-ring-remove embark--restart)
     (embark-recentf-remove embark--restart)
     (embark-history-remove embark--restart)
     (rename-file embark--restart)
@@ -2091,6 +2093,7 @@ which should be a string."
   '((file . grid)
     (buffer . grid)
     (symbol . list)
+    (kill-ring . zebra)
     (t . list))
   "Initial views for Embark Collect buffers by type.
 This is an alist associating completion types to either `list',
@@ -3116,6 +3119,12 @@ When called with a prefix argument OTHER-WINDOW, open 
dired in other window."
   (interactive "fJump to Dired file: \nP")
   (dired-jump other-window file))
 
+(defun embark-kill-ring-remove (text)
+  "Remove TEXT from `kill-ring'."
+  (interactive (list (completing-read "Remove from kill-ring: " kill-ring nil 
t)))
+  (embark-history-remove text)
+  (setq kill-ring (delete text kill-ring)))
+
 (defvar recentf-list)
 (defun embark-recentf-remove (file)
   "Remove FILE from the list of recent files."
@@ -3483,6 +3492,10 @@ and leaves the point to the left of it."
   ("b" byte-compile-file)
   ("R" byte-recompile-directory))
 
+(embark-define-keymap embark-kill-ring-map
+  "Keymap for `kill-ring' commands."
+  ("\\" embark-kill-ring-remove))
+
 (embark-define-keymap embark-url-map
   "Keymap for Embark url actions."
   ("RET" browse-url)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]