From ae04ddfb3a8527182a1f41762305059c308f0543 Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Sun, 24 Aug 2025 21:39:00 +0200 Subject: Fix find*-dired with "unusual characters" Port to use-package, which allows me to write a rantionale. --- .config/emacs/custom.el | 1 - .config/emacs/init.el | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.config/emacs/custom.el b/.config/emacs/custom.el index af500dd..935d195 100644 --- a/.config/emacs/custom.el +++ b/.config/emacs/custom.el @@ -17,7 +17,6 @@ '(enable-recursive-minibuffers t) '(epg-pinentry-mode 'loopback) '(eshell-scroll-show-maximum-output nil) - '(find-ls-option '("-exec ls -ld {} +" . "-ld")) '(font-use-system-font t) '(footnote-body-tag-spacing 1) '(footnote-section-tag "") diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 816e527..51ee017 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -852,6 +852,20 @@ UPSTREAMS is a list of fetch URLs." (my/setopt-update-list erc-modules '(log notifications stamp track) '(fill)) (my/setopt-update-list erc-track-exclude-types '("JOIN" "PART" "QUIT"))) +(use-package find-dired + :custom + (find-ls-option + ;; The default value (-default-ls) relies on 'find -ls', which + ;; escapes non-ASCII chars. + ;; The suggested alternatives (-default-exec, -default-xargs) + ;; _display_ non-ASCII chars correctly, but ls quotes filenames + ;; that contain spaces: `dired-get-filename' fails to strip them, + ;; so they cannot be visited. + ;; So go for -default-exec, *plus* -N to disable quoting + ;; altogether. That takes care of all the edge cases I tested + ;; (non-ASCII chars, spaces). + '("-exec ls -Nld {} +" . "-Nld"))) + (use-package forge ;; Auto-load after Magit, to ensure `f n' works. :after magit -- cgit v1.2.3