From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#63132: Bug on Darwin MacOS with 'M-x man RET commandname[ ]' Date: Fri, 28 Apr 2023 09:04:50 +0300 Message-ID: <837ctwsfst.fsf@gnu.org> References: <80D2DED5-3B41-4F1A-8B7E-9F0C44067461@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5268"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 63132@debbugs.gnu.org To: asocial-hired.0l@icloud.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Apr 28 08:05:25 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1psHER-000185-Km for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 28 Apr 2023 08:05:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1psHEC-0008Ga-11; Fri, 28 Apr 2023 02:05:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1psHE6-0008GK-EY for bug-gnu-emacs@gnu.org; Fri, 28 Apr 2023 02:05:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1psHE6-0005Kt-5H for bug-gnu-emacs@gnu.org; Fri, 28 Apr 2023 02:05:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1psHE5-00075t-Re for bug-gnu-emacs@gnu.org; Fri, 28 Apr 2023 02:05:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 28 Apr 2023 06:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63132 X-GNU-PR-Package: emacs Original-Received: via spool by 63132-submit@debbugs.gnu.org id=B63132.168266187427232 (code B ref 63132); Fri, 28 Apr 2023 06:05:01 +0000 Original-Received: (at 63132) by debbugs.gnu.org; 28 Apr 2023 06:04:34 +0000 Original-Received: from localhost ([127.0.0.1]:60359 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1psHDe-00075A-2U for submit@debbugs.gnu.org; Fri, 28 Apr 2023 02:04:34 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:34844) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1psHDZ-00074u-WA for 63132@debbugs.gnu.org; Fri, 28 Apr 2023 02:04:32 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1psHDS-0005J0-N4; Fri, 28 Apr 2023 02:04:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=pWkeIBjEtqkWK3cpvibpLIZ+LB/bv8ds3q1+6vZUyys=; b=IlvLiznlcgyfoa0vkLSw MAYmej7g48pucCbeFP0n2w/8/2JMN45Oi8bt6Ex3+q/vsF5PdtUe9v5xEeMYWFI8fS70dhyMlJrq6 qwYMASreG7oETSZ40aIAv6fdjD8tbV/Xe8nIVs197TMG5ormX2fc+m4V73og1d5owGVWevNXyDH2j 9Ptq1YeE5KrzFAHDO+Dj3lfOG8m+UDB3FN/3qacOkaNFMG6aESF2+itBxOTSm9IssemRK+rBlZmez kz/CiHTVUXWXIhF/KcdY1HpHOnzatBOypTZ2yZwWrOUT2Nd5BQP1KYMrM26XlFlXPt9YypDWPjDVG 7ksPVw/MB5tLLA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1psHDM-0004oc-IX; Fri, 28 Apr 2023 02:04:17 -0400 In-Reply-To: <80D2DED5-3B41-4F1A-8B7E-9F0C44067461@gmail.com> (bug-gnu-emacs@gnu.org) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:260750 Archived-At: > Date: Thu, 27 Apr 2023 14:10:40 -0700 > From: asocial-hired.0l--- via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > Hello, > > I am running latest emacs, built today (./configure —with-native-compilation —without-pop). This is also bug in earlier versions. > > When running `M-x man command-name ` where this is a command-name followed by a space, MacOS Ventura emacs in some cases lags heavily and some cases crashes. > > I find through investigation, for example, when it is `M-x man 2[ ]`, 2 followed by a space, it performs the equivalent ‘man -k ^’ and ‘man -k ^2’ internally. On my Linux VM, running 5.14.8-arch1-1, this is a non-issue, and speaking to others on Linux systems, it is also a non-issue there. > > I have fixed this temporarily on my MacOS machine by giving man advice; however, this same advice causes man not to work on my Linux VM. > > Currently, it is a non-issue for me, but I would like to report it nonetheless. Thanks. Does the patch below give good results? diff --git a/lisp/man.el b/lisp/man.el index 479bf9f..02be396 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -664,10 +664,9 @@ Man-build-man-command (defun Man-translate-cleanup (string) "Strip leading, trailing and middle spaces." (when (stringp string) - ;; Strip leading and trailing - (if (string-match "^[ \t\f\r\n]*\\(.+[^ \t\f\r\n]\\)" string) - (setq string (match-string 1 string))) - ;; middle spaces + ;; Strip leading and trailing spaces. + (setq string (string-trim string "[ \t\f\r\n]" "[ \t\f\r\n]")) + ;; Remove middle spaces. (setq string (replace-regexp-in-string "[\t\r\n]" " " string)) (setq string (replace-regexp-in-string " +" " " string)) string))