Subject: bug#63132: Bug on Darwin MacOS with 'M-x man RET commandname[ ]'

From: Arteen1000 <[email-masked]>
Date: Fri, 28 Apr 2023 08:18:27 -0700

The reason I do it is to get the ‘man 2 read’ page. I believe the issue is primarily caused by call to ‘man -k ^2’ and ‘man -k ^’ from Man-completion-table but I am unsure. The advice defined doesn’t work on Linux VM (makes it crash) but works on MacOS, so I am not sure why exactly this is.

> On Apr 28, 2023, at 3:43 AM, Eli Zaretskii <[email-masked]> wrote:
> 
> 
>> 
>> Cc: [email-masked]
>> Date: Fri, 28 Apr 2023 10:49:30 +0300
>> From: Eli Zaretskii <[email-masked]>
>> 
>>> (define-advice man (:around (orig-func &rest args) no-completing-read)
>>> 
>>>  "Inhibit `completing-read'."
>> 
>> Please tell what is wrong with the arguments passed to the 'man'
>> commands, so I could think about fixing that without any advices.
> 
> I think I understand the issue now: it happens inside
> Man-completion-table, right?
> 
> But then I don't understand the situation: why would someone type
> "M-x man RET 2 ", with the trailing space?  Is this simply a mistake
> on behalf of the user?
> 
> Stefan, any ideas how we can catch this situation?  I don't think we
> can blindly remove the trailing whitespace, since this could be
> meaningful in completion?