branch: externals/ivy-hydra
commit f6b3b29ad0dd0579ef1e2b1ba3b17b0311663f8b
Author: Andrew Whatson <[email protected]>
Commit: Oleh Krehel <[email protected]>

    counsel.el (counsel-compile-forget-command): Add
    
    Adds a delete action to forget commands in
    `counsel-compile-history'. This is particularly useful when persisting
    the history with `savehist'.
    
    Fixes #2290
---
 counsel.el | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/counsel.el b/counsel.el
index 9966acb..a11bc37 100644
--- a/counsel.el
+++ b/counsel.el
@@ -5996,6 +5996,14 @@ specified by the `blddir' property."
             :action #'counsel-compile--action
             :caller 'counsel-compile))
 
+(ivy-add-actions
+ 'counsel-compile
+ '(("d" counsel-compile-forget-command "delete")))
+
+(defun counsel-compile-forget-command (cmd)
+  "Delete CMD from `counsel-compile-history'."
+  (setq counsel-compile-history
+        (delete cmd counsel-compile-history)))
 
 (defun counsel-compile-env--format-hint (cands)
   "Return a formatter for compile-env CANDS."

Reply via email to