Skip to content

Commit 995f11b

Browse files
committed
Add a command to delete history item at point
1 parent 142cf4d commit 995f11b

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## master (unreleased)
44

5+
### New features
6+
7+
- CIDER [History](https://docs.cider.mx/cider/repl/history.html): Add a command to delete history item at point.
8+
59
## 1.11.0 (2023-11-07)
610

711
### New features

cider-repl-history.el

+10
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,15 @@ text from the *cider-repl-history* buffer."
567567
(with-current-buffer cider-repl-history-repl-buffer
568568
(undo)))
569569

570+
(defun cider-repl-history-delete ()
571+
"Delete history item (at point)."
572+
(interactive)
573+
(let* ((orig (point))
574+
(str (cider-repl-history-current-string orig)))
575+
(delete str cider-repl-input-history)
576+
(cider-repl-history-update)
577+
(goto-char orig)))
578+
570579
(defun cider-repl-history-setup (repl-win repl-buf history-buf &optional regexp)
571580
"Setup.
572581
REPL-WIN and REPL-BUF are where to insert commands;
@@ -685,6 +694,7 @@ HISTORY-BUF is the history, and optional arg REGEXP is a filter."
685694
(define-key map (kbd "g") #'cider-repl-history-update)
686695
(define-key map (kbd "q") #'cider-repl-history-quit)
687696
(define-key map (kbd "U") #'cider-repl-history-undo-other-window)
697+
(define-key map (kbd "D") #'cider-repl-history-delete)
688698
(define-key map (kbd "?") #'describe-mode)
689699
(define-key map (kbd "h") #'describe-mode)
690700
map))

doc/modules/ROOT/pages/repl/history.adoc

+3
Original file line numberDiff line numberDiff line change
@@ -175,4 +175,7 @@ There are a number of important keybindings in history buffers.
175175

176176
| kbd:[U]
177177
| Undo in the REPL buffer.
178+
179+
| kbd:[D]
180+
| Delete history item (at point).
178181
|===

0 commit comments

Comments
 (0)