GNU bug report logs - #63132
Bug on Darwin MacOS with 'M-x man RET commandname[ ]'

Previous Next

Package: emacs;

Reported by: asocial-hired.0l <at> icloud.com

Date: Thu, 27 Apr 2023 21:12:01 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: asocial-hired.0l <at> icloud.com
Cc: 63132 <at> debbugs.gnu.org
Subject: bug#63132: Bug on Darwin MacOS with 'M-x man RET commandname[ ]'
Date: Fri, 28 Apr 2023 09:04:50 +0300
> 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" <bug-gnu-emacs <at> gnu.org>
> 
> 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 <RET> 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 <RET> 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))




This bug report was last modified 2 years and 47 days ago.

Previous Next


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