diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2023-03-12 09:54:01 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2023-03-12 09:54:01 -0700 |
commit | f63cf0811c8d1da68d2d5acd28842918777e2832 (patch) | |
tree | c113929122c82abcb61bfcb551eda45bb3a6ddd9 | |
parent | 87f5a21570517f3ce282874ca243dee55236055c (diff) | |
download | dotfiles-f63cf0811c8d1da68d2d5acd28842918777e2832.tar.gz |
spw/dired-copy-filename-as-kill: call dired-guess-default
-rw-r--r-- | .emacs.d/init.el | 8 |
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) |