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#60562: [PATCH] Fix split-string error if there is a space in the filename. Date: Sat, 07 Jan 2023 11:29:58 +0200 Message-ID: <834jt2u1yh.fsf@gnu.org> References: <87zgawgfic.fsf@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="317"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60562@debbugs.gnu.org, lx@shellcodes.org To: Robert Pluim Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 07 10:30:09 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 1pE5Wj-000AV5-7K for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 07 Jan 2023 10:30:09 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pE5Wh-0003ke-CK; Sat, 07 Jan 2023 04:30:07 -0500 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 1pE5Wd-0003kC-F1 for bug-gnu-emacs@gnu.org; Sat, 07 Jan 2023 04:30:03 -0500 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 1pE5Wc-00035g-K9 for bug-gnu-emacs@gnu.org; Sat, 07 Jan 2023 04:30:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pE5Wc-0001JW-En for bug-gnu-emacs@gnu.org; Sat, 07 Jan 2023 04:30:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 07 Jan 2023 09:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60562 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 60562-submit@debbugs.gnu.org id=B60562.16730837875004 (code B ref 60562); Sat, 07 Jan 2023 09:30:02 +0000 Original-Received: (at 60562) by debbugs.gnu.org; 7 Jan 2023 09:29:47 +0000 Original-Received: from localhost ([127.0.0.1]:56453 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pE5WM-0001Ie-S0 for submit@debbugs.gnu.org; Sat, 07 Jan 2023 04:29:47 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:34482) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pE5WL-0001IQ-1s for 60562@debbugs.gnu.org; Sat, 07 Jan 2023 04:29:45 -0500 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 1pE5WE-000336-4w; Sat, 07 Jan 2023 04:29:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=5pk2ydzkdQvfRcfxv19wudt5BdVZnrtPkvIJUnAbnWM=; b=dvWX/gKTIXrH go00ncxecaYIL/UJTy5AWwghRIfxdMzVAuJcjZHNNPPV/W+pppOAf+C2UCFIfrn2RTEFaUsxIqZvt DZ5WsXMc8bOptxIvM1wQTghFc4RzcdammGs+sIXk2C3OEQp9mW/ImPzsoA0YYLJF4K8rKWuiYuk0W fA1GHseb6gG3qXLvS+cPvErDoVtWo4PqPZ0Bb7Rc1BH78HjuIiuxC+K/F74D1J+GYqx7IVry66fE3 ht3p3Lg0TA02/+yZMJnU4RIK3dNRA73QXBBP+PFbAdCIUnpCC8zjatqYiAZn0H8PCzzD8kPcDZsvz tHjmhQKfawa6drwEf/eE1A==; 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 1pE5WD-0000j8-JW; Sat, 07 Jan 2023 04:29:37 -0500 In-Reply-To: <87zgawgfic.fsf@gmail.com> (message from Robert Pluim on Fri, 06 Jan 2023 10:48:43 +0100) 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:252776 Archived-At: > Cc: 60562@debbugs.gnu.org > From: Robert Pluim > Date: Fri, 06 Jan 2023 10:48:43 +0100 > > >>>>> On Thu, 5 Jan 2023 06:56:05 +0800, lux said: > > lux> * lisp/htmlfontify.el (hfy-list-files): Specify separator (\n\r). > lux> --- > lux> lisp/htmlfontify.el | 5 +++-- > lux> 1 file changed, 3 insertions(+), 2 deletions(-) > > lux> diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el > lux> index c989a12d205..be020b6b1c5 100644 > lux> --- a/lisp/htmlfontify.el > lux> +++ b/lisp/htmlfontify.el > lux> @@ -1826,8 +1826,9 @@ hfy-list-files > lux> ;;(message "hfy-list-files");;DBUG > lux> ;; FIXME: this changes the dir of the current buffer. Is that right?? > lux> (cd directory) > lux> - (mapcar (lambda (F) (if (string-match "^./\\(.*\\)" F) (match-string 1 F) F)) > lux> - (split-string (shell-command-to-string hfy-find-cmd))) ) > lux> + (remove-if #'string-empty-p > lux> + (mapcar (lambda (F) (if (string-match "^./\\(.*\\)" F) (match-string 1 F) F)) > lux> + (split-string (shell-command-to-string hfy-find-cmd) "[\n\r]+")) )) > > You can avoid the issue (and improve portability) by using > `directory-files-recursively' instead of `find' Right. Would you like to rewrite the patch using directory-files-recursively? > (which is annoyingly > hard to remember, since the obvious search leads to > `list-directory'. Perhaps we should add `list-directory-recursively' > as an alias?) How did you search for it?