From 1320172999ca3dbe8cd1affaeafacad45df9ae76 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Fri, 26 Jun 2026 10:16:12 -0400 Subject: feat(dirvish): make dired d=diff and D=delete to match the convention dired's d was dired-flag-file-deletion and D was dired-do-delete, while the ediff diff sat on e. Bind d to the ediff diff and keep D as delete, so the d=diff / D=delete pair is consistent with C-; b and ibuffer. d no longer flags for deletion -- mark with m for batch deletes, then D. Fix the stale commentary (it called d "delete" and D "duplicate") and add which-key labels for the pair. --- tests/test-dirvish-config--dired-keys.el | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/test-dirvish-config--dired-keys.el (limited to 'tests') diff --git a/tests/test-dirvish-config--dired-keys.el b/tests/test-dirvish-config--dired-keys.el new file mode 100644 index 000000000..2df0e8db6 --- /dev/null +++ b/tests/test-dirvish-config--dired-keys.el @@ -0,0 +1,23 @@ +;;; test-dirvish-config--dired-keys.el --- dired d=diff / D=delete bindings -*- lexical-binding: t; -*- + +;;; Commentary: +;; Regression: d and D in dired (and dirvish, which uses dired-mode-map) are the +;; diff and delete pair, matching the convention under C-; b and in ibuffer. A +;; mismatch -- or a swapped which-key label -- once led to deleting a file while +;; trying to diff it. + +;;; Code: + +(require 'ert) +(add-to-list 'load-path (expand-file-name "modules" user-emacs-directory)) +(require 'dired) +(require 'dirvish-config) + +(ert-deftest test-dirvish-dired-d-diffs-D-deletes () + "Normal: dired d runs the ediff diff and D deletes, matching the d=diff / +D=delete convention used under C-; b and in ibuffer." + (should (eq (keymap-lookup dired-mode-map "d") #'cj/dired-ediff-files)) + (should (eq (keymap-lookup dired-mode-map "D") #'dired-do-delete))) + +(provide 'test-dirvish-config--dired-keys) +;;; test-dirvish-config--dired-keys.el ends here -- cgit v1.2.3