summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2023-03-12 09:54:01 -0700
committerSean Whitton <spwhitton@spwhitton.name>2023-03-12 09:54:01 -0700
commitf63cf0811c8d1da68d2d5acd28842918777e2832 (patch)
treec113929122c82abcb61bfcb551eda45bb3a6ddd9
parent87f5a21570517f3ce282874ca243dee55236055c (diff)
downloaddotfiles-f63cf0811c8d1da68d2d5acd28842918777e2832.tar.gz
spw/dired-copy-filename-as-kill: call dired-guess-default
-rw-r--r--.emacs.d/init.el8
1 files changed, 7 insertions, 1 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el
index 3d650c34..b67d817c 100644
--- a/.emacs.d/init.el
+++ b/.emacs.d/init.el
@@ -3102,7 +3102,13 @@ mutt's review view, after exiting EDITOR."
(insert string)
(just-one-space)
(when empty-p
- (goto-char eshell-last-output-end))))))
+ (goto-char eshell-last-output-end)
+ (when-let* ((default (dired-guess-default files)))
+ (if (listp default)
+ (let ((completion-at-point-functions
+ (list (lambda () (list (point) (point) default)))))
+ (completion-at-point))
+ (insert default))))))))
(spw/feature-define-keys dired
"!" #'spw/dired-copy-filename-as-kill
"&" #'spw/dired-copy-filename-as-kill)