Skip to content

Commit

Permalink
feat: add command binky-clean
Browse files Browse the repository at this point in the history
  • Loading branch information
eki3z committed Oct 11, 2024
1 parent 39c1a1e commit 604cbee
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions binky.el
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
(require 'subr-x)
(require 'pulse)
(require 'pcase)
(require 'crm)

(require 'dash)

Expand Down Expand Up @@ -906,6 +907,19 @@ This command will overwrite pin records by force."
(read (current-buffer))))
(run-hooks 'binky-record-update-hook))))

;;;###autoload
(defun binky-clean (&optional all)
"Cleanup records in selected buffers, files or ALL positions."
(interactive "P")
(if (null all)
(let* ((target (-uniq (--map (binky--prop it :name) binky-records)))
(selected (completing-read-multiple "[Binky] clean records in: " target)))
(setq binky-records (--remove (member (binky--prop it :name) selected)
binky-records)))
(setq binky-records nil)
(message "Cleanup all binky records."))
(run-hooks 'binky-record-update-hook))


;;; Minor mode

Expand Down

0 comments on commit 604cbee

Please sign in to comment.