GNU bug report logs - #77944
31.0.50; M-x man on macOS fails with error

Previous Next

Package: emacs;

Reported by: Gerd Möllmann <gerd.moellmann <at> gmail.com>

Date: Sun, 20 Apr 2025 16:29:02 UTC

Severity: normal

Found in version 31.0.50

Fixed in version 31.1

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 77944 in the body.
You can then email your comments to 77944 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#77944; Package emacs. (Sun, 20 Apr 2025 16:29:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Gerd Möllmann <gerd.moellmann <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 20 Apr 2025 16:29:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Gerd Möllmann <gerd.moellmann <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 31.0.50; M-x man on macOS fails with error
Date: Sun, 20 Apr 2025 18:27:44 +0200
To reproduce with emacs -Q

M-x man RET ls RET

The man buffer shows

sed: 1: "/^[\o001-\o032][\o001-\ ...": RE error: invalid character range




In GNU Emacs 31.0.50 (build 1, aarch64-apple-darwin24.4.0, NS
 appkit-2575.50 Version 15.4.1 (Build 24E263)) of 2025-04-20 built on
 pro2
Repository revision: 6fb2a4691f4d53473c0a326d3a6c23df9008b6e8
Repository branch: master
System Description:  macOS 15.4.1

Configured using:
 'configure --cache-file
 /var/folders/1d/k_6t25f94sl83szqbf8gpkrh0000gn/T//config.cache.master
 --enable-checking=yes --with-native-compilation=no CC=clang
 'CFLAGS=-Wgnu-imaginary-constant -Wunused-result -g -g -O0 -F
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks
 -Wno-ignored-attributes -Wno-flag-enum -Wno-missing-method-return-type
 -Wno-variadic-macros -Wno-strict-prototypes -Wno-availability
 -Wno-nullability-completeness''

Configured features:
ACL DBUS GLIB GNUTLS LCMS2 LIBXML2 MODULES NOTIFY KQUEUE NS PDUMPER PNG
RSVG SQLITE3 THREADS TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM ZLIB




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77944; Package emacs. (Sun, 20 Apr 2025 18:54:01 GMT) Full text and rfc822 format available.

Message #8 received at 77944 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Gerd Möllmann <gerd.moellmann <at> gmail.com>,
 Michael Albinus <michael.albinus <at> gmx.de>
Cc: 77944 <at> debbugs.gnu.org
Subject: Re: bug#77944: 31.0.50; M-x man on macOS fails with error
Date: Sun, 20 Apr 2025 21:53:24 +0300
> From: Gerd Möllmann <gerd.moellmann <at> gmail.com>
> Date: Sun, 20 Apr 2025 18:27:44 +0200
> 
> To reproduce with emacs -Q
> 
> M-x man RET ls RET
> 
> The man buffer shows
> 
> sed: 1: "/^[\o001-\o032][\o001-\ ...": RE error: invalid character range

Micheal, that's your addition.  Are these octal escapes not portable
enough?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77944; Package emacs. (Mon, 21 Apr 2025 15:20:03 GMT) Full text and rfc822 format available.

Message #11 received at 77944 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Gerd Möllmann <gerd.moellmann <at> gmail.com>,
 77944 <at> debbugs.gnu.org
Subject: Re: bug#77944: 31.0.50; M-x man on macOS fails with error
Date: Mon, 21 Apr 2025 17:18:47 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

Hi Gerd,

>> From: Gerd Möllmann <gerd.moellmann <at> gmail.com>
>> Date: Sun, 20 Apr 2025 18:27:44 +0200
>> 
>> To reproduce with emacs -Q
>> 
>> M-x man RET ls RET
>> 
>> The man buffer shows
>> 
>> sed: 1: "/^[\o001-\o032][\o001-\ ...": RE error: invalid character range
>
> Micheal, that's your addition.  Are these octal escapes not portable
> enough?

Don't know. It was "-e '/^[\001-\032][\001-\032]*$/d'" before. I've
changed it due to problems with remote man pages, see the comment above.

This is macOS, isn't it? What does the following shell command show?

--8<---------------cut here---------------start------------->8---
# sed -e '/^[\o001-\o032][\o001-\o032]*$/d' /dev/null
--8<---------------cut here---------------end--------------->8---

If it fails, does the following work?

--8<---------------cut here---------------start------------->8---
# sed -e '/^[\001-\032][\001-\032]*$/d' /dev/null
--8<---------------cut here---------------end--------------->8---

Does 'sed --version' return something useful? Do you know which sed
version it is, otherwise?

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77944; Package emacs. (Mon, 21 Apr 2025 15:32:02 GMT) Full text and rfc822 format available.

Message #14 received at 77944 <at> debbugs.gnu.org (full text, mbox):

From: Gerd Möllmann <gerd.moellmann <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 77944 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#77944: 31.0.50; M-x man on macOS fails with error
Date: Mon, 21 Apr 2025 17:31:19 +0200
Michael Albinus <michael.albinus <at> gmx.de> writes:

Frohe Ostern!

> This is macOS, isn't it? What does the following shell command show?

Right, it's macOS.
>
> # sed -e '/^[\o001-\o032][\o001-\o032]*$/d' /dev/null
>

$ /usr/bin/sed -e '/^[\o001-\o032][\o001-\o032]*$/d' /dev/null
sed: 1: "/^[\o001-\o032][\o001-\ ...": RE error: invalid character rangeThat gives 

(I've installed the GNU sed package "gsed" for now, as a workaround.
That's why I invoke /usr/bin/sed.

> If it fails, does the following work?
>
> # sed -e '/^[\001-\032][\001-\032]*$/d' /dev/null

/usr/bin/sed -e '/^[\001-\032][\001-\032]*$/d' /dev/null
sed: 1: "/^[\001-\032][\001-\032 ...": RE error: invalid character range
>
> Does 'sed --version' return something useful? Do you know which sed
> version it is, otherwise?

It doesn't have a --version. The man page says

AUTHORS
     Diomidis D. Spinellis <dds <at> FreeBSD.org>

so I guess it's the FreeBSD one.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77944; Package emacs. (Mon, 21 Apr 2025 16:17:01 GMT) Full text and rfc822 format available.

Message #17 received at 77944 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Gerd Möllmann <gerd.moellmann <at> gmail.com>
Cc: 77944 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#77944: 31.0.50; M-x man on macOS fails with error
Date: Mon, 21 Apr 2025 18:16:40 +0200
Gerd Möllmann <gerd.moellmann <at> gmail.com> writes:

Hi Gerd,

> Frohe Ostern!

Naja, fast vorbei. Trotzdem auch fuer Dich viele Ostereier!

>> If it fails, does the following work?
>>
>> # sed -e '/^[\001-\032][\001-\032]*$/d' /dev/null
>
> /usr/bin/sed -e '/^[\001-\032][\001-\032]*$/d' /dev/null
> sed: 1: "/^[\001-\032][\001-\032 ...": RE error: invalid character range

So it isn't due to my change. GNU sed is required for this expression
anyway.

I could check whether GNU sed is in game. But I don't know what to do in
case it isn't: don't use this regexp silently? Or use something else?
What works for BSD sed?

>> Does 'sed --version' return something useful? Do you know which sed
>> version it is, otherwise?
>
> It doesn't have a --version. The man page says
>
> AUTHORS
>      Diomidis D. Spinellis <dds <at> FreeBSD.org>
>
> so I guess it's the FreeBSD one.

I see. Does of the following work with BSD sed?

--8<---------------cut here---------------start------------->8---
# sed -e '/^[[:cntrl:]][[:cntrl:]]*$/d' /dev/null
# sed -e '/^[\\o0001-\\o0032][\\o0001-\\o0032]*$/d' /dev/null
--8<---------------cut here---------------end--------------->8---

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77944; Package emacs. (Mon, 21 Apr 2025 16:42:02 GMT) Full text and rfc822 format available.

Message #20 received at 77944 <at> debbugs.gnu.org (full text, mbox):

From: Gerd Möllmann <gerd.moellmann <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 77944 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#77944: 31.0.50; M-x man on macOS fails with error
Date: Mon, 21 Apr 2025 18:41:25 +0200
Michael Albinus <michael.albinus <at> gmx.de> writes:

> I see. Does of the following work with BSD sed?
>
> # sed -e '/^[[:cntrl:]][[:cntrl:]]*$/d' /dev/null
> # sed -e '/^[\\o0001-\\o0032][\\o0001-\\o0032]*$/d' /dev/null

Neither prints an error in the shell.

I then

1 file changed, 1 insertion(+), 1 deletion(-)
lisp/man.el | 2 +-

modified   lisp/man.el
@@ -637,7 +637,7 @@ Man-init-defvars
 	       "")
              ;; Use octal numbers.  Otherwise, \032 (Ctrl-Z) would
              ;; suspend remote connections.
-	     "-e '/^[\\o001-\\o032][\\o001-\\o032]*$/d'"
+	     "-e '/^[[:cntrl:]][[:cntrl:]]*$/d'"
 	     "-e '/\e[789]/s///g'"
 	     "-e '/Reformatting page.  Wait/d'"
 	     "-e '/Reformatting entry.  Wait/d'"

built and M-x man in emacs -Q, and that works (with gsed uninstalled).
Didn't try the other one, but I could if you want me to.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77944; Package emacs. (Mon, 21 Apr 2025 17:27:02 GMT) Full text and rfc822 format available.

Message #23 received at 77944 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Gerd Möllmann <gerd.moellmann <at> gmail.com>
Cc: 77944 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#77944: 31.0.50; M-x man on macOS fails with error
Date: Mon, 21 Apr 2025 19:26:18 +0200
Gerd Möllmann <gerd.moellmann <at> gmail.com> writes:

Hi Gerd,

> I then
>
> 1 file changed, 1 insertion(+), 1 deletion(-)
> lisp/man.el | 2 +-
>
> modified   lisp/man.el
> @@ -637,7 +637,7 @@ Man-init-defvars
>  	       "")
>               ;; Use octal numbers.  Otherwise, \032 (Ctrl-Z) would
>               ;; suspend remote connections.
> -	     "-e '/^[\\o001-\\o032][\\o001-\\o032]*$/d'"
> +	     "-e '/^[[:cntrl:]][[:cntrl:]]*$/d'"
>  	     "-e '/\e[789]/s///g'"
>  	     "-e '/Reformatting page.  Wait/d'"
>  	     "-e '/Reformatting entry.  Wait/d'"
>
> built and M-x man in emacs -Q, and that works (with gsed uninstalled).

Great!

> Didn't try the other one, but I could if you want me to.

Yes, please try. [[:cntrl:]] is equal to [\\o0000-\\o0037]. Much
more than [\\o0001-\\o0032], so I'd prefer the latter.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77944; Package emacs. (Mon, 21 Apr 2025 17:56:02 GMT) Full text and rfc822 format available.

Message #26 received at 77944 <at> debbugs.gnu.org (full text, mbox):

From: Gerd Möllmann <gerd.moellmann <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 77944 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#77944: 31.0.50; M-x man on macOS fails with error
Date: Mon, 21 Apr 2025 19:55:20 +0200
Michael Albinus <michael.albinus <at> gmx.de> writes:

> Gerd Möllmann <gerd.moellmann <at> gmail.com> writes:
>
> Hi Gerd,
>
>> I then
>>
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> lisp/man.el | 2 +-
>>
>> modified   lisp/man.el
>> @@ -637,7 +637,7 @@ Man-init-defvars
>>  	       "")
>>               ;; Use octal numbers.  Otherwise, \032 (Ctrl-Z) would
>>               ;; suspend remote connections.
>> -	     "-e '/^[\\o001-\\o032][\\o001-\\o032]*$/d'"
>> +	     "-e '/^[[:cntrl:]][[:cntrl:]]*$/d'"
>>  	     "-e '/\e[789]/s///g'"
>>  	     "-e '/Reformatting page.  Wait/d'"
>>  	     "-e '/Reformatting entry.  Wait/d'"
>>
>> built and M-x man in emacs -Q, and that works (with gsed uninstalled).
>
> Great!
>
>> Didn't try the other one, but I could if you want me to.
>
> Yes, please try. [[:cntrl:]] is equal to [\\o0000-\\o0037]. Much
> more than [\\o0001-\\o0032], so I'd prefer the latter.

The second one doesn't work. It gives the error again in M-x man. Also
in the shell

/Users/gerd/emacs/github/cl-packages % sed -e '/^[\\o0001-\\o0032][\\o0001-\\o0032]*$/d' /dev/null
sed: 1: "/^[\\o0001-\\o0032][\\o ...": RE error: invalid character range

I guess I had gsed still installed when I tried that in zsh, and forgot
to add the /usr/bin/.





Reply sent to Michael Albinus <michael.albinus <at> gmx.de>:
You have taken responsibility. (Tue, 22 Apr 2025 06:53:05 GMT) Full text and rfc822 format available.

Notification sent to Gerd Möllmann <gerd.moellmann <at> gmail.com>:
bug acknowledged by developer. (Tue, 22 Apr 2025 06:53:06 GMT) Full text and rfc822 format available.

Message #31 received at 77944-done <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Gerd Möllmann <gerd.moellmann <at> gmail.com>
Cc: 77944-done <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#77944: 31.0.50; M-x man on macOS fails with error
Date: Tue, 22 Apr 2025 08:52:44 +0200
Version: 31.1

Gerd Möllmann <gerd.moellmann <at> gmail.com> writes:

Hi Gerd,

>> Yes, please try. [[:cntrl:]] is equal to [\\o0000-\\o0037]. Much
>> more than [\\o0001-\\o0032], so I'd prefer the latter.
>
> The second one doesn't work. It gives the error again in M-x man. Also
> in the shell
>
> /Users/gerd/emacs/github/cl-packages % sed -e '/^[\\o0001-\\o0032][\\o0001-\\o0032]*$/d' /dev/null
> sed: 1: "/^[\\o0001-\\o0032][\\o ...": RE error: invalid character range
>
> I guess I had gsed still installed when I tried that in zsh, and forgot
> to add the /usr/bin/.

Thanks for the check. So I've pushed a patch using [:cntrl:] to
master. Closing the bug.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77944; Package emacs. (Tue, 22 Apr 2025 07:03:01 GMT) Full text and rfc822 format available.

Message #34 received at 77944-done <at> debbugs.gnu.org (full text, mbox):

From: Gerd Möllmann <gerd.moellmann <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 77944-done <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#77944: 31.0.50; M-x man on macOS fails with error
Date: Tue, 22 Apr 2025 09:01:55 +0200
Michael Albinus <michael.albinus <at> gmx.de> writes:

> Version: 31.1
>
> Gerd Möllmann <gerd.moellmann <at> gmail.com> writes:
>
> Hi Gerd,
>
>>> Yes, please try. [[:cntrl:]] is equal to [\\o0000-\\o0037]. Much
>>> more than [\\o0001-\\o0032], so I'd prefer the latter.
>>
>> The second one doesn't work. It gives the error again in M-x man. Also
>> in the shell
>>
>> /Users/gerd/emacs/github/cl-packages % sed -e '/^[\\o0001-\\o0032][\\o0001-\\o0032]*$/d' /dev/null
>> sed: 1: "/^[\\o0001-\\o0032][\\o ...": RE error: invalid character range
>>
>> I guess I had gsed still installed when I tried that in zsh, and forgot
>> to add the /usr/bin/.
>
> Thanks for the check. So I've pushed a patch using [:cntrl:] to
> master. Closing the bug.
>
> Best regards, Michael.

Thanks for the quick fix!




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 20 May 2025 11:24:14 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Przemysław Kryger <pkryger <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 29 May 2025 16:44:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77944; Package emacs. (Thu, 29 May 2025 16:45:03 GMT) Full text and rfc822 format available.

Message #41 received at 77944-done <at> debbugs.gnu.org (full text, mbox):

From: Przemysław Kryger <pkryger <at> gmail.com>
To: 77944-done <at> debbugs.gnu.org
Subject: Re: bug#77944: 31.0.50; M-x man on macOS fails with error
Date: Thu, 29 May 2025 17:44:31 +0100
(Sorry for duplicate e-mail for some, but it seems that my previous attempt has failed.)

I can see the same issue on 30.1.50 on macOS as well, (built from:
https://github.com/jdtsmith/emacs-mac/commit/4caf8199ea11305ce5f6ca0a380cf18d200d5039).
That is, in emacs -Q

M-x man RET ls RET

yields a man buffer that shows:

sed: 1: "/^[\o001-\o032][\o001-\ ...": RE error: invalid character range

A quick check with:

M-x find-library RET man RET

shows that the line with

"-e '/^[\\o001-\\o032][\\o001-\\o032]*$/d'"

is there as well.  The same line is also present in
8881dca81c95bac1977aa2c924be173382444c4a (tip of branch emacs-30).


I can see the fix (fc5e905dc90e21b1a381bde42e22c06f45c17e16) is contained in
branch master, but it's not in branch emacs-30 yet.  Does it mean it's not
planned to be included in Emacs-30.2 (or Emacs-30.3)?

Cheers,
PK




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77944; Package emacs. (Fri, 30 May 2025 04:43:02 GMT) Full text and rfc822 format available.

Message #44 received at 77944 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Przemysław Kryger <pkryger <at> gmail.com>
Cc: 77944 <at> debbugs.gnu.org, gerd.moellmann <at> gmail.com, michael.albinus <at> gmx.de
Subject: Re: bug#77944: 31.0.50; M-x man on macOS fails with error
Date: Fri, 30 May 2025 07:42:38 +0300
> Date: Thu, 29 May 2025 17:40:35 +0100
> From: Przemysław Kryger <pkryger <at> gmail.com>
> CC: gerd.moellmann <at> gmail.com, eliz <at> gnu.org
> 
> (Sorry for duplicate e-mail for some, but it seems that my previous attempt has failed.)
> 
> I can see the same issue on 30.1.50 on macOS as well, (built from:
> https://github.com/jdtsmith/emacs-mac/commit/4caf8199ea11305ce5f6ca0a380cf18d200d5039).
> That is, in emacs -Q
> 
> M-x man RET ls RET
> 
> yields a man buffer that shows:
> 
> sed: 1: "/^[\o001-\o032][\o001-\ ...": RE error: invalid character range
> 
> A quick check with:
> 
> M-x find-library RET man RET
> 
> shows that the line with
> 
>  "-e '/^[\\o001-\\o032][\\o001-\\o032]*$/d'"
> 
> is there as well.  The same line is also present in
> 8881dca81c95bac1977aa2c924be173382444c4a (tip of branch emacs-30).
> 
> 
> I can see the fix (fc5e905dc90e21b1a381bde42e22c06f45c17e16) is contained in
> branch master, but it's not in branch emacs-30 yet.  Does it mean it's not
> planned to be included in Emacs-30.2 (or Emacs-30.3)?

Indeed, we don't plan to have the fix in Emacs 30.2.  The change is
not simple, and the handling of system-dependent idiosyncrasies in
"M-x man" is delicate and fragile, so we prefer not to risk any
breakage there.

You can, however, patch your man.el locally.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77944; Package emacs. (Fri, 30 May 2025 05:31:01 GMT) Full text and rfc822 format available.

Message #47 received at 77944 <at> debbugs.gnu.org (full text, mbox):

From: Przemysław Kryger <pkryger <at> gmail.com>
To: eliz <at> gnu.org
Cc: gerd.moellmann <at> gmail.com, 77944 <at> debbugs.gnu.org, michael.albinus <at> gmx.de
Date: Fri, 30 May 2025 06:30:46 +0100
> Indeed, we don't plan to have the fix in Emacs 30.2.

Thanks for confirmation.  Any chance to incorporate it in Emacs-30 further down
the line?

> The change is
> not simple, and the handling of system-dependent idiosyncrasies in
> "M-x man" is delicate and fragile, so we prefer not to risk any
> breakage there.

I fully support that!

> You can, however, patch your man.el locally.

For now I am setting Man-sed-command to gsed (the GNU sed available via brew on
macOS).  But that's a great idea, I will add patch it in my brew build recipe.

Cheers,
PK




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77944; Package emacs. (Sun, 15 Jun 2025 19:22:01 GMT) Full text and rfc822 format available.

Message #50 received at 77944 <at> debbugs.gnu.org (full text, mbox):

From: David Caldwell <david <at> porkrind.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 77944 <at> debbugs.gnu.org, Michael Albinus <michael.albinus <at> gmx.de>
Subject: Re: bug#77944: 31.0.50; M-x man on macOS fails with error
Date: Sun, 15 Jun 2025 12:21:29 -0700
> From: Eli Zaretskii <eliz <at> gnu.org>
> To: Przemysław Kryger <pkryger <at> gmail.com>
> Cc: 77944 <at> debbugs.gnu.org, gerd.moellmann <at> gmail.com, michael.albinus <at> gmx.de
> Subject: Re: bug#77944: 31.0.50; M-x man on macOS fails with error
> Date: Fri, 30 May 2025 07:42:38 +0300
>
> > Date: Thu, 29 May 2025 17:40:35 +0100
> > From: Przemysław Kryger <pkryger <at> gmail.com>
> > CC: gerd.moellmann <at> gmail.com, eliz <at> gnu.org
> 
> > I can see the fix (fc5e905dc90e21b1a381bde42e22c06f45c17e16) is contained in
> > branch master, but it's not in branch emacs-30 yet.  Does it mean it's not
> > planned to be included in Emacs-30.2 (or Emacs-30.3)?
>
> Indeed, we don't plan to have the fix in Emacs 30.2.  The change is
> not simple, and the handling of system-dependent idiosyncrasies in
> "M-x man" is delicate and fragile, so we prefer not to risk any
> breakage there.

What about something more surgical, like:

diff --git a/lisp/man.el b/lisp/man.el
index dcfab8d2035..060c3f99916 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -650,9 +650,11 @@ Man-init-defvars
 	     (if Man-sed-script
 		 (concat "-e '" Man-sed-script "'")
 	       "")
-             ;; Use octal numbers.  Otherwise, \032 (Ctrl-Z) would
-             ;; suspend remote connections.
-	     "-e '/^[\\o001-\\o032][\\o001-\\o032]*$/d'"
+             (if (eq system-type 'darwin)
+                 ;; Darwin sed doesn't support \o notation.
+                 "-e '/^[[:cntrl:]][[:cntrl:]]*$/d'"
+               ;; Use octal numbers.  Otherwise, \032 (Ctrl-Z) would
+               ;; suspend remote connections.
+	       "-e '/^[\\o001-\\o032][\\o001-\\o032]*$/d'")
 	     "-e '/\e[789]/s///g'"
 	     "-e '/Reformatting page.  Wait/d'"
 	     "-e '/Reformatting entry.  Wait/d'"

That way it only impacts darwin users (which are totally without it).

I'd love to not have to patch emacs or install an alternative sed...

Thanks,
  David




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77944; Package emacs. (Mon, 16 Jun 2025 06:09:02 GMT) Full text and rfc822 format available.

Message #53 received at 77944 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: David Caldwell <david <at> porkrind.org>
Cc: 77944 <at> debbugs.gnu.org, michael.albinus <at> gmx.de
Subject: Re: bug#77944: 31.0.50; M-x man on macOS fails with error
Date: Mon, 16 Jun 2025 09:08:47 +0300
> Date: Sun, 15 Jun 2025 12:21:29 -0700
> From: David Caldwell <david <at> porkrind.org>
> Cc: 77944 <at> debbugs.gnu.org, Michael Albinus <michael.albinus <at> gmx.de>
> 
> > From: Eli Zaretskii <eliz <at> gnu.org>
> > To: Przemysław Kryger <pkryger <at> gmail.com>
> > Cc: 77944 <at> debbugs.gnu.org, gerd.moellmann <at> gmail.com, michael.albinus <at> gmx.de
> > Subject: Re: bug#77944: 31.0.50; M-x man on macOS fails with error
> > Date: Fri, 30 May 2025 07:42:38 +0300
> >
> > > Date: Thu, 29 May 2025 17:40:35 +0100
> > > From: Przemysław Kryger <pkryger <at> gmail.com>
> > > CC: gerd.moellmann <at> gmail.com, eliz <at> gnu.org
> > 
> > > I can see the fix (fc5e905dc90e21b1a381bde42e22c06f45c17e16) is contained in
> > > branch master, but it's not in branch emacs-30 yet.  Does it mean it's not
> > > planned to be included in Emacs-30.2 (or Emacs-30.3)?
> >
> > Indeed, we don't plan to have the fix in Emacs 30.2.  The change is
> > not simple, and the handling of system-dependent idiosyncrasies in
> > "M-x man" is delicate and fragile, so we prefer not to risk any
> > breakage there.
> 
> What about something more surgical, like:
> 
> diff --git a/lisp/man.el b/lisp/man.el
> index dcfab8d2035..060c3f99916 100644
> --- a/lisp/man.el
> +++ b/lisp/man.el
> @@ -650,9 +650,11 @@ Man-init-defvars
>  	     (if Man-sed-script
>  		 (concat "-e '" Man-sed-script "'")
>  	       "")
> -             ;; Use octal numbers.  Otherwise, \032 (Ctrl-Z) would
> -             ;; suspend remote connections.
> -	     "-e '/^[\\o001-\\o032][\\o001-\\o032]*$/d'"
> +             (if (eq system-type 'darwin)
> +                 ;; Darwin sed doesn't support \o notation.
> +                 "-e '/^[[:cntrl:]][[:cntrl:]]*$/d'"
> +               ;; Use octal numbers.  Otherwise, \032 (Ctrl-Z) would
> +               ;; suspend remote connections.
> +	       "-e '/^[\\o001-\\o032][\\o001-\\o032]*$/d'")
>  	     "-e '/\e[789]/s///g'"
>  	     "-e '/Reformatting page.  Wait/d'"
>  	     "-e '/Reformatting entry.  Wait/d'"
> 
> That way it only impacts darwin users (which are totally without it).

I could consider this if otherwise "M-x man" is completely broken on
macOS.  Is it?

> I'd love to not have to patch emacs or install an alternative sed...

I don't understand why: installing GNU Sed should be easy, and you
don't lose anything by doing that.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77944; Package emacs. (Mon, 16 Jun 2025 08:22:01 GMT) Full text and rfc822 format available.

Message #56 received at 77944 <at> debbugs.gnu.org (full text, mbox):

From: Przemysław Kryger <pkryger <at> gmail.com>
To: eliz <at> gnu.org
Cc: 77944 <at> debbugs.gnu.org, michael.albinus <at> gmx.de, david <at> porkrind.org
Subject: Re: bug#77944: 31.0.50; M-x man on macOS fails with error
Date: Mon, 16 Jun 2025 09:20:53 +0100
> I could consider this if otherwise "M-x man" is completely broken on
> macOS. Is it?

It is. At least in my case.

> I don't understand why: installing GNU Sed should be easy, and you
> don't lose anything by doing that.

That should be relatively straight forward.  However, there's one slight
complication.  User needs to set `Man-sed-command before' before man has
been loaded.  Otherwise they need to call `(Man-init-defvars)' in order
to make the setting to be effective.  At least this is how I understood
it.

Cheers,
PK




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77944; Package emacs. (Mon, 16 Jun 2025 08:47:02 GMT) Full text and rfc822 format available.

Message #59 received at 77944 <at> debbugs.gnu.org (full text, mbox):

From: Przemysław Kryger <pkryger <at> gmail.com>
To: eliz <at> gnu.org
Cc: 77944 <at> debbugs.gnu.org, michael.albinus <at> gmx.de, david <at> porkrind.org
Subject: Re: bug#77944: 31.0.50; M-x man on macOS fails with error
Date: Mon, 16 Jun 2025 09:46:05 +0100
>> I don't understand why: installing GNU Sed should be easy, and you
>> don't lose anything by doing that.

> That should be relatively straight forward.  However, there's one
> slight complication.  User needs to set `Man-sed-command before'
> before man has been loaded.  Otherwise they need to call
> `(Man-init-defvars)' in order to make the setting to be effective.  At
> least this is how I understood it.

Please disregard what I wrote about calling `(Man-init-defvars)'.  It
was a leftover in my config from when it used to change the value of
`Man-filter-list'.  Since then I have switched to applying the patch
directly Emacs source during build.  Changing the value of
`Man-sed-command' doesn't require this.

Cheers,
PK




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77944; Package emacs. (Mon, 16 Jun 2025 09:16:01 GMT) Full text and rfc822 format available.

Message #62 received at 77944 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Przemysław Kryger <pkryger <at> gmail.com>
Cc: 77944 <at> debbugs.gnu.org, michael.albinus <at> gmx.de, david <at> porkrind.org
Subject: Re: bug#77944: 31.0.50; M-x man on macOS fails with error
Date: Mon, 16 Jun 2025 12:14:43 +0300
> From: Przemysław Kryger <pkryger <at> gmail.com>
> Cc: 77944 <at> debbugs.gnu.org, david <at> porkrind.org, michael.albinus <at> gmx.de
> Date: Mon, 16 Jun 2025 09:46:05 +0100
> 
> 
> >> I don't understand why: installing GNU Sed should be easy, and you
> >> don't lose anything by doing that.
> 
> > That should be relatively straight forward.  However, there's one
> > slight complication.  User needs to set `Man-sed-command before'
> > before man has been loaded.  Otherwise they need to call
> > `(Man-init-defvars)' in order to make the setting to be effective.  At
> > least this is how I understood it.
> 
> Please disregard what I wrote about calling `(Man-init-defvars)'.  It
> was a leftover in my config from when it used to change the value of
> `Man-filter-list'.  Since then I have switched to applying the patch
> directly Emacs source during build.  Changing the value of
> `Man-sed-command' doesn't require this.

I actually don't understand why there's a need to change
Man-sed-command.  Can't you arrange for GNU Sed to be on PATH before
the system-provided one?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77944; Package emacs. (Mon, 16 Jun 2025 09:17:02 GMT) Full text and rfc822 format available.

Message #65 received at 77944 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Przemysław Kryger <pkryger <at> gmail.com>
Cc: 77944 <at> debbugs.gnu.org, michael.albinus <at> gmx.de, david <at> porkrind.org
Subject: Re: bug#77944: 31.0.50; M-x man on macOS fails with error
Date: Mon, 16 Jun 2025 12:16:13 +0300
> From: Przemysław Kryger <pkryger <at> gmail.com>
> Cc: 77944 <at> debbugs.gnu.org, david <at> porkrind.org, michael.albinus <at> gmx.de
> Date: Mon, 16 Jun 2025 09:20:53 +0100
> 
> 
> > I could consider this if otherwise "M-x man" is completely broken on
> > macOS. Is it?
> 
> It is. At least in my case.

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?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77944; Package emacs. (Mon, 16 Jun 2025 09:24:02 GMT) Full text and rfc822 format available.

Message #68 received at 77944 <at> debbugs.gnu.org (full text, mbox):

From: Stéphane Marks <shipmints <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Przemysław Kryger <pkryger <at> gmail.com>,
 77944 <at> debbugs.gnu.org, michael.albinus <at> gmx.de, david <at> porkrind.org
Subject: Re: bug#77944: 31.0.50; M-x man on macOS fails with error
Date: Mon, 16 Jun 2025 05:23:15 -0400
[Message part 1 (text/plain, inline)]
On Mon, Jun 16, 2025 at 5:18 AM Eli Zaretskii <eliz <at> gnu.org> wrote:

> > From: Przemysław Kryger <pkryger <at> gmail.com>
> > Cc: 77944 <at> debbugs.gnu.org, david <at> porkrind.org, michael.albinus <at> gmx.de
> > Date: Mon, 16 Jun 2025 09:20:53 +0100
> >
> >
> > > I could consider this if otherwise "M-x man" is completely broken on
> > > macOS. Is it?
> >
> > It is. At least in my case.
>
> 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?
>

Running `man` Emacs 30.1 on macOS 12.7.6 /usr/bin/sed works fine for me.  I
verified that (executable-find "sed") finds /usr/bin/sed and that I do not
have GNU sed installed.  FYI, my (getenv "MANPATH") is nil, so it's system
defaults, which reminds me that I should add /usr/local/share/man, but
that's secondary.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77944; Package emacs. (Mon, 16 Jun 2025 10:02:02 GMT) Full text and rfc822 format available.

Message #71 received at 77944 <at> debbugs.gnu.org (full text, mbox):

From: "Paul D. Nelson" <ultrono <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: pkryger <at> gmail.com, 77944 <at> debbugs.gnu.org, michael.albinus <at> gmx.de,
 david <at> porkrind.org
Subject: Re: bug#77944: 31.0.50; M-x man on macOS fails with error
Date: Mon, 16 Jun 2025 12:01:36 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:
> 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?

M-x man works for me on macOS (Sequoia 15.1.1) with a relatively recent
master (3927402af0a) and no special configuration.  In a given Emacs
session, the first time time I do M-x man, it takes a long time (15+
seconds) before it prompts me to choose a manual entry, but each
subsequent use is responsive, and there are no errors.

$ which sed
/usr/bin/sed




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77944; Package emacs. (Mon, 16 Jun 2025 10:47:02 GMT) Full text and rfc822 format available.

Message #74 received at 77944 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Przemysław Kryger <pkryger <at> gmail.com>
Cc: 77944 <at> debbugs.gnu.org, michael.albinus <at> gmx.de, david <at> porkrind.org
Subject: Re: bug#77944: 31.0.50; M-x man on macOS fails with error
Date: Mon, 16 Jun 2025 13:45:54 +0300
> From: Przemysław Kryger <pkryger <at> gmail.com>
> Date: Mon, 16 Jun 2025 10:19:39 +0100
> 
> > I actually don't understand why there's a need to change
> > Man-sed-command.  Can't you arrange for GNU Sed to be on PATH before
> > the system-provided one?
> 
> This could be done, for example brew gives this advice on my system:
> 
> GNU "sed" has been installed as "gsed".
> If you need to use it as "sed", you can add a "gnubin" directory
> to your PATH from your bashrc like:
> 
>     PATH="/opt/homebrew/opt/gnu-sed/libexec/gnubin:$PATH"
> 
> However, this may have unintended consequences when something else
> relies on some peculiarity of non GNU sed installed with OS.  Unless GNU
> sed functionality is guaranteed to be a superset of the non GNU one.

I think GNU Sed is indeed a superset in its functionalities.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77944; Package emacs. (Mon, 16 Jun 2025 13:01:07 GMT) Full text and rfc822 format available.

Message #77 received at 77944 <at> debbugs.gnu.org (full text, mbox):

From: Przemysław Kryger <pkryger <at> gmail.com>
To: eliz <at> gnu.org
Cc: 77944 <at> debbugs.gnu.org, gerd.moellmann <at> gmail.com, michael.albinus <at> gmx.de,
 shipmints <at> gmail.com, david <at> porkrind.org, ultrono <at> gmail.com
Subject: Re: bug#77944: 31.0.50; M-x man on macOS fails with error
Date: Mon, 16 Jun 2025 14:00:46 +0100
> 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

In the *scratch* evaluated the following, just to make sure there are no
differences between effective PATH if make-process and a terminal:

emacs-version
   "30.1"
(executable-find "sed")
=> "/usr/bin/sed"
(shell-command-to-string (concat (executable-find "sed") " --version"))
=> "/usr/bin/sed: illegal option -- -
   usage: sed script [-EHalnru] [-i extension] [file ...]
      sed [-EHalnu] [-i extension] [-e script] ... [-f script_file] ... [file ...]
   "

So it seems that the "/usr/bin/sed" is unable to process --version
argument, while:

(shell-command-to-string (concat (executable-find "gsed") " --version"))
=> "/opt/homebrew/bin/gsed (GNU sed) 4.9
   Copyright (C) 2022 Free Software Foundation, Inc.
   License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
   This is free software: you are free to change and redistribute it.
   There is NO WARRANTY, to the extent permitted by law.

   Written by Jay Fenlason, Tom Lord, Ken Pizzini,
   Paolo Bonzini, Jim Meyering, and Assaf Gordon.

   This sed program was built without SELinux support.

   GNU sed home page: <https://www.gnu.org/software/sed/>.
   General help using GNU software: <https://www.gnu.org/gethelp/>.
   E-mail bug reports to: <bug-sed <at> gnu.org>."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77944; Package emacs. (Mon, 16 Jun 2025 13:23:02 GMT) Full text and rfc822 format available.

Message #80 received at 77944 <at> debbugs.gnu.org (full text, mbox):

From: Gerd Möllmann <gerd.moellmann <at> gmail.com>
To: Przemysław Kryger <pkryger <at> gmail.com>
Cc: 77944 <at> debbugs.gnu.org, michael.albinus <at> gmx.de, shipmints <at> gmail.com,
 david <at> porkrind.org, eliz <at> gnu.org, ultrono <at> gmail.com
Subject: Re: bug#77944: 31.0.50; M-x man on macOS fails with error
Date: Mon, 16 Jun 2025 15:22:21 +0200
Przemysław Kryger <pkryger <at> gmail.com> 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.)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77944; Package emacs. (Mon, 16 Jun 2025 19:41:02 GMT) Full text and rfc822 format available.

Message #83 received at 77944 <at> debbugs.gnu.org (full text, mbox):

From: Howard Melman <hmelman <at> gmail.com>
To: shipmints <at> gmail.com
Cc: pkryger <at> gmail.com, 77944 <at> debbugs.gnu.org, eliz <at> gnu.org,
 michael.albinus <at> gmx.de, david <at> porkrind.org
Subject: Re: bug#77944: 31.0.50; M-x man on macOS fails with error
Date: Mon, 16 Jun 2025 15:40:14 -0400
Stéphane Marks <shipmints <at> gmail.com> writes:

> On Mon, Jun 16, 2025 at 5:18 AM Eli Zaretskii <eliz <at> gnu.org> wrote:
>
>  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?
>
> Running `man` Emacs 30.1 on macOS 12.7.6 /usr/bin/sed
> works fine for me.  I verified that (executable-find
> "sed") finds /usr/bin/sed and that I do not have GNU sed
> installed.  FYI, my (getenv "MANPATH") is nil, so it's
> system defaults, which reminds me that I should add
> /usr/local/share/man, but that's secondary.

It always fails for me on macOS 15.5 (on apple silicon)
unless I have GNU sed installed.

-- 

Howard




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77944; Package emacs. (Mon, 16 Jun 2025 22:10:08 GMT) Full text and rfc822 format available.

Message #86 received at 77944 <at> debbugs.gnu.org (full text, mbox):

From: David Caldwell <david <at> porkrind.org>
To: Eli Zaretskii <eliz <at> gnu.org>, Przemysław Kryger
 <pkryger <at> gmail.com>
Cc: 77944 <at> debbugs.gnu.org, michael.albinus <at> gmx.de
Subject: Re: bug#77944: 31.0.50; M-x man on macOS fails with error
Date: Mon, 16 Jun 2025 15:08:46 -0700
On 6/16/25 2:16 AM, Eli Zaretskii wrote:
>> From: Przemysław Kryger <pkryger <at> gmail.com>
>> Cc: 77944 <at> debbugs.gnu.org, david <at> porkrind.org, michael.albinus <at> gmx.de
>> Date: Mon, 16 Jun 2025 09:20:53 +0100
>>
>>
>>> I could consider this if otherwise "M-x man" is completely broken on
>>> macOS. Is it?
>>
>> It is. At least in my case.
> 
> 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?

I ran some tests on macOS VMs I have. I don't know which ones Emacs 
officially supports. macOS 11 and below were tested on an Intel VM, and 
12 and higher were on an M1 VM. I doubt that matters though.


*** sed test:

#!/bin/bash
echo octal; printf "\001\002" | sed -e '/[\o001-\o002]/d' | od -c
echo char;  printf "\001\002" | sed -e '/[[:cntrl:]]/d' | od -c

I got 3 types of outputs with this test:

1. macOS With gnu sed the:
octal
char

2. With older macOS sed:

octal
0000000  001 002  \n
0000003
char

3. With newer macOS sed:

octal
sed: 1: "/[\o001-\o002]/d
": RE error: invalid character range
char


*** Emacs 30.1 test: `M-x man RET ascii RET`


Results
=======

OS Version    Emacs  Sed
--------------------------
macOS 10.12   works  #2
macOS 10.14   works  #2
macOS 10.15   works  #2
macOS 11      works  #2
macOS 12      works  #2
macOS 13      works  #2
macOS 14      works  #2
macOS 15      fails  #3


The interesting thing is that even on the Emacs versions that work, the 
sed script isn't actually doing what it is supposed to do. So it's 
broken but just not in an immediately fatal way.

Even the earliest version I tested supported the `[:cntrl:]` notation so 
it seems that's a good fix for macOS 15 and will work on even very old 
macOS versions.

-David





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77944; Package emacs. (Sat, 21 Jun 2025 09:36:03 GMT) Full text and rfc822 format available.

Message #89 received at 77944 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: David Caldwell <david <at> porkrind.org>
Cc: 77944 <at> debbugs.gnu.org, michael.albinus <at> gmx.de
Subject: Re: bug#77944: 31.0.50; M-x man on macOS fails with error
Date: Sat, 21 Jun 2025 12:34:53 +0300
> Date: Sun, 15 Jun 2025 12:21:29 -0700
> From: David Caldwell <david <at> porkrind.org>
> Cc: 77944 <at> debbugs.gnu.org, Michael Albinus <michael.albinus <at> gmx.de>
> 
> > From: Eli Zaretskii <eliz <at> gnu.org>
> > To: Przemysław Kryger <pkryger <at> gmail.com>
> > Cc: 77944 <at> debbugs.gnu.org, gerd.moellmann <at> gmail.com, michael.albinus <at> gmx.de
> > Subject: Re: bug#77944: 31.0.50; M-x man on macOS fails with error
> > Date: Fri, 30 May 2025 07:42:38 +0300
> >
> > > Date: Thu, 29 May 2025 17:40:35 +0100
> > > From: Przemysław Kryger <pkryger <at> gmail.com>
> > > CC: gerd.moellmann <at> gmail.com, eliz <at> gnu.org
> > 
> > > I can see the fix (fc5e905dc90e21b1a381bde42e22c06f45c17e16) is contained in
> > > branch master, but it's not in branch emacs-30 yet.  Does it mean it's not
> > > planned to be included in Emacs-30.2 (or Emacs-30.3)?
> >
> > Indeed, we don't plan to have the fix in Emacs 30.2.  The change is
> > not simple, and the handling of system-dependent idiosyncrasies in
> > "M-x man" is delicate and fragile, so we prefer not to risk any
> > breakage there.
> 
> What about something more surgical, like:
> 
> diff --git a/lisp/man.el b/lisp/man.el
> index dcfab8d2035..060c3f99916 100644
> --- a/lisp/man.el
> +++ b/lisp/man.el
> @@ -650,9 +650,11 @@ Man-init-defvars
>  	     (if Man-sed-script
>  		 (concat "-e '" Man-sed-script "'")
>  	       "")
> -             ;; Use octal numbers.  Otherwise, \032 (Ctrl-Z) would
> -             ;; suspend remote connections.
> -	     "-e '/^[\\o001-\\o032][\\o001-\\o032]*$/d'"
> +             (if (eq system-type 'darwin)
> +                 ;; Darwin sed doesn't support \o notation.
> +                 "-e '/^[[:cntrl:]][[:cntrl:]]*$/d'"
> +               ;; Use octal numbers.  Otherwise, \032 (Ctrl-Z) would
> +               ;; suspend remote connections.
> +	       "-e '/^[\\o001-\\o032][\\o001-\\o032]*$/d'")
>  	     "-e '/\e[789]/s///g'"
>  	     "-e '/Reformatting page.  Wait/d'"
>  	     "-e '/Reformatting entry.  Wait/d'"
> 
> That way it only impacts darwin users (which are totally without it).
> 
> I'd love to not have to patch emacs or install an alternative sed...

Thanks, the patch didn't apply, so I made the change by hand.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 19 Jul 2025 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 20 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.