fix(default): read correct manpath on MacOS

Versions of `man` shipped with the latest MacOS do not support the
`--path` argument, which causes `M-x woman` in Emacs to break. However
the `manpath` command gives the same information and exists on MacOS and
Linux, at least the systems that I tested. Check for its existence, and
if there is no `manpath` command then fall back to the logic that
existed before.

Fix: #7021
This commit is contained in:
John Goff 2024-01-24 12:31:20 -05:00 committed by GitHub
parent 2853982447
commit 56b6169ae7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -59,11 +59,16 @@
(after! woman (after! woman
;; The woman-manpath default value does not necessarily match man. If we have ;; 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 ;; man available but aren't using it for performance reasons, we can extract
;; it's manpath. ;; its manpath.
(when (executable-find "man") (let ((manpath (cond
(setq woman-manpath ((executable-find "manpath")
(split-string (cdr (doom-call-process "manpath"))
path-separator t))
((executable-find "man")
(split-string (cdr (doom-call-process "man" "--path")) (split-string (cdr (doom-call-process "man" "--path"))
path-separator t)))) path-separator t)))))
(when manpath
(setq woman-manpath manpath))))
(use-package! drag-stuff (use-package! drag-stuff