From 6e0b2eafa652e431442cc43e2bdae5dc301f5db0 Mon Sep 17 00:00:00 2001 From: Ethan Leba Date: Sat, 11 Dec 2021 13:57:44 -0500 Subject: [PATCH 1/2] fix(default): only use `woman` on macOS `man -k "^"` is very slow on macOS. ``` sh-3.2$ time man -k "^" > /dev/null real 0m1.599s user 0m0.391s sys 0m1.209s ``` --- modules/config/default/autoload/default.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/config/default/autoload/default.el b/modules/config/default/autoload/default.el index 6a56f8c74..1f9d70cea 100644 --- a/modules/config/default/autoload/default.el +++ b/modules/config/default/autoload/default.el @@ -18,10 +18,13 @@ If ARG (universal argument), runs `compile' from the current directory." ;;;###autoload (defun +default/man-or-woman () - "Invoke `man' if man is installed, otherwise use `woman'." + "Invoke `man' if man is installed and the platform is not MacOS, otherwise use `woman'. + +`man -k \"^\"` is very slow on MacOS, which is what `Man-completion-table' uses to +generate `completing-read' candidates." (interactive) (call-interactively - (if (executable-find "man") + (if (and (not IS-MAC) (executable-find "man")) #'man #'woman))) From d720b29cd3737a30d8124231b9b873343074d5b7 Mon Sep 17 00:00:00 2001 From: Ethan Leba Date: Wed, 15 Dec 2021 09:38:08 -0500 Subject: [PATCH 2/2] feat(default): set woman manpath with man if able --- modules/config/default/config.el | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/config/default/config.el b/modules/config/default/config.el index 239ba8805..e1c90c043 100644 --- a/modules/config/default/config.el +++ b/modules/config/default/config.el @@ -51,6 +51,16 @@ (setq-local epa-file-encrypt-to (default-value 'epa-file-encrypt-to))))) +(after! woman + ;; The woman-manpath default value does not necessarily match man. If we have + ;; man available but aren't using it for performance reasons, we can extract + ;; it's manpath. + (when (executable-find "man") + (setq woman-manpath + (split-string (cdr (doom-call-process "man" "--path")) + path-separator t)))) + + (use-package! drag-stuff :defer t :init