Subject: bug#77944: 31.0.50; M-x man on macOS fails with error

From: Gerd Möllmann <[email-masked]>
Date: Mon, 16 Jun 2025 15:22:21 +0200

Przemysław Kryger <[email-masked]> writes:

>> Please disregard what I wrote about calling `(Man-init-defvars)'. [...]
>
> Actually not.  I've double checked and Man-sed-command is evaluated
> while Man-filter-list is set by Man-init-defvars.  It seems that calling
> the latter is indeed required when Man-sed-command is updated after man
> has been loaded.
>
>> Can someone please provide a comprehensive answer to this: does "M-x
>> man" always fail on all supported versions of macOS?  If not, which
>> versions are affected?
>
> It fails with Emacs 30.1 on macOS Sequoia 15.5:
>
> emacs -Q
>
> M-x man RET sed RET
>
> fails with (as in original report):
>
> sed: 1: "/^[\o001-\o032][\o001-\ ...": RE error: invalid character
> range

That was a regression introduced by a change Michael Albinus made in
Emacs 30. Michael fixed the regression on master. Before the regression,
M-x man worked fine on macOS for the last 3 years or so.

(Given that the macOS sed says the author is someone from freeBSD, I
wonder if it works on FreeBSD if it doesn't on macOS.)