From 3982151232928e0a1f1b695ab83c7c46d7df29c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Thu, 21 Oct 2021 22:39:39 +0200 Subject: Emacs: Don't skip dots for dired (helm) --- .emacs.d/init.el | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index c3bab31..bd29a73 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -40,6 +40,13 @@ into exps finally return `(progn ,@exps))) +(defmacro without-advice (symbol where advice &rest body) + (declare (indent 3)) + `(let ((adv-p (advice-member-p ,advice ,symbol))) + (when adv-p (advice-remove ,symbol ,advice)) + (unwind-protect (progn ,@body) + (when adv-p (advice-add ,symbol ,where ,advice))))) + (defun add-hooks (fun &rest modes) "Add a function to multiple mode hooks at once." (dolist (mode modes) @@ -177,8 +184,15 @@ ;; completion-styles '(helm-flex) ) (helm-mode 1) -(helm-ext-ff-enable-skipping-dots t) (helm-ext-minibuffer-enable-header-line-maybe t) +(helm-ext-ff-enable-skipping-dots t) +(defun dired-dont-skip-dots (&rest args) + (interactive) + (without-advice 'helm-ff-move-to-first-real-candidate :around 'helm-ext-ff-skip-dots + (if (called-interactively-p) + (call-interactively #'dired) + (apply #'dired args)))) +(set-keys [remap dired] dired-dont-skip-dots) ;;; Helm-exwm (autoload #'helm-exwm "helm-exwm" nil t) -- cgit v1.2.3