From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 04 17:57:52 2023 Received: (at submit) by debbugs.gnu.org; 4 Jan 2023 22:57:52 +0000 Received: from localhost ([127.0.0.1]:49843 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pDChj-0007Ug-Kh for submit@debbugs.gnu.org; Wed, 04 Jan 2023 17:57:52 -0500 Received: from lists.gnu.org ([209.51.188.17]:54304) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pDChi-0007UZ-Cr for submit@debbugs.gnu.org; Wed, 04 Jan 2023 17:57:50 -0500 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 1pDChW-0000oU-Q9 for bug-gnu-emacs@gnu.org; Wed, 04 Jan 2023 17:57:43 -0500 Received: from out203-205-221-210.mail.qq.com ([203.205.221.210]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDChT-0006oR-Ph for bug-gnu-emacs@gnu.org; Wed, 04 Jan 2023 17:57:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1672873047; bh=fXra3zKb1UAFRQYW1IiNc4qv0m8/W8ZRpwMD5dKuvPw=; h=Date:From:To:Subject; b=dLdM8EAqNp/Jo+oOSkKYe7eSYeMi53F/Anz6cstgtCwrlEl58ck6cFpTHMNXNejiz YEiz959ZOXC9kgtA2Nu+JmvKgUQElqgzxRK9O9/2OQkKJXIVjCMztIhzUzLaTZvHbd SvADEj9Ag+KNneWeRl8UtqNZcLnhWU7Mx0A25nK8= Received: from lx-pc ([122.97.179.149]) by newxmesmtplogicsvrszc1-0.qq.com (NewEsmtp) with SMTP id E0891AC2; Thu, 05 Jan 2023 06:56:08 +0800 X-QQ-mid: xmsmtpt1672872968trye89fy0 Message-ID: X-QQ-XMAILINFO: N7h1OCCDntujsugnVjLjzn86SQOt1ptDAW8F+h4nryzrSc44edMG74hY8PwmDh LNJUbeiSax5yGkyS0aNH5uVeJoiDZa118P1C/desI6Deu5/gp01fm3wLl1a9OMofkk0/aOqnFpDa wLF7qDzf8dq9T1ReMYSEwCYBF8upO5Mv7mhbh0TLR8zvdKKiY0L97ZbG/T68rOfNx7B8ztnJvlGt vgCAcedi3GVgFWZ8zf5H0bXEv54zN1tWm15OcBN+XyG6CG3CtOYSrbkDoGbbfYsRcFfZz50ZQMsW kpoG1fXTxJDyhWU8jC+74rqT7MWWc1nRQYhMQM0OoLIbuqtpoKIFvjT1SMLE/xoC6BuHmoKQw9nc vAKsshW8kQiKr5jx/3iADE3jtDqyc7JnCYA/qdiOLoxpvjLuCgngR8Oik4Aw1qwwHxJ5htes0bYe YvaQSv61H0IZKdkIgYbfndCy7oxItS2GJqLufS54jXDo6jnuNTPpK0VXjrkOIRw+T7hTL+UQ5i6a 6FRv6SJoFhiMeMtpFVyN5v6fWF1kMBGPdwtJTm9Z03uTLm1BDUdjqBxCR631OaC/LBNj+5fa43XO ZiLI2hM/YjQf9bNXL6ZIAA2i2slG0CV1RuuXOmeotIqjpHNswUnn29MS1uvviQaOkjjOjrAJ1Fzd SsOsq2DbaVqFOqlnn8DlKPu4O9nkGKKlpaxa02nLXb8tETHXisBNj2DtDpVEqxAtNodiBL39c8ac t9gfDDcbWkTZNkqK7WUdEEuCekhjhgbFzy5FnZZMJdmVRFQMFvvs1bqorslrllK8uQuhr6ftQbY/ ROJ40Tu32daw7so/3tY/IM/abunVZkrz+wcxfN9ZvSFHQtaCnM4bLBesNpbl9bBNj+Hxk5HnZIoo RPNervVsccXMiLMIBwINcyk9Rqm7AI4SIla1yyHgMDxg9GwDjAz+PEuCrbTAPP9USQs61EeSY4 Date: Thu, 5 Jan 2023 06:56:05 +0800 From: lux To: bug-gnu-emacs@gnu.org Subject: [PATCH] Fix split-string error if there is a space in the filename. X-OQ-MSGID: <20230105065605.360d0bdc@lx-pc> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.36; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/DgBm0wPeHTKxUi1MdiNm/Sx" Received-SPF: none client-ip=203.205.221.210; envelope-from=lx@shellcodes.org; helo=out203-205-221-210.mail.qq.com X-Spam_score_int: 10 X-Spam_score: 1.0 X-Spam_bar: + X-Spam_report: (1.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HELO_DYNAMIC_IPADDR=1.951, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RDNS_DYNAMIC=0.982, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --MP_/DgBm0wPeHTKxUi1MdiNm/Sx Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline If a space in filename, hfy-list-files function error. For example: $ mkdir /tmp/test $ cd /tmp/test $ touch 'hello world.py' $ touch hi.py $ ls hello world.py hi.py In Emacs: (hfy-list-files "/tmp/test") ("hi.py" "hello" "world.py") As shown above, "hello world.py" is split into two files. --MP_/DgBm0wPeHTKxUi1MdiNm/Sx Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0001-Fix-split-string-error-if-there-is-a-space-in-the-fi.patch >From 15b9d238ddcca17004d9edce54b4b1fb80556764 Mon Sep 17 00:00:00 2001 From: Xi Lu Date: Thu, 5 Jan 2023 06:36:19 +0800 Subject: [PATCH] Fix split-string error if there is a space in the filename. * lisp/htmlfontify.el (hfy-list-files): Specify separator (\n\r). --- lisp/htmlfontify.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el index c989a12d205..be020b6b1c5 100644 --- a/lisp/htmlfontify.el +++ b/lisp/htmlfontify.el @@ -1826,8 +1826,9 @@ hfy-list-files ;;(message "hfy-list-files");;DBUG ;; FIXME: this changes the dir of the current buffer. Is that right?? (cd directory) - (mapcar (lambda (F) (if (string-match "^./\\(.*\\)" F) (match-string 1 F) F)) - (split-string (shell-command-to-string hfy-find-cmd))) ) + (remove-if #'string-empty-p + (mapcar (lambda (F) (if (string-match "^./\\(.*\\)" F) (match-string 1 F) F)) + (split-string (shell-command-to-string hfy-find-cmd) "[\n\r]+")) )) ;; strip the filename off, return a directory name ;; not a particularly thorough implementation, but it will be -- 2.39.0 --MP_/DgBm0wPeHTKxUi1MdiNm/Sx-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 06 04:48:53 2023 Received: (at 60562) by debbugs.gnu.org; 6 Jan 2023 09:48:53 +0000 Received: from localhost ([127.0.0.1]:53818 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pDjLI-0000y6-Vi for submit@debbugs.gnu.org; Fri, 06 Jan 2023 04:48:53 -0500 Received: from mail-wm1-f50.google.com ([209.85.128.50]:37753) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pDjLH-0000xu-OX for 60562@debbugs.gnu.org; Fri, 06 Jan 2023 04:48:52 -0500 Received: by mail-wm1-f50.google.com with SMTP id bg13-20020a05600c3c8d00b003d9712b29d2so3167169wmb.2 for <60562@debbugs.gnu.org>; Fri, 06 Jan 2023 01:48:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=lrtbGT3mU5gLe+ZtPXwyifHemVU8Qr8ijxzL7g3IeyI=; b=X4hTyD1LmxwU7kjlNmHME0DSEu1oFSHqh/Sz/YvvKqg4502ADlWxwHeRGL9BkM0z86 Br/0QnBKTTEEm+O1qHFRKJPdQbVq1hGuv2tSzOt/e6DcedppF4z0TqWAMhrsVOQS3Iy7 Nr6/4ej54+NTDa/7D+unoHU0UZk29oTOb14AG9BOxIP75dmQ78SODNr/IOKSEmeIdR0k aqC7w4jWiMGJTaFBDqpwOIBmKpv1z3CdO0OynfapZ/iW8F9ACD/H6m4N1qQYxbt04U1Q CVGaT76/uwvcIfNIzXG+2crepxouTLbsu3Y09IAq0UsjkHaF86OEsoFHd1lz0tHy5/Zx 0Q7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=lrtbGT3mU5gLe+ZtPXwyifHemVU8Qr8ijxzL7g3IeyI=; b=2DcoXYzC1r2/F3UNsXjnrvCWi1Y220aREW/xAMYXniwSVSVk+SgJfT63mimpTj9zyv Ed876xYwv2H+r/J2PWG9o0DOIBbBmoETMOOuRl/EeIp7sdXOH0wcxmOJue6L9AzajbWy pyflC00JQZh5RX5rDmizYgIoy0aEqoc4X9aShmLGgjSR7ZFOXZxZ43L1YdqEbp/uXRQh XpRKAiE4+l3w+lfxL3k175xBgyzd0AztxMYgkJT8+yXLW1I6lH5U3crQV/lQDE0eJSYI 3bas3d9XJsaFh/AoJL2EeupPB1AS4b2YXKtayyuXu8VMnV4+5MHyaAcU/vSTbTYmfDkf 3+6Q== X-Gm-Message-State: AFqh2kp+HaoweYnNUZJ5JWwc5sLaeGNqW6DUnxWEMaxrxE51+qhxmqTE ovb3RGuYYNdfgV1Nc2nTl+jBM1Qz5tc= X-Google-Smtp-Source: AMrXdXt/qXV+I/xXNyrFQS+btFSsFw3KozX9XjV7UT9tHyVWk5KQ8UAss1HPEzPtQZ6lCDxLYATxRA== X-Received: by 2002:a05:600c:3ca2:b0:3d9:da3a:ef9b with SMTP id bg34-20020a05600c3ca200b003d9da3aef9bmr1578621wmb.31.1672998525192; Fri, 06 Jan 2023 01:48:45 -0800 (PST) Received: from rltb ([82.66.8.55]) by smtp.gmail.com with ESMTPSA id q4-20020adff784000000b0026e94493858sm627537wrp.106.2023.01.06.01.48.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Jan 2023 01:48:44 -0800 (PST) From: Robert Pluim To: lux Subject: Re: bug#60562: [PATCH] Fix split-string error if there is a space in the filename. In-Reply-To: (lux's message of "Thu, 5 Jan 2023 06:56:05 +0800") References: Date: Fri, 06 Jan 2023 10:48:43 +0100 Message-ID: <87zgawgfic.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60562 Cc: 60562@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>>> 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' (which is annoyingly hard to remember, since the obvious search leads to `list-directory'. Perhaps we should add `list-directory-recursively' as an alias?) Robert -- From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 07 04:29:47 2023 Received: (at 60562) by debbugs.gnu.org; 7 Jan 2023 09:29:47 +0000 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 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 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==; 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 Date: Sat, 07 Jan 2023 11:29:58 +0200 Message-Id: <834jt2u1yh.fsf@gnu.org> From: Eli Zaretskii To: Robert Pluim In-Reply-To: <87zgawgfic.fsf@gmail.com> (message from Robert Pluim on Fri, 06 Jan 2023 10:48:43 +0100) Subject: Re: bug#60562: [PATCH] Fix split-string error if there is a space in the filename. References: <87zgawgfic.fsf@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 60562 Cc: 60562@debbugs.gnu.org, lx@shellcodes.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > 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? From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 07 04:42:57 2023 Received: (at 60562) by debbugs.gnu.org; 7 Jan 2023 09:42:57 +0000 Received: from localhost ([127.0.0.1]:56492 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pE5j7-0001eb-BP for submit@debbugs.gnu.org; Sat, 07 Jan 2023 04:42:57 -0500 Received: from out203-205-221-236.mail.qq.com ([203.205.221.236]:43906) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pE5j3-0001e6-Un for 60562@debbugs.gnu.org; Sat, 07 Jan 2023 04:42:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1673084559; bh=lAd5WuEpctoyQr3cAmgwd2Itvs5edjj3PLxZEZlXZbs=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=aooBvM43wWAQJnIcNXADntN4djgTrd7SOGJz2KVU1YMSAE8Q1eG1XKIrvgFW7REYU soaSU/mMskHsVO7pf0xlRhU7gw6rq+GeGomxTVp4STQ3uLCeZMbe9w5gtd7taS8JHv 7Lj2FxOKbRHem+LLiKBp/+JcUsC49kfCgJIJgkjo= Received: from lx-pc ([240e:399:e6f:ee32:f815:4044:ba50:97f9]) by newxmesmtplogicsvrszc5-0.qq.com (NewEsmtp) with SMTP id AA602677; Sat, 07 Jan 2023 17:42:38 +0800 X-QQ-mid: xmsmtpt1673084558t9jpf43kz Message-ID: X-QQ-XMAILINFO: Ms5xyImz3IR/UmfKosRJPwPSGpeWXhi7BIPHFoBKiweququhQnwL0iZNbggRrr VX38lb3IkcidoBMnZ9sIqoyCb+Q9+Pg/Zwnrnh1dT1bmhdVc7otYG5/0mQMhp/rO85/ZKjcdZ4BR QJidcJT4gxXWd2xMPpZIpOb9UadDtQM0tSNoQUfgz/HlXcZedbtGL0+WIBtGrgt73fSg3968QUSL lW3wuWwu9hc3g6bFHaBnPpj1TEW8k2n11Lzb9+ZIfBiCtfvTgUu+o5c1baPUZ0YGPT1KHHw+0MVP RIp9/JZctXWU5sGii1ifDfpngbd07wVpdyDNbFUMT4ZDnZUI8NCol/nLPGNle6rVgnNMl1bZ3sFJ wfz6lyEHZV3nzHP6Rk00BnUV2zAwk7fTf8or0Iq3Xl9lrNYEfhtAOO9Q8UJdyJtVbj3JENzEtiRB faOfpvXcDyFbMAPICez8Gha+w9PXeKVfomIncX8v3Ry8vzT6/VGGoNNSWYQLs0KIL2/6aYKH13of f4xdb8iQXfwH2xGBaP5TruzKHMlmdcLZ/H5erW8tQ3urgjP9QCYad1c6Eoe0aCGybVjKjKGgV7aE DmJONAuBX5zktd+uW0X55sHHZk7yHopKB0Ocxus49ixZynG/L0yA1eigj1HT6W7ZHV6fay0uYdHY I0bxIn/FbB4pP5EMkFMxfsw23GHIbFNJBBCHEO3cTWOU3nSW9J2UpQIqCDG5DG+YUypPdkKlmfXY dbODP3qSO+aezIlTapXi1dgDzIaPmGK/gcuh8Rv4yrTuIqn7G4id2TZWO9mBWxhXX5iebxWk7ngQ kaOqT9DPlwgp6JQJeDK1XRUiiaA6A9qAa2apgBM60dE3De0QIS1jkPQ7d/hkWy1/sSlsKFLFEVOD sMFV8514T/Ux1WgWVNJpgEG4gSEJ82wqCHZXZH20U1D6eSDovcZpdqcL1Uy3HfdllXmqXK2eJhbf kOJQyNutL3/46mFgFTuA== Date: Sat, 7 Jan 2023 17:42:35 +0800 From: lux To: Robert Pluim Subject: Re: bug#60562: [PATCH] Fix split-string error if there is a space in the filename. X-OQ-MSGID: <20230107174235.5ff2050d@lx-pc> In-Reply-To: <87zgawgfic.fsf@gmail.com> References: <87zgawgfic.fsf@gmail.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.36; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Score: 3.6 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Fri, 06 Jan 2023 10:48:43 +0100 Robert Pluim wrote: > >>>>> On Thu, 5 Jan 2023 06:56:05 +0800, lux > >>>>> said: > > lux> * lisp/htmlfontify.el (hfy-list-files): Specify separator > lux> (\n\r). --- > lux> lisp/htmlfontify.el | 5 ++ [...] Content analysis details: (3.6 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [203.205.221.236 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) X-Debbugs-Envelope-To: 60562 Cc: 60562@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.6 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Fri, 06 Jan 2023 10:48:43 +0100 Robert Pluim wrote: > >>>>> On Thu, 5 Jan 2023 06:56:05 +0800, lux > >>>>> said: > > lux> * lisp/htmlfontify.el (hfy-list-files): Specify separator > lux> (\n\r). --- > lux> lisp/htmlfontify.el | 5 ++ [...] Content analysis details: (2.6 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [203.205.221.236 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager On Fri, 06 Jan 2023 10:48:43 +0100 Robert Pluim wrote: > >>>>> On Thu, 5 Jan 2023 06:56:05 +0800, lux > >>>>> said: > > lux> * lisp/htmlfontify.el (hfy-list-files): Specify separator > lux> (\n\r). --- > 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 > lux> that right?? (cd directory) > lux> - (mapcar (lambda (F) (if (string-match "^./\\(.*\\)" F) > lux> (match-string 1 F) F)) > lux> - (split-string (shell-command-to-string > lux> hfy-find-cmd))) ) > lux> + (remove-if #'string-empty-p > lux> + (mapcar (lambda (F) (if (string-match > lux> "^./\\(.*\\)" F) (match-string 1 F) F)) > lux> + (split-string (shell-command-to-string > lux> hfy-find-cmd) "[\n\r]+")) )) > > You can avoid the issue (and improve portability) by using > `directory-files-recursively' instead of `find' But `hfy-find-cmd' is a configurable variable: (defcustom hfy-find-cmd "find . -type f \\! -name \\*~ \\! -name \\*.flc \\! -path \\*/CVS/\\*" "Find command used to harvest a list of files to attempt to fontify." :tag "find-command" :type '(string)) I don't know if using `directory-files-recursively' has other effects. From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 07 05:48:15 2023 Received: (at 60562) by debbugs.gnu.org; 7 Jan 2023 10:48:15 +0000 Received: from localhost ([127.0.0.1]:56532 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pE6kJ-0003Rf-3U for submit@debbugs.gnu.org; Sat, 07 Jan 2023 05:48:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50730) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pE6kH-0003Qz-B1 for 60562@debbugs.gnu.org; Sat, 07 Jan 2023 05:48:14 -0500 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 1pE6kA-0003x8-MI; Sat, 07 Jan 2023 05:48:06 -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=fI9lWfTsVEIU9Yp0EDDz2rGq+69jlwzuAHbbFEcWFz0=; b=EE1QgGgv4sPB 3HStV2cGnNoxZlRcaaaaAFG8sxmBl7i1P5uEoy5YCv01KkzEaZRWhZDrurfmyfH81RetFE/Qj3ar/ SMThVdxW+fcr2PtNHVJFQzbOp6u5EpWdRukx2kt2jWBHeL7Z7Wcfk0+sjhV+2abZmcoYg+jsgm7H0 6K1cwMehYm++le6Hy+h551zpU0OBE6sSHRGURF28XtNqNUvin7s/AFp4zv7Zmjeajp8A1vAcbEwt8 1TJ1YURJHgDDexZrI83+m9u259chpmTrbCr/GQ2MSTanmCbsbqfy6LnVXZ5wFVw+xAarY+zIVPS4j vgrQnMib/DXjOwmO4jAHHw==; 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 1pE6k7-0005FP-Up; Sat, 07 Jan 2023 05:48:04 -0500 Date: Sat, 07 Jan 2023 12:48:24 +0200 Message-Id: <83wn5ysjrb.fsf@gnu.org> From: Eli Zaretskii To: lux In-Reply-To: (message from lux on Sat, 7 Jan 2023 17:42:35 +0800) Subject: Re: bug#60562: [PATCH] Fix split-string error if there is a space in the filename. References: <87zgawgfic.fsf@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 60562 Cc: 60562@debbugs.gnu.org, rpluim@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: 60562@debbugs.gnu.org > Date: Sat, 7 Jan 2023 17:42:35 +0800 > From: lux > > On Fri, 06 Jan 2023 10:48:43 +0100 > Robert Pluim wrote: > > > You can avoid the issue (and improve portability) by using > > `directory-files-recursively' instead of `find' > > But `hfy-find-cmd' is a configurable variable: > > (defcustom hfy-find-cmd > "find . -type f \\! -name \\*~ \\! -name \\*.flc \\! -path > \\*/CVS/\\*" "Find command used to harvest a list of files to attempt > to fontify." :tag "find-command" > :type '(string)) We can convert that to a customizable regexp, and maybe to a predicate function if a simple regexp won't do. > I don't know if using `directory-files-recursively' has other effects. Why would that bother us? This is used to find the files under a given directory, avoiding some files which we know will not be wanted. From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 07 06:17:07 2023 Received: (at 60562) by debbugs.gnu.org; 7 Jan 2023 11:17:07 +0000 Received: from localhost ([127.0.0.1]:56551 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pE7CE-0004CS-Ol for submit@debbugs.gnu.org; Sat, 07 Jan 2023 06:17:06 -0500 Received: from mail-wm1-f42.google.com ([209.85.128.42]:37711) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pE7CC-0004Bs-8P for 60562@debbugs.gnu.org; Sat, 07 Jan 2023 06:17:05 -0500 Received: by mail-wm1-f42.google.com with SMTP id bg13-20020a05600c3c8d00b003d9712b29d2so5268608wmb.2 for <60562@debbugs.gnu.org>; Sat, 07 Jan 2023 03:17:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=26/B1G15WlFK1z5QRLMGseYB/9p8WKqoMOaiYoH6HeU=; b=Fshquu1pW8Z0CF4fNLYr1nGnp3t17dAJDfsR3LcubeK3ppp7Hm+vYQdwp+PPqZF374 EKlirw93LQbQPBhEj5xMZeN/9jC0uGrra89Adea2RI6x++5VJzhTs5eBDluuenppjvyS huXznp0H/SPg4m7tyejUcUyEH+E/tAoACzgEP2snSIZzbZ5YoQMxJLsTS9tXwOVE1noH iRzl5x1938CBLjB24rbop30S8hwUufEqY12NGZkksH+86mP/HVWw+OdfAko3Dpfyc2bi R/OkdmRqLyB0Cfw03wOKX2lFvpnmtLNYgrmK6DW/kSE/DYKCfpBgjfgrTbkw+eOePyde 6HZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=26/B1G15WlFK1z5QRLMGseYB/9p8WKqoMOaiYoH6HeU=; b=ndR6ssSTrNnFihiRvnJkod3vvIrxlEGNBIs713lI0Hys+zoyEjPzydcx0z6ndJ5qkd VRk7742O6rIrTj0U1McQ7PifadWzt+hVO3RMo04KAHrVX/LyrMFBe535M3w350OkalWF QDrB6WvmNO/0PodydhlfqAp75E3iu9kqd+V7kZ117uOFhUdA1zruraGxIrXefzNmlmuw bp9Ve5D24G/3y8HYC5WLSiXGSoKMn5Fa1a3cmEAiAe/on+U2L4HfBPQ09gkVx7f2uYgC MVZ8TyJnVCp2EPu03GF/XhfijX20/zm1YfasB3iGioOBjn8B3b0IbsToyxkqmdQMcKpS 0Bpw== X-Gm-Message-State: AFqh2kqQRdkVf0CxLNpTeMh2eJq6LtBeCHEzB6FABskRQEYmSyueioOf quQBAjC3dzLy6etjzCmASjEDCR681SA= X-Google-Smtp-Source: AMrXdXuzBcI91Oxr20LbF5iP/mtKq3JHRiDZmkhEFSPGBIuuel7Z05kHiq2JYKllF4bYqq3O3stXaQ== X-Received: by 2002:a05:600c:34ce:b0:3cf:614e:b587 with SMTP id d14-20020a05600c34ce00b003cf614eb587mr44933183wmq.26.1673090217440; Sat, 07 Jan 2023 03:16:57 -0800 (PST) Received: from rltb ([82.66.8.55]) by smtp.gmail.com with ESMTPSA id bg24-20020a05600c3c9800b003cfa3a12660sm19819318wmb.1.2023.01.07.03.16.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Jan 2023 03:16:56 -0800 (PST) From: Robert Pluim To: Eli Zaretskii Subject: Re: bug#60562: [PATCH] Fix split-string error if there is a space in the filename. In-Reply-To: <834jt2u1yh.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 07 Jan 2023 11:29:58 +0200") References: <87zgawgfic.fsf@gmail.com> <834jt2u1yh.fsf@gnu.org> Date: Sat, 07 Jan 2023 12:16:55 +0100 Message-ID: <87r0w6h9w8.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60562 Cc: 60562@debbugs.gnu.org, lx@shellcodes.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>>> On Sat, 07 Jan 2023 11:29:58 +0200, Eli Zaretskii said: Eli> Right. Would you like to rewrite the patch using Eli> directory-files-recursively? I don=CA=BCt have time for that at the moment, unfortunately >> (which is annoyingly >> hard to remember, since the obvious search leads to >> `list-directory'. Perhaps we should add `list-directory-recursively' >> as an alias?) Eli> How did you search for it? I use helm, which does subword searching, so C-h f list dir since "I=CA=BCm trying to list the contents of a directory, the verb is 'list', the object is 'directory'" If I=CA=BCd done 'dir files' instead I would have gotten there quicker. (the same process with 'i' in the elisp info manual leads to similar results). Robert --=20 From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 07 06:37:44 2023 Received: (at 60562) by debbugs.gnu.org; 7 Jan 2023 11:37:44 +0000 Received: from localhost ([127.0.0.1]:56568 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pE7WC-0004rC-3Z for submit@debbugs.gnu.org; Sat, 07 Jan 2023 06:37:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59458) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pE7WA-0004qz-Km for 60562@debbugs.gnu.org; Sat, 07 Jan 2023 06:37:42 -0500 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 1pE7W3-0003xt-JQ; Sat, 07 Jan 2023 06:37:35 -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=C0nlGcmZSFo5hcF6dupdJrDFI8QQQIA/YGjFlHEyslk=; b=UbxE+DrZQ+ad 1QZ4AwYU78ddbQB/KZ7/q6YNYsNHKZj6E9Z8TGZ0SEHnNytgu0lD/IJ13eBT65U3J1DoMK4h1plzS o0bRTiIAF7OgGzpFABTcIj+PqoDLrW0SX/pceY5CSlCWRq/HRYSKBwxfrsPJEAQ75oy0K4D49bjlb NOnYjUhKlxqVuoIxIPYmfRNjEHo30F9S3WDrYaZJ3MT1H3EUd3yrjmLRXBEIPNQ1bLDua0riuH77d SJ9GV5UDHkbobex0VOvA1mv2xvDZlVJDEhorzMjDUY9qaxwmmPj6vnR5ssKWOGR1EjdB+SPYxLkSE 6UPE94+cjQKkTbH3SKEeRA==; 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 1pE7W2-0004Ou-Pn; Sat, 07 Jan 2023 06:37:35 -0500 Date: Sat, 07 Jan 2023 13:37:54 +0200 Message-Id: <83pmbqshgt.fsf@gnu.org> From: Eli Zaretskii To: Robert Pluim In-Reply-To: <87r0w6h9w8.fsf@gmail.com> (message from Robert Pluim on Sat, 07 Jan 2023 12:16:55 +0100) Subject: Re: bug#60562: [PATCH] Fix split-string error if there is a space in the filename. References: <87zgawgfic.fsf@gmail.com> <834jt2u1yh.fsf@gnu.org> <87r0w6h9w8.fsf@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 60562 Cc: 60562@debbugs.gnu.org, lx@shellcodes.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Robert Pluim > Cc: lx@shellcodes.org, 60562@debbugs.gnu.org > Date: Sat, 07 Jan 2023 12:16:55 +0100 > > >>>>> On Sat, 07 Jan 2023 11:29:58 +0200, Eli Zaretskii said: > > >> (which is annoyingly > >> hard to remember, since the obvious search leads to > >> `list-directory'. Perhaps we should add `list-directory-recursively' > >> as an alias?) > > Eli> How did you search for it? > > I use helm, which does subword searching, so > > C-h f list dir I was about to suggest "M-x apropos-documentation RET list dir RET", but I see now that for some strange reason (bug?) it doesn't catch directory-files-recursively, although its doc string does match. From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 07 08:56:07 2023 Received: (at 60562) by debbugs.gnu.org; 7 Jan 2023 13:56:07 +0000 Received: from localhost ([127.0.0.1]:56756 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pE9g6-0002ow-UJ for submit@debbugs.gnu.org; Sat, 07 Jan 2023 08:56:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42546) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pE9g5-0002od-2J for 60562@debbugs.gnu.org; Sat, 07 Jan 2023 08:56:05 -0500 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 1pE9fz-0007yr-Mf; Sat, 07 Jan 2023 08:55:59 -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=oITWKr2nH912tWsoECM1HOas9XWD0i9qCPwo3NHKaHU=; b=AHdKLPp9y6F2 UNamvL+id/1CqPjwnivbSHxCsHGwoGV4v1oi2U3lSzcsCgj3EEppZ5YgQb1Tcl/2d0g8UM0yLabZA r5WfQ15h8AJwrr5DlLR4gY85Bd1LT2HpCAmRLxHWDUcatMgZ/U7onxN63lQWtXKuXvt1AvY+qgfSV Bs6DRz62k8SexlBmrkdsG7fac1Ue8p2/4NzUCfq/1yRoarwqy7+0JFr9LP6xpkIv1YoOyILBqeqF2 oO7I2G7mKZyqK4w/gzrfa++0/4P3s7qG6LhFN7agUnzwsO/eCbjfLGgGsBz4DERkFySEwI0TjVAWd x1zS4IC9293wt8dKHCF99w==; 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 1pE9fz-0004Xw-6t; Sat, 07 Jan 2023 08:55:59 -0500 Date: Sat, 07 Jan 2023 15:56:20 +0200 Message-Id: <83eds6sb23.fsf@gnu.org> From: Eli Zaretskii To: rpluim@gmail.com In-Reply-To: <83pmbqshgt.fsf@gnu.org> (message from Eli Zaretskii on Sat, 07 Jan 2023 13:37:54 +0200) Subject: Re: bug#60562: [PATCH] Fix split-string error if there is a space in the filename. References: <87zgawgfic.fsf@gmail.com> <834jt2u1yh.fsf@gnu.org> <87r0w6h9w8.fsf@gmail.com> <83pmbqshgt.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 60562 Cc: 60562@debbugs.gnu.org, lx@shellcodes.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: 60562@debbugs.gnu.org, lx@shellcodes.org > Date: Sat, 07 Jan 2023 13:37:54 +0200 > From: Eli Zaretskii > > I was about to suggest "M-x apropos-documentation RET list dir RET", > but I see now that for some strange reason (bug?) it doesn't catch > directory-files-recursively, although its doc string does match. The issue with "C-h d" is now bug#60628. From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 07 09:52:28 2023 Received: (at 60562) by debbugs.gnu.org; 7 Jan 2023 14:52:28 +0000 Received: from localhost ([127.0.0.1]:56791 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEAYe-0004Bd-1l for submit@debbugs.gnu.org; Sat, 07 Jan 2023 09:52:28 -0500 Received: from out203-205-221-210.mail.qq.com ([203.205.221.210]:55829) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEAYY-0004BK-Rs for 60562@debbugs.gnu.org; Sat, 07 Jan 2023 09:52:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1673103133; bh=/K6neVocismEeD1PvbfTRcgNqYvpyoqv+vjOooNXuzo=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=rEeYl10Ak/2bzhVmA7VBV2WckJZV4EZA/Eh/4O6Mur/7ScQM4u/sGTm5xMHF9ef0q 7zYQbrG0UrhyeeraWe8soI65R7IsTR/c2PMqOSXrNc/3v5ZUSd8XSGAhE9PJD5r4qp CUxs9+yG7MkyYL3h5NXbe14ZOrZAxxqoO/XkZDpg= Received: from lx-pc ([240e:399:e6f:ee32:f815:4044:ba50:97f9]) by newxmesmtplogicsvrszc2-1.qq.com (NewEsmtp) with SMTP id D0BACAE3; Sat, 07 Jan 2023 22:52:11 +0800 X-QQ-mid: xmsmtpt1673103131t304nj6ko Message-ID: X-QQ-XMAILINFO: MB5+LsFw85NoJmsunD8zoy4sgtzS3s7x1ikIayZXnpMGw+KYWskYOF1vsJbDe7 FXt00Ou6X3cGRurOQaCNILb8x2f1+gvBRaKRV9Z3QUqqYkyoBi2rFsbXmr+jom7Gw1BkHA7gJOKy d8Rmu6EHvuPwXiZbfAp9iCAdyFgkGinRs/CSNUaHUtXzi8S7R6H9RsPvUAN0ff2gg/TdbirdJYFW Ezu/LGTDQ9S7UdCnwIHAtF637EY/UsEg4XhUMq9E2IvccVQyFBveGa+rbxMRoIU7vF/8kKFlszfM HDvx3yoE67StFDQSufczpHZjOKz1PA0PxpsYi86MltjA5Unl1NpgpF0izY2XZMtY0sHqi4SRDB18 4UrIvmm8wIYoi4AL+PweN19BRu89q0XFmqbQUNKApfb/8ROFBKFNa8Zoi2rxrnTVO6hl4oAHgORY cgfLVo3Il/TXVHLbP0avxN0Zn04HoVtym+UYQalxapvlCHyc4fUuN58Dv3zRl7KHeHdGmdNEf/O7 HY25wpSDA0bCgLB9vInH0vTHMaKtfGloVxP5MxBmpinct18AWndNWTOpjTbp8B5x6SMZzAJW0Hi+ HABvCpQYjqv1DEE7P3wEB+xVelujb5VDP3H9UKi0yXNohTMYJMQU+wrQT1pCUFGucVuIPgjTzRrT vKJfY7Fj9dMKimCAX3wsB8sTENgEMhVhRaZnC2Q5+mI9E6iEsuord6TdZyroHYg8dTbMgKzzcCQL /vC0hH5LOqxH5EJG/Gq/1JyDqZtoSpP31OgblqXtNBlcE2AhlOMaIV7Q/EPXQ0k3u30xNv9+R18P xMdymaxK6r5o+n9xeneDbIBJS/EDgr9ZKLSumJrdBE/uixYeqPd262Z7zljwpdfzdTNn8qwex4J3 714IUjRvnIwIscHp2hnIYsqZa7FWWKV/gwmHiVcEjlpso2BNP8LzAcWkf0w9J06bwmwq0zP3ICAT yr9viXFqG9c0uG0qsXksYt3LZm4RGmAQgRK8ptle9H8n6qQ5pnEA== Date: Sat, 7 Jan 2023 22:52:09 +0800 From: lux To: Eli Zaretskii Subject: Re: bug#60562: [PATCH] Fix split-string error if there is a space in the filename. X-OQ-MSGID: <20230107225209.51193889@lx-pc> In-Reply-To: <834jt2u1yh.fsf@gnu.org> References: <87zgawgfic.fsf@gmail.com> <834jt2u1yh.fsf@gnu.org> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.36; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/SAsy=Yf0ZIdxGLDjO4bqf2g" X-Spam-Score: 3.6 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Sat, 07 Jan 2023 11:29:58 +0200 Eli Zaretskii wrote: > > 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 > > >>>>> sai [...] Content analysis details: (3.6 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [203.205.221.210 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [203.205.221.210 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) X-Debbugs-Envelope-To: 60562 Cc: 60562@debbugs.gnu.org, Robert Pluim X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.6 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Sat, 07 Jan 2023 11:29:58 +0200 Eli Zaretskii wrote: > > 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 > > >>>>> sai [...] Content analysis details: (2.6 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [203.205.221.210 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [203.205.221.210 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager --MP_/SAsy=Yf0ZIdxGLDjO4bqf2g Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline On Sat, 07 Jan 2023 11:29:58 +0200 Eli Zaretskii wrote: > > 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 > > lux> (\n\r). --- > > 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. > > lux> Is that right?? (cd directory) > > lux> - (mapcar (lambda (F) (if (string-match "^./\\(.*\\)" F) > > lux> (match-string 1 F) F)) > > lux> - (split-string (shell-command-to-string > > lux> hfy-find-cmd))) ) > > lux> + (remove-if #'string-empty-p > > lux> + (mapcar (lambda (F) (if (string-match > > lux> "^./\\(.*\\)" F) (match-string 1 F) F)) > > lux> + (split-string > > lux> (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? > I try rewrite the patch using directory-files-recursively. --MP_/SAsy=Yf0ZIdxGLDjO4bqf2g Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0001-Replace-hfy-find-cmd-with-directory-files-recursivel.patch >From 1e00b856ca423bb7e4491b9999cd3de80223d0bd Mon Sep 17 00:00:00 2001 From: Xi Lu Date: Sat, 7 Jan 2023 22:46:40 +0800 Subject: [PATCH] Replace `hfy-find-cmd' with `directory-files-recursively'. --- lisp/htmlfontify.el | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el index c989a12d205..0746b5e3a36 100644 --- a/lisp/htmlfontify.el +++ b/lisp/htmlfontify.el @@ -372,11 +372,14 @@ hfy-istext-command :tag "istext-command" :type '(string)) -(defcustom hfy-find-cmd - "find . -type f \\! -name \\*~ \\! -name \\*.flc \\! -path \\*/CVS/\\*" - "Find command used to harvest a list of files to attempt to fontify." - :tag "find-command" - :type '(string)) +(defcustom hfy-exclude-file-rules + '("\\.flc$" + "/CVS/.*" + ".*~" + "\\.git/.*") + "Define some regular expressions to exclude files" + :tag "exclude-rules" + :type '(list string)) (defcustom hfy-display-class nil "Display class to use to determine which display class to use when @@ -1823,11 +1826,12 @@ htmlfontify-buffer (defun hfy-list-files (directory) "Return a list of files under DIRECTORY. Strips any leading \"./\" from each filename." - ;;(message "hfy-list-files");;DBUG + ;;(message "hfy-list-files");;DEBUG ;; FIXME: this changes the dir of the current buffer. Is that right?? (cd directory) - (mapcar (lambda (F) (if (string-match "^./\\(.*\\)" F) (match-string 1 F) F)) - (split-string (shell-command-to-string hfy-find-cmd))) ) + (remove-if (lambda (f) (seq-some (lambda (r) + (string-match r f)) hfy-exclude-file-rules)) + (directory-files-recursively "." ".*"))) ;; strip the filename off, return a directory name ;; not a particularly thorough implementation, but it will be -- 2.39.0 --MP_/SAsy=Yf0ZIdxGLDjO4bqf2g-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 07 18:15:27 2023 Received: (at submit) by debbugs.gnu.org; 7 Jan 2023 23:15:27 +0000 Received: from localhost ([127.0.0.1]:59234 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEIPP-0000Ng-0F for submit@debbugs.gnu.org; Sat, 07 Jan 2023 18:15:27 -0500 Received: from lists.gnu.org ([209.51.188.17]:49268) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEIPN-0000I9-4f for submit@debbugs.gnu.org; Sat, 07 Jan 2023 18:15:25 -0500 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 1pEIPH-0005Ny-Rb for bug-gnu-emacs@gnu.org; Sat, 07 Jan 2023 18:15:24 -0500 Received: from netyu.xyz ([152.44.41.246] helo=mail.netyu.xyz) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pEIPG-0001wa-1t; Sat, 07 Jan 2023 18:15:19 -0500 Received: from fw.net.yu.netyu.xyz (99-87-204-218.lightspeed.irvnca.sbcglobal.net [99.87.204.218]) by netyu.xyz (OpenSMTPD) with ESMTPSA id e8e243e6 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sat, 7 Jan 2023 23:15:12 +0000 (UTC) References: <87zgawgfic.fsf@gmail.com> <834jt2u1yh.fsf@gnu.org> User-agent: mu4e 1.8.13; emacs 29.0.60 From: Ruijie Yu To: lux Subject: Re: bug#60562: [PATCH] Fix split-string error if there is a space in the filename. Date: Sat, 07 Jan 2023 17:00:02 -0600 In-reply-to: Message-ID: MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=152.44.41.246; envelope-from=ruijie@netyu.xyz; helo=mail.netyu.xyz X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FROM_SUSPICIOUS_NTLD=0.499, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit Cc: 60562@debbugs.gnu.org, Eli Zaretskii , bug-gnu-emacs@gnu.org, Robert Pluim X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.4 (-) Hi, >-(defcustom hfy-find-cmd >- "find . -type f \\! -name \\*~ \\! -name \\*.flc \\! -path \\*/CVS/\\*" >- "Find command used to harvest a list of files to attempt to fontify." >- :tag "find-command" >- :type '(string)) >+(defcustom hfy-exclude-file-rules >+ '("\\.flc$" >+ "/CVS/.*" >+ ".*~" >+ "\\.git/.*") >+ "Define some regular expressions to exclude files" >+ :tag "exclude-rules" >+ :type '(list string)) For the third entry, shouldn't it be ".*~$" instead, to indicate that "~" is the last character? For the fourth entry, currently it would match against the file name "ROOT/hello.git/foo". In addition, for git submodules, ".git" is a regular file instead of a directory. Maybe something like this is what you want: (rx "/.git" (opt "/" (0+ any)) line-end) or in raw regexp: "/\\.git\\(?:/.*\\)?$" Also, in this change, we are dropping the requirement that the found file are actually files, whereas we used to say "-type f". Is this change fine? > (defun hfy-list-files (directory) > "Return a list of files under DIRECTORY. > Strips any leading \"./\" from each filename." >- ;;(message "hfy-list-files");;DBUG >+ ;;(message "hfy-list-files");;DEBUG > ;; FIXME: this changes the dir of the current buffer. Is that right?? > (cd directory) >- (mapcar (lambda (F) (if (string-match "^./\\(.*\\)" F) (match-string 1 F) F)) >- (split-string (shell-command-to-string hfy-find-cmd))) ) >+ (remove-if (lambda (f) (seq-some (lambda (r) >+ (string-match r f)) hfy-exclude-file-rules)) >+ (directory-files-recursively "." ".*"))) We should change `remove-if' into `cl-remove-if' because both "cl.el" and the alias `remove-if' are deprecated. Best, RY From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 08 02:24:04 2023 Received: (at submit) by debbugs.gnu.org; 8 Jan 2023 07:24:04 +0000 Received: from localhost ([127.0.0.1]:59759 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEQ2G-0006zu-6e for submit@debbugs.gnu.org; Sun, 08 Jan 2023 02:24:04 -0500 Received: from lists.gnu.org ([209.51.188.17]:57678) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEQ2D-0006zN-Bj for submit@debbugs.gnu.org; Sun, 08 Jan 2023 02:24:02 -0500 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 1pEQ2C-0002Jh-CV for bug-gnu-emacs@gnu.org; Sun, 08 Jan 2023 02:24:01 -0500 Received: from out203-205-221-231.mail.qq.com ([203.205.221.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pEQ29-0006TM-FI; Sun, 08 Jan 2023 02:24:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1673162629; bh=sUBUkX/DQ/ky3tY5Vh7p/N5xHD7JppNa4zs96Ut1Vqw=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=JLDPUbOS4Bi79FUQMYj/7nxRwxLYUMrRj5eIyUhoq4IFnProxTJ3AUUqexk1RCaRW eA9nJrhenddwq5LxAyQzoZXxnfyfm8otEX8sZF/cAIzh4Opk4qUDXc9HrO5UwY2USN Vb3mddaKZz8/ZvS/6ww59GJmVWlmcu3hZfWWCaL0= Received: from lx-pc ([240e:399:e6f:ee32:f815:4044:ba50:97f9]) by newxmesmtplogicsvrszc2-0.qq.com (NewEsmtp) with SMTP id 5EF856FB; Sun, 08 Jan 2023 15:23:47 +0800 X-QQ-mid: xmsmtpt1673162627t8uq7aam1 Message-ID: X-QQ-XMAILINFO: OZZSS56D9fAjqgqMF1y5atxGIQYyAJ6CH/ORt5UdLS7M1eaR/cmMWTuWJNWG/+ ChC0DsrzITDiKkfqrUEiZhh9JlSjJPQ/3Y5GcGBTppcRKw6v96TD6CZgH0hvYQncsUfZtcJ8XHAw 8tAfz+FuAbm8wLvL/oNw8JvCw+EdzaU3A0+c+69khgoOYzUYpjxPNXyF0wVq5Lve30plnzzQSPoj pGkev5Z2WD/id8mpSh5hrjHsreQHRHKGlXuqzaHVNUttKyOKOy+pMPGwcbOJCH+k3Q0iOZqSgZE7 i24ZwJyZYVtdju3kbvUfhASD2mfth6UrYBxQGq9VBiAOY62bLeHqy/P4KjNzmqTQ9xn2vowxk+ga WbsjhRP1LR8PUEHkb2xZHAZoqaH0C4rhNRQ0qEyu/Vrvy4x53Z3QwW6tkSmDerqS5ehoSHvJO9KT +ptTp/LsBlBYe2ONxzEL5lFB61Ryz11VD9joR0qSju1F1izD58rF/0FvkoOoAZrGMNWpk4glx286 5do2VfsJNOpEx6fyAqjD/3ZNkIJ1qqMYOZgHVN9CdPOgq1bOe01RHDrlxERIysrdzcUrt7FYbW5g f5Rrut2RZYi32+iqIrJjzaY75V11s/jQe77MvI/+EPb3CpM4GDH5BFB2sCKVjhxltLYwYFPCayH1 GxeNHZSu5R39XDcdTzEY/TgOJnlbqnfwwnwFe6P3CqUdbDZqXjrYI9bxApBCP5WRjjg8hDGG1d5Y jSj+Eox+ABbLmtfzs5HIwYXT6SWUtx3OTeFpCQlOmhhArWLt6af9FxLU99RplIkWl9NOMcg0ug4x rHzyyPRXTdyZ7vwb3yDzFHqoZ1oC9LQYU446OfcIJPFGahqhpeAvD6YQEmjcFp+kMwo8Y4rsAcgU /ldhuoyqYzOZqYnlgsDA38w5/GFma7zppeI0qitOjPF+P83eSt8YSPBhNZ5LWTID+9KoJ8b3jnHF 4PtTUZdl/zkMioBJZgmGz7Uld+Z5mfnZbs1QXBd80= Date: Sun, 8 Jan 2023 15:23:45 +0800 From: lux To: Ruijie Yu Subject: Re: bug#60562: [PATCH] Fix split-string error if there is a space in the filename. X-OQ-MSGID: <20230108152345.619ff2fe@lx-pc> In-Reply-To: References: <87zgawgfic.fsf@gmail.com> <834jt2u1yh.fsf@gnu.org> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.36; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/8BhM+VOZivfUP=Q6VtLghpG" Received-SPF: none client-ip=203.205.221.231; envelope-from=lx@shellcodes.org; helo=out203-205-221-231.mail.qq.com X-Spam_score_int: 10 X-Spam_score: 1.0 X-Spam_bar: + X-Spam_report: (1.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HELO_DYNAMIC_IPADDR=1.951, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_DYNAMIC=0.982, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit Cc: 60562@debbugs.gnu.org, Eli Zaretskii , bug-gnu-emacs@gnu.org, Robert Pluim X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --MP_/8BhM+VOZivfUP=Q6VtLghpG Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline On Sat, 07 Jan 2023 17:00:02 -0600 Ruijie Yu wrote: > Hi, > > >-(defcustom hfy-find-cmd > >- "find . -type f \\! -name \\*~ \\! -name \\*.flc \\! -path > >\\*/CVS/\\*" > >- "Find command used to harvest a list of files to attempt to > >fontify." > >- :tag "find-command" > >- :type '(string)) > >+(defcustom hfy-exclude-file-rules > >+ '("\\.flc$" > >+ "/CVS/.*" > >+ ".*~" > >+ "\\.git/.*") > >+ "Define some regular expressions to exclude files" > >+ :tag "exclude-rules" > >+ :type '(list string)) > > For the third entry, shouldn't it be ".*~$" instead, to indicate that > "~" is the last character? > > For the fourth entry, currently it would match against the file name > "ROOT/hello.git/foo". In addition, for git submodules, ".git" is a > regular file instead of a directory. Maybe something like this is > what you want: > > (rx "/.git" (opt "/" (0+ any)) line-end) > > or in raw regexp: "/\\.git\\(?:/.*\\)?$" > > Also, in this change, we are dropping the requirement that the found > file are actually files, whereas we used to say "-type f". Is this > change fine? > > > (defun hfy-list-files (directory) > > "Return a list of files under DIRECTORY. > > Strips any leading \"./\" from each filename." > >- ;;(message "hfy-list-files");;DBUG > >+ ;;(message "hfy-list-files");;DEBUG > > ;; FIXME: this changes the dir of the current buffer. Is that > > right?? (cd directory) > >- (mapcar (lambda (F) (if (string-match "^./\\(.*\\)" F) > >(match-string 1 F) F)) > >- (split-string (shell-command-to-string hfy-find-cmd))) ) > >+ (remove-if (lambda (f) (seq-some (lambda (r) > >+ (string-match r f)) > >hfy-exclude-file-rules)) > >+ (directory-files-recursively "." ".*"))) > > We should change `remove-if' into `cl-remove-if' because both "cl.el" > and the alias `remove-if' are deprecated. > Thank you, I updated the patch file. --MP_/8BhM+VOZivfUP=Q6VtLghpG Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0001-Replace-hfy-find-cmd-with-directory-files-recursivel.patch >From 58fcb50eae760a6565e1703dfb8cea46a4ee5843 Mon Sep 17 00:00:00 2001 From: Xi Lu Date: Sat, 7 Jan 2023 22:46:40 +0800 Subject: [PATCH] Replace `hfy-find-cmd' with `directory-files-recursively'. --- lisp/htmlfontify.el | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el index c989a12d205..f05bc4e1e35 100644 --- a/lisp/htmlfontify.el +++ b/lisp/htmlfontify.el @@ -372,11 +372,14 @@ hfy-istext-command :tag "istext-command" :type '(string)) -(defcustom hfy-find-cmd - "find . -type f \\! -name \\*~ \\! -name \\*.flc \\! -path \\*/CVS/\\*" - "Find command used to harvest a list of files to attempt to fontify." - :tag "find-command" - :type '(string)) +(defcustom hfy-exclude-file-rules + '("\\.flc$" + "/CVS/.*" + ".*~$" + "/\\.git\\(?:/.*\\)?$") + "Define some regular expressions to exclude files" + :tag "exclude-rules" + :type '(list string)) (defcustom hfy-display-class nil "Display class to use to determine which display class to use when @@ -1826,8 +1829,12 @@ hfy-list-files ;;(message "hfy-list-files");;DBUG ;; FIXME: this changes the dir of the current buffer. Is that right?? (cd directory) - (mapcar (lambda (F) (if (string-match "^./\\(.*\\)" F) (match-string 1 F) F)) - (split-string (shell-command-to-string hfy-find-cmd))) ) + (cl-remove-if (lambda (f) + (or (null (file-regular-p f)) + (seq-some (lambda (r) + (string-match r f)) + hfy-exclude-file-rules))) + (directory-files-recursively "." ".*" nil t))) ;; strip the filename off, return a directory name ;; not a particularly thorough implementation, but it will be -- 2.39.0 --MP_/8BhM+VOZivfUP=Q6VtLghpG-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 09:28:40 2023 Received: (at 60562) by debbugs.gnu.org; 9 Jan 2023 14:28:40 +0000 Received: from localhost ([127.0.0.1]:36072 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEt8i-00059I-99 for submit@debbugs.gnu.org; Mon, 09 Jan 2023 09:28:40 -0500 Received: from mail-wm1-f49.google.com ([209.85.128.49]:45953) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEt8g-000595-8L for 60562@debbugs.gnu.org; Mon, 09 Jan 2023 09:28:38 -0500 Received: by mail-wm1-f49.google.com with SMTP id p1-20020a05600c1d8100b003d8c9b191e0so6927637wms.4 for <60562@debbugs.gnu.org>; Mon, 09 Jan 2023 06:28:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=KqIe6/zecLcSl1hYXucf8U8H9CPShP63sxf7QHnFLs8=; b=C4L34fGhhSk0SqOj+QAh/XTJePEtrVw/Y7WdCAbnPSEK9JldYq8TjFRS7/p/DQqXR5 PMrtqxRxUgxbLtBdaiaz6HhA6sow9IOtz/G4qHKFochp3QDiL6RwxlsnmCJVYagVxwiV kOsLBRYgDLAbkSsxzPSVAqS+MSDjko66ADxM+uKjXool9p42kp5+M+mQ95TrO1qpJlso AWFkf2vX59XtmIoGiHnhDuJto91SH+3oYzGeyBSAR2x/BA9EAFA7FdEKMMKskFStLe7o yN4KAg5Rgkrh+jX/AbPGOf6GQ3XtBZVKAQlqMVT/BRVE3V1uHvvZTaywi8oN4uhivm+Y JjWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=KqIe6/zecLcSl1hYXucf8U8H9CPShP63sxf7QHnFLs8=; b=bPE3vciv/87jmB1+0tve5+27QyO0sQA+kBs4LZFNo30Ap7K4g/ayyl8TA6Rt3hmvH9 Pl46V4PM88Co9gVdlc+68c2YM0Wl2UEGTIZ754nl9zYZlD3vDY/Slbz9WfkfDra8ABpB DDWSqnEA29gbL2sezZTQDsUG8ACGAjDBE0RQMGfZUShKf6dcdNWHDdb5w+gFEM+IVBo3 tW1Zu45zLG3hr2pzvDERYiBweXjfAsiwnkIvEOjWCSMhetunV8QxXNcPDePkkn3A3Kus bf1yteqF+vYCYRzdtrFOF7V0YFb1PBzm5gTa9oAMk/wfpWUCA9J2rTR3dzLSJLmPoWuc YuOQ== X-Gm-Message-State: AFqh2krntovua4brQK/8sqfCvYYfMApJAW0EVlvjkyf67RjKVZg0HOAX cn6wydqDx6NAtQL045AX648= X-Google-Smtp-Source: AMrXdXs1NKLPJf9c9sprHKnggNMdnV90BqYAxQaKPlF1H3y27El6ZPHORgE3ZNjXfZFze2nIbRdrfA== X-Received: by 2002:a05:600c:1c21:b0:3d2:2faf:e54b with SMTP id j33-20020a05600c1c2100b003d22fafe54bmr46258612wms.6.1673274512341; Mon, 09 Jan 2023 06:28:32 -0800 (PST) Received: from rltb ([82.66.8.55]) by smtp.gmail.com with ESMTPSA id he5-20020a05600c540500b003d9ed40a512sm6123628wmb.45.2023.01.09.06.28.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Jan 2023 06:28:31 -0800 (PST) From: Robert Pluim To: Ruijie Yu Subject: Re: bug#60562: [PATCH] Fix split-string error if there is a space in the filename. In-Reply-To: (lux's message of "Sun, 8 Jan 2023 15:23:45 +0800") References: <87zgawgfic.fsf@gmail.com> <834jt2u1yh.fsf@gnu.org> Date: Mon, 09 Jan 2023 15:28:30 +0100 Message-ID: <87eds3hje9.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60562 Cc: 60562@debbugs.gnu.org, lux , eliz@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> >> Also, in this change, we are dropping the requirement that the found >> file are actually files, whereas we used to say "-type f". Is this >> change fine? >> `directory-files-recursively' by default only returns files (and the latest patch explicitly passes `nil' for INCLUDE-DIRECTORIES anyway) Robert -- From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 09:56:14 2023 Received: (at 60562) by debbugs.gnu.org; 9 Jan 2023 14:56:14 +0000 Received: from localhost ([127.0.0.1]:37952 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEtZO-0000F5-9U for submit@debbugs.gnu.org; Mon, 09 Jan 2023 09:56:14 -0500 Received: from out203-205-251-60.mail.qq.com ([203.205.251.60]:35336) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEtZJ-0000EC-Nt for 60562@debbugs.gnu.org; Mon, 09 Jan 2023 09:56:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1673276160; bh=p/yy70uWulV/mdL57buh0BrHbNCe8/bMJHcYN/yzcHg=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=ESMccpAQnJFjqBmcdAVeMu3MMYhq1iJmbOF/yIjQomx2xPC3oTmu4Yiul3nba/lza U99btXAFB0kdkf6lNp9wL+deKgZSm9dZgb7PnnHXznLTuKSzKpNhHcXunv3CTd+yCQ 26a3RSDSRuU54+3Dx6lXC6+BollKIypt8Ve26tvw= Received: from lx-pc ([240e:399:e6f:ee32:f815:4044:ba50:97f9]) by newxmesmtplogicsvrsza10-0.qq.com (NewEsmtp) with SMTP id DFA2620F; Mon, 09 Jan 2023 22:55:58 +0800 X-QQ-mid: xmsmtpt1673276158tuclna190 Message-ID: X-QQ-XMAILINFO: Mrv6PNPZjcp6JuLLgREsn5NsjbIVvrJ6vskLDkEkvM9dQkaUQUtLWfCWUO+aaU LOIOYN7G1C05VsfczDYk8zWmn29iKThRRYy/SxjhubZozwWdWOIIUc57nHaReEmIspesDt+nVVaN R84J/SjR/tk9mJU2OaKAWZ/K5aq4kfV4EPLfrF6zPIVkGKAtQ81w1fNDHKCRYvGxEJH2BFk6p0eG D+RU0YpAZqGDplNfHjnlcoT43po1wT0a5C8/rbpr23dQKT7TWo3b93K48/ZexCgev/VEIZLrSZ7h 8rCev/6KjpAYkKdtunLn5hGN1X8nbjwS2YroAGD7pl0s2msAnQF0+ZE81mCzdU4bDIGzO6JVf8DH 2DClIV+a71Mnmb4h5FGGNR2UJXmklYnMsAPrig269FIXtuXSsHrF7pRgFwuxQXeEq6/xWSdH0jR+ pYD08mHPDoQOl6m4kK9GsblK5cs1xK6VVbHzaqvxaqM7TegOBSCJ/R0WmJOWQptKEFTolsTXDNTj Jy4hH6PLtBXsZ5cpHWuJBHIN4qurDijDw/yDb4va1AwZo5CrVJSCHBCGDlVcaUT14mqgUHV/7fOr GQhiy8hI0sfnO9XXzSt3l5aoQdkNYPHc1CJBEdMxHK9uQ4eSyYF+D9luNDRp1qPoynlkvWQ+GKvg NJ8w4N9m/wo/ehUdXyzyc/JYnt9tONNARmG+/hX5EPRA7eItsduHhHpnddbRDJQut6pZZC0e92IB 6lkecuuj09HivBIaiTAB1khtSbljFuW0LZs6BIhu5+CJ7fbmpx2OHqqm7zy8vwYmrj2+NePmzGC/ 3ABWdaiWtJ2uk6xLyks+G7Y7M0LQsAaYWiIikwKVRAVeoWt1fnvVjuq3ElejeQ22cZ8+6kSvamm4 SFSqZCAX0l6mMZwNaSZ4ZdLoqPtNop9gQholsY5W7mfvLsgxyAKGpKIjShln1TIf+YqXy9RKrq6a 9f2T48yFWI8LycnDhSjKEhCBdIabInpgcOlN8x+aM= From: lux To: Robert Pluim Subject: Re: bug#60562: [PATCH] Fix split-string error if there is a space in the filename. In-Reply-To: <87eds3hje9.fsf@gmail.com> (Robert Pluim's message of "Mon, 09 Jan 2023 15:28:30 +0100") References: <87zgawgfic.fsf@gmail.com> <834jt2u1yh.fsf@gnu.org> <87eds3hje9.fsf@gmail.com> Date: Mon, 09 Jan 2023 22:55:58 +0800 Message-ID: <87pmbnu58h.fsf@shellcodes.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 3.6 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Robert Pluim writes: > >> > >> Also, in this change, we are dropping the requirement that the found > >> file are actually files, whereas we used to say "-type f". Is this > >> change fine? > >> > > `directory-files-recur [...] Content analysis details: (3.6 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [203.205.251.60 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) X-Debbugs-Envelope-To: 60562 Cc: Ruijie Yu , 60562@debbugs.gnu.org, eliz@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.6 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Robert Pluim writes: > >> > >> Also, in this change, we are dropping the requirement that the found > >> file are actually files, whereas we used to say "-type f". Is this > >> change fine? > >> > > `directory-files-recur [...] Content analysis details: (2.6 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [203.205.251.60 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager Robert Pluim writes: > >> > >> Also, in this change, we are dropping the requirement that the found > >> file are actually files, whereas we used to say "-type f". Is this > >> change fine? > >> > > `directory-files-recursively' by default only returns files (and the > latest patch explicitly passes `nil' for INCLUDE-DIRECTORIES anyway) > "-type f" will return all regular files, `directory-files-recursively' contains all types of files (socket, block, etc..), so I latest patch added `file-regular-p' to check the file type. From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 14 04:12:12 2023 Received: (at 60562-done) by debbugs.gnu.org; 14 Jan 2023 09:12:12 +0000 Received: from localhost ([127.0.0.1]:53366 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pGcaC-0004rQ-4j for submit@debbugs.gnu.org; Sat, 14 Jan 2023 04:12:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54204) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pGca9-0004rC-2A for 60562-done@debbugs.gnu.org; Sat, 14 Jan 2023 04:12:10 -0500 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 1pGca3-0007Bl-HR; Sat, 14 Jan 2023 04:12:03 -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=THDV0o788KO5UTWqreZpgZoSZrO1ywkzmfCGiNTZB3E=; b=h9aflflV3UJV n51zUoFqm9DiOHHd4A6FR7058fNs9kODJYcAQra6fAOMFPBvW0z2AOV1pU+tXlkXgv7yAfs0RjM0A 5Rr4XNS7Q1ZapsZksJQaIW/4MOVNTbL1+gdwS+IIH4PPnQrscdBwLg4Fx2HB9d854poVHiKPYGBOO iA1hJfg/hR2apzwlPfW4qKARRr7k5nCaLIYjefVZ7NY7hmW6Fy5HFmxXECvyP5ogSMupDb0CXvvYr WQzrc3w4+Ozlv3ICfZqd9zNB4nJxlvqsQ+MaeLbcQZQOF5GzVjE61q8/CzxOJkJQUx8Jlkt78Hkq6 /9rTT624fMTj711scABHFQ==; 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 1pGca2-0007rh-SY; Sat, 14 Jan 2023 04:12:03 -0500 Date: Sat, 14 Jan 2023 11:12:05 +0200 Message-Id: <838ri58opm.fsf@gnu.org> From: Eli Zaretskii To: lux In-Reply-To: (message from lux on Sun, 8 Jan 2023 15:23:45 +0800) Subject: Re: bug#60562: [PATCH] Fix split-string error if there is a space in the filename. References: <87zgawgfic.fsf@gmail.com> <834jt2u1yh.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 60562-done Cc: ruijie@netyu.xyz, 60562-done@debbugs.gnu.org, rpluim@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sun, 8 Jan 2023 15:23:45 +0800 > From: lux > Cc: Eli Zaretskii , 60562@debbugs.gnu.org, Robert Pluim > , bug-gnu-emacs@gnu.org > > On Sat, 07 Jan 2023 17:00:02 -0600 > Ruijie Yu wrote: > > > Hi, > > > > >-(defcustom hfy-find-cmd > > >- "find . -type f \\! -name \\*~ \\! -name \\*.flc \\! -path > > >\\*/CVS/\\*" > > >- "Find command used to harvest a list of files to attempt to > > >fontify." > > >- :tag "find-command" > > >- :type '(string)) > > >+(defcustom hfy-exclude-file-rules > > >+ '("\\.flc$" > > >+ "/CVS/.*" > > >+ ".*~" > > >+ "\\.git/.*") > > >+ "Define some regular expressions to exclude files" > > >+ :tag "exclude-rules" > > >+ :type '(list string)) > > > > For the third entry, shouldn't it be ".*~$" instead, to indicate that > > "~" is the last character? > > > > For the fourth entry, currently it would match against the file name > > "ROOT/hello.git/foo". In addition, for git submodules, ".git" is a > > regular file instead of a directory. Maybe something like this is > > what you want: > > > > (rx "/.git" (opt "/" (0+ any)) line-end) > > > > or in raw regexp: "/\\.git\\(?:/.*\\)?$" > > > > Also, in this change, we are dropping the requirement that the found > > file are actually files, whereas we used to say "-type f". Is this > > change fine? > > > > > (defun hfy-list-files (directory) > > > "Return a list of files under DIRECTORY. > > > Strips any leading \"./\" from each filename." > > >- ;;(message "hfy-list-files");;DBUG > > >+ ;;(message "hfy-list-files");;DEBUG > > > ;; FIXME: this changes the dir of the current buffer. Is that > > > right?? (cd directory) > > >- (mapcar (lambda (F) (if (string-match "^./\\(.*\\)" F) > > >(match-string 1 F) F)) > > >- (split-string (shell-command-to-string hfy-find-cmd))) ) > > >+ (remove-if (lambda (f) (seq-some (lambda (r) > > >+ (string-match r f)) > > >hfy-exclude-file-rules)) > > >+ (directory-files-recursively "." ".*"))) > > > > We should change `remove-if' into `cl-remove-if' because both "cl.el" > > and the alias `remove-if' are deprecated. > > > > Thank you, I updated the patch file. Thanks, installed on the emacs-29 branch, and closing the bug. From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 15 07:34:08 2023 Received: (at submit) by debbugs.gnu.org; 15 Jan 2023 12:34:08 +0000 Received: from localhost ([127.0.0.1]:56361 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pH2DA-0004wY-Eq for submit@debbugs.gnu.org; Sun, 15 Jan 2023 07:34:08 -0500 Received: from lists.gnu.org ([209.51.188.17]:42998) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pH2D7-0004wO-57 for submit@debbugs.gnu.org; Sun, 15 Jan 2023 07:34:06 -0500 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 1pH2D6-00029N-JT for bug-gnu-emacs@gnu.org; Sun, 15 Jan 2023 07:34:04 -0500 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pH2D5-0005iP-9P for bug-gnu-emacs@gnu.org; Sun, 15 Jan 2023 07:34:04 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1pH2D1-0009eo-RN for bug-gnu-emacs@gnu.org; Sun, 15 Jan 2023 13:33:59 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: bug-gnu-emacs@gnu.org From: Andy Moreton Subject: Re: bug#60562: [PATCH] Fix split-string error if there is a space in the filename. Date: Sun, 15 Jan 2023 12:33:49 +0000 Message-ID: <86o7r0f042.fsf@gmail.com> References: <87zgawgfic.fsf@gmail.com> <83wn5ysjrb.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2.50 (windows-nt) Cancel-Lock: sha1:Q9sYxaY0nJ4IZMIKhFS49ntFhnA= Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 3 X-Spam_score: 0.3 X-Spam_bar: / X-Spam_report: (0.3 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.1 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.1 (-) On Sat 07 Jan 2023, Eli Zaretskii wrote: >> Cc: 60562@debbugs.gnu.org >> Date: Sat, 7 Jan 2023 17:42:35 +0800 >> From: lux >> >> On Fri, 06 Jan 2023 10:48:43 +0100 >> Robert Pluim wrote: >> >> > You can avoid the issue (and improve portability) by using >> > `directory-files-recursively' instead of `find' >> >> But `hfy-find-cmd' is a configurable variable: >> >> (defcustom hfy-find-cmd >> "find . -type f \\! -name \\*~ \\! -name \\*.flc \\! -path >> \\*/CVS/\\*" "Find command used to harvest a list of files to attempt >> to fontify." :tag "find-command" >> :type '(string)) > > We can convert that to a customizable regexp, and maybe to a predicate > function if a simple regexp won't do. > >> I don't know if using `directory-files-recursively' has other effects. > > Why would that bother us? This is used to find the files under a > given directory, avoiding some files which we know will not be wanted. The fixes for this problem now cause bootstrap to fail, due to the defcustom for hfy-exclude-file-rules containing a version tag that is not a string. AndyM From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 15 09:07:16 2023 Received: (at 60562) by debbugs.gnu.org; 15 Jan 2023 14:07:16 +0000 Received: from localhost ([127.0.0.1]:56408 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pH3fH-0001Km-6Y for submit@debbugs.gnu.org; Sun, 15 Jan 2023 09:07:16 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54614) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pH3fB-0001KP-AN for 60562@debbugs.gnu.org; Sun, 15 Jan 2023 09:07:13 -0500 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 1pH3f6-0006vq-2B; Sun, 15 Jan 2023 09:07:04 -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=tdJaydsKKob1PusX9wxMB1qXy+Hv8er24fEAUHvdwgg=; b=ehoQ2JfXRylN OBqtM57c751JJeF3p6Q3xB2GUXKWMns36Xr6fWvupOvde+wJpoFXw68v+JOJx+RjgJRl4pIGZ9+w3 UfExeGMSVmETKqWe2D735TlPsclKjOIKw050sk/+4GqokJpp/7UYJf1mkR2xcn34q/6NStNwk21Cc KKfkfTkkGpiv04SVSXNGBLqboG76Z6UPurPhmJT7fllLKBs68bPetUytwA2cmv9GIHTEdA/9p9i4K cIB/A2gmK5myAxu5v6UedcHABtwzwbzAiqLVfGsMLb9gBJo4p20R0DQ9+FUrpLyJzEKgJyfK8HGYr 3hnFy1fK+pU13m3dCZPqdA==; 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 1pH3f5-00017J-9q; Sun, 15 Jan 2023 09:07:03 -0500 Date: Sun, 15 Jan 2023 16:07:09 +0200 Message-Id: <83fscb6gdu.fsf@gnu.org> From: Eli Zaretskii To: Andy Moreton In-Reply-To: <86o7r0f042.fsf@gmail.com> (message from Andy Moreton on Sun, 15 Jan 2023 12:33:49 +0000) Subject: Re: bug#60562: [PATCH] Fix split-string error if there is a space in the filename. References: <87zgawgfic.fsf@gmail.com> <83wn5ysjrb.fsf@gnu.org> <86o7r0f042.fsf@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 60562 Cc: 60562@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Andy Moreton > Date: Sun, 15 Jan 2023 12:33:49 +0000 > > On Sat 07 Jan 2023, Eli Zaretskii wrote: > > The fixes for this problem now cause bootstrap to fail, due to the > defcustom for hfy-exclude-file-rules containing a version tag that is > not a string. That was fixed yesterday, so please update from Git, and sorry for the trouble. From unknown Mon Aug 18 11:15:45 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 13 Feb 2023 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator