diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-26 10:16:12 -0400 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-26 10:16:12 -0400 |
| commit | 1320172999ca3dbe8cd1affaeafacad45df9ae76 (patch) | |
| tree | 9416a26b1ca37e1487bc2c7216856876cb93ea69 /tests | |
| parent | 2e1cdc287039a5e37dedc1bc8b6ad846dd659f00 (diff) | |
| download | dotemacs-1320172999ca3dbe8cd1affaeafacad45df9ae76.tar.gz dotemacs-1320172999ca3dbe8cd1affaeafacad45df9ae76.zip | |
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.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test-dirvish-config--dired-keys.el | 23 |
1 files changed, 23 insertions, 0 deletions
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 |
