From unknown Sat Sep 06 05:55:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#73445: [PATCH] image-dired: quote file name fore search-forward-regexp Resent-From: Vitaliy Chepelev Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 24 Sep 2024 05:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 73445 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 73445@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.17271559311188 (code B ref -1); Tue, 24 Sep 2024 05:33:01 +0000 Received: (at submit) by debbugs.gnu.org; 24 Sep 2024 05:32:11 +0000 Received: from localhost ([127.0.0.1]:45050 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ssy9h-0000Iy-4T for submit@debbugs.gnu.org; Tue, 24 Sep 2024 01:32:11 -0400 Received: from lists.gnu.org ([209.51.188.17]:40760) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ssxc1-0006Zs-8j for submit@debbugs.gnu.org; Tue, 24 Sep 2024 00:57:21 -0400 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 1ssxbd-0005YB-4M for bug-gnu-emacs@gnu.org; Tue, 24 Sep 2024 00:56:57 -0400 Received: from mout.gmx.net ([212.227.17.20]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ssxbb-00064g-B8 for bug-gnu-emacs@gnu.org; Tue, 24 Sep 2024 00:56:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.com; s=s31663417; t=1727153813; x=1727758613; i=vitalij@gmx.com; bh=abOAwcT7nG0u4F/SYF3cJWfiOJFqmrheyEJevBUfN2A=; h=X-UI-Sender-Class:From:To:Subject:Date:Message-ID:MIME-Version: Content-Type:cc:content-transfer-encoding:content-type:date:from: message-id:mime-version:reply-to:subject:to; b=tzw/nV9hE52qLCmo8FUNeksofUeZIDG6O9AhKThbwkfaZWq7447M4fspw6ztFweU Se8vkX+FjpwOOlvDLNLRDPcN/VPZ6ToU4BPOea7R/4K4OquwusKfZD6QviNa6Xzxb a3r/5QxAA61Um0RQfHrfkXxV7ygutyPbUcWmCC8iEDmYtsatCBO83ab1AYIgoAdde OcX6oBTE/kRG8iVgrYotiycytfWfqyH+fj67kU9u2llclKltXOf+UJy9E7naN9xWf CHtpV0BqPHYqXauTRJi6EqPIMlUMwqKVPBKRW4w3UEewiSNSpZi7sirzte8ZgjZ5P XS4vu3EHXTRQKF5SlQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from localhost ([217.196.104.210]) by mail.gmx.net (mrgmx105 [212.227.17.174]) with ESMTPSA (Nemesis) id 1Mel3t-1sLGsa22Mv-00kEah for ; Tue, 24 Sep 2024 06:56:53 +0200 From: Vitaliy Chepelev Date: Tue, 24 Sep 2024 04:55:46 -0000 Message-ID: <871q19k5v1.fsf@gmx.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K1:1NvTaAFIC+i1tJJ61oky3u/Sc919AgPYdplF5r/Z+Ekq/fWrLMF Ujn6PeB/a50QkfW1Kjkkh1oWWTZcYA7L0ThSHYC0K0k6yJvARmk+TuBvArR/nzQ+zFZztAt LVVwl552vELWXhLdxoAwUCG98hQRXOcKRlSNdvRnZhO4pufkZpWDst0xTjAJp5J+OGy9BbG VXqs7jtLOp5W6I2Z8snuA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:cPXnrrI3acI=;EY5i6HgrlzlG2wDa+NjLmaHXvjk IYfSu4TfNtr/3ADXn2iQaDhL/+7CovDDM/Vn0gc2j3C5K8DG/nnwjUww8M6KzcEVBjN8RqysF 4Ldc9qtzYug0XHhCwLHYTPX4/KbAR160WtFf+W4Dr/zBVWhN8ifYGE56cLSwYDyUADgpmt84t bfv8NIPNFOnDz3XjSGR/s0iqko3kgnYbAgmzlo8NsNfFCDJytc3vr0Z0sm3Pi4zpHDVsCQiFl hyvaUS57zBPG8ayzXjXAe+kEW2QwUnq6LKYXZk8s1xrlbjTFeUuk5XJakUtCIbHAJqBDYUP3P 4uFWruVUHh2V1R7LVbO7a9FF2EN5HWCxKBqumUAZmSAO7l58PCGax7vQlP2gZJdMPdkucSdtJ wHEKEMPmhmj6BLx1n4dD3n0AKiozSVII+mPkcpKyHXQbImZ042jsjhNi7EaGeE68IpgS4jc8P 1V36/LTjT87YbKenmCRl44ZBFSEPVdKfJdZ5Jx0Mg1d36O6UFC7tCMSqEl+rpI3rDpxysz8go Q6NkPRoIR0hQo8uaFiKy65NT2vsmAWnvGWb06+w6nwpzjGKW4oEK2ojuYz+JQLBqz8aAOGdWO scgVIcAgcuQpccyVmB2/DFZAl/EsJ5VbqbSDwjBWmFB0RmLc4ovpW25Lnqe9IpSHEAx/9yfbz L8v4GaGUFAoB00GdfqhFXNRqjhobkcm4GlcOmJbvP6I6W0VmiSglRjJDQ/7hbwTFNrpdCePlE 3K01r4bDh8xAB5sUj+H7tgUVLY0fgYl5enbtSPLJsoLVM8vLPiEy2uttuwaL1/B0/XD85Z0dA C4zG84s4DgDLc2UqLPYmW5TbHTyEV7N6oGFBO2OHX3al4= Received-SPF: pass client-ip=212.227.17.20; envelope-from=vitalij@gmx.com; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Mailman-Approved-At: Tue, 24 Sep 2024 01:32:05 -0400 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.3 (--) --=-=-= Content-Type: text/plain Tags: patch In GNU Emacs 29.4 (build 1, x86_64-pc-linux-gnu, X toolkit) of 2024-07-29 built on localhost Windowing system distributor 'The X.Org Foundation', version 11.0.12101013 System Description: Gentoo Linux --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-image-dired-quote-file-name-fore-search-forward-rege.patch Content-Transfer-Encoding: quoted-printable =46rom d0e7b67e10d3ecb34969c0af18ef6317fd96636d Mon Sep 17 00:00:00 2001 From: none Date: Tue, 24 Sep 2024 04:25:13 +0000 Subject: [PATCH] image-dired: quote file name fore search-forward-regexp For example when you have file with name "file[image].jpg". and use M-x im= age-dired you will have error: image-dired-list-tags: Invalid regexp: "Unm= atched [ or [^" =2D-- lisp/image/image-dired-dired.el | 2 +- lisp/image/image-dired-tags.el | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lisp/image/image-dired-dired.el b/lisp/image/image-dired-dire= d.el index 7219a10..c4e82e9 100644 =2D-- a/lisp/image/image-dired-dired.el +++ b/lisp/image/image-dired-dired.el @@ -383,7 +383,7 @@ matching tag will be marked in the Dired buffer." (file-name-directory curr-file))) (setq curr-file (file-name-nondirectory curr-file)) (goto-char (point-min)) - (when (search-forward-regexp (format "\\s %s[*@]?$" curr-file) ni= l t) + (when (search-forward-regexp (format "\\s %s[*@]?$" (regexp-quote= curr-file)) nil t) (setq hits (+ hits 1)) (dired-mark 1)))) (message "%d files with matching tag marked" hits))) diff --git a/lisp/image/image-dired-tags.el b/lisp/image/image-dired-tags.= el index 54595ad..828372e 100644 =2D-- a/lisp/image/image-dired-tags.el +++ b/lisp/image/image-dired-tags.el @@ -79,7 +79,7 @@ FILE-TAGS is an alist in the following form: (setq file (car elt) tag (cdr elt)) (goto-char (point-min)) - (if (search-forward-regexp (format "^%s.*$" file) nil t) + (if (search-forward-regexp (format "^%s.*$" (regexp-quote file)) = nil t) (progn (setq end (point)) (beginning-of-line) @@ -103,7 +103,7 @@ FILES can be a name of a single file (a string) or a l= ist of file names." (error "Files must be a string or a list of strings!"))) (dolist (file files) (goto-char (point-min)) - (when (search-forward-regexp (format "^%s;" file) nil t) + (when (search-forward-regexp (format "^%s;" (regexp-quote file)) = nil t) (end-of-line) (setq end (point)) (beginning-of-line) @@ -125,7 +125,7 @@ Value is a list of all tags for FILE." (image-dired-sane-db-file) (image-dired--with-db-file (let (end (tags "")) - (when (search-forward-regexp (format "^%s" file) nil t) + (when (search-forward-regexp (format "^%s" (regexp-quote file)) nil= t) (end-of-line) (setq end (point)) (beginning-of-line) @@ -179,7 +179,7 @@ FILE-COMMENTS is an alist on the following form: (setq file (car elt) comment (cdr elt)) (goto-char (point-min)) - (if (search-forward-regexp (format "^%s.*$" file) nil t) + (if (search-forward-regexp (format "^%s.*$" (regexp-quote file)) = nil t) (progn (setq end (point)) (beginning-of-line) @@ -236,7 +236,7 @@ Optionally use old comment from FILE as initial value.= " (image-dired-sane-db-file) (image-dired--with-db-file (let (end comment-beg-pos comment-end-pos comment) - (when (search-forward-regexp (format "^%s" file) nil t) + (when (search-forward-regexp (format "^%s" (regexp-quote file)) nil= t) (end-of-line) (setq end (point)) (beginning-of-line) =2D- 2.44.2 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable =2D- Best regards, --=-=-=-- From unknown Sat Sep 06 05:55:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#73445: [PATCH] image-dired: quote file name fore search-forward-regexp Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 24 Sep 2024 18:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73445 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Vitaliy Chepelev , 73445@debbugs.gnu.org Received: via spool by 73445-submit@debbugs.gnu.org id=B73445.172720233622660 (code B ref 73445); Tue, 24 Sep 2024 18:26:01 +0000 Received: (at 73445) by debbugs.gnu.org; 24 Sep 2024 18:25:36 +0000 Received: from localhost ([127.0.0.1]:34208 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stAEC-0005tL-73 for submit@debbugs.gnu.org; Tue, 24 Sep 2024 14:25:36 -0400 Received: from mail-ed1-f44.google.com ([209.85.208.44]:44183) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stAEA-0005mX-7g for 73445@debbugs.gnu.org; Tue, 24 Sep 2024 14:25:35 -0400 Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-5c71f1396e4so578961a12.0 for <73445@debbugs.gnu.org>; Tue, 24 Sep 2024 11:25:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727202244; x=1727807044; darn=debbugs.gnu.org; h=to:subject:message-id:date:mime-version:references:in-reply-to:from :from:to:cc:subject:date:message-id:reply-to; bh=chlchvp4gfGpAIgR8OqEVgr67PQCNBqgLTLMl5V2WwY=; b=KbclCuk/3OC7JwAA/rLSCWBAj4mobyqo6Kw31XcbR8U1Xav0hsrkhfYSIlMtQ9KCHj huJ8HBxqguyNfKjQmhzUQBALT8yXkRDoxAdWCmKtdQtPhxN+fldi/+4G0YvqNhrllplL LQKJfIDLq9DyFEyBs09V81/+k7MitE4EXveyiMTw1uZSOD19fMRsGcUrWlkQ+MUh7yfB dwxsHAM2gag/hSWsl7gF/f2bnT9wyrfJGOT3Ci9vBzTuplQvluSaXyJb/y5Wu1qbhwEW COhWCAMni0KxtoaKBiU3nAZYeFH1eIb+TsVeCu8t0K3Xw1UflSGqOiWJrOD1QkBsml2W tKwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727202244; x=1727807044; h=to:subject:message-id:date:mime-version:references:in-reply-to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=chlchvp4gfGpAIgR8OqEVgr67PQCNBqgLTLMl5V2WwY=; b=xNnME1IkVjp0jhs8sFbMQXs38sNaab3umrlVzwOQY94HyeTxeL7ARl+qAo8Vqu0c1E 02qDOfqlwxPtaV1iYs8e9wfuJeOpfkB5KxnEHkLfLgrWVyERJwUiQdAO2/sqFqDXDf2a KXqtFbnRQpWuczWO0rnmEht8OajymRIicFkTlK+X6tyLmMlYQzu55CS1JqF4kF5nwJSj /CtASdVayaecAiswCiwb29YUsbzaojgmXEjZMyVFlxAgh9D8AGQ+YMBCmbg/zFmNoUoV VdbWaqB4fPBBK6oauJf8JYsfeLgheNXsUUoPGHhHb/i2EV6N7wjLpvt0V2U4257wFz14 vBnA== X-Forwarded-Encrypted: i=1; AJvYcCWjhW9l8WscDn7SY/tcQkIB6F/pRuv0sLya1TgG8zLYUAdCJ9iVPfn5jL8c3vfCGxtiq8oo6g==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yz0jSHm6H/a6X4/G5aYL8dBfxFQ5japDP0p12EoEazNWq/sxm+P pERHL+uYWVxX540viw0dOPRWpQ2cEkZFRp03D6zUBXl+DmTUgc6eNXwboDN3y5HArUmMsLJ9Azl Xjick/F1RnTUlXk26egv0XWkgNTw= X-Google-Smtp-Source: AGHT+IFaGdOrQUIRlYFJSfWGRg11Fa+wLC9sZoHCf2Vufb9qD4CVSKlC9Q4FJaRRBsJKTjfK5T2T0+Bo6HE00OyEZ3c= X-Received: by 2002:a05:6402:5112:b0:5c5:c4b9:e68f with SMTP id 4fb4d7f45d1cf-5c72060acb7mr142060a12.5.1727202243425; Tue, 24 Sep 2024 11:24:03 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Tue, 24 Sep 2024 11:24:02 -0700 From: Stefan Kangas In-Reply-To: <871q19k5v1.fsf@gmx.com> References: <871q19k5v1.fsf@gmx.com> MIME-Version: 1.0 Date: Tue, 24 Sep 2024 11:24:02 -0700 Message-ID: Content-Type: text/plain; charset="UTF-8" X-Spam-Score: -0.0 (/) 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 (-) tags 73445 + pending thanks Could you resend the patch with a correct "From" line so that we can get the attribution right? Currently, the "From" line says: > From: none Other than that, LGTM. Bonus points if you include a ChangeLog according to CONTRIBUTE, but I can easily write that for you. From unknown Sat Sep 06 05:55:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#73445: [PATCH] image-dired: quote file name fore search-forward-regexp Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 05 Oct 2024 01:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73445 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch pending To: Vitaliy Chepelev Cc: 73445@debbugs.gnu.org Received: via spool by 73445-submit@debbugs.gnu.org id=B73445.17280906365297 (code B ref 73445); Sat, 05 Oct 2024 01:11:02 +0000 Received: (at 73445) by debbugs.gnu.org; 5 Oct 2024 01:10:36 +0000 Received: from localhost ([127.0.0.1]:36921 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swtJb-0001NM-To for submit@debbugs.gnu.org; Fri, 04 Oct 2024 21:10:36 -0400 Received: from mail-ej1-f47.google.com ([209.85.218.47]:52449) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swtJa-0001NA-VJ for 73445@debbugs.gnu.org; Fri, 04 Oct 2024 21:10:35 -0400 Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-a8a706236bfso165955466b.0 for <73445@debbugs.gnu.org>; Fri, 04 Oct 2024 18:10:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728090565; x=1728695365; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=rWMRSSlXropyUeYfxLvSjR8OyCr9dfmX2vBf313rnmE=; b=B/O5DMmZl7VQqq/HMe9WXyFqsGZR/dUH3EyWMy0l/AXzwNoKWo/yaQ/5+dUNDyKT1X r89llRQSUC0NhJDsJcpjkHNgzqc4x8fpihQ46GmWJDJQeNz9B1ZWv57HWwKGzG4KeZGg 8q8at56NV1tOUrBw2ZobNovdYv1PPSaL3AgI71m+8YAw1WWAciVVpUMaTgifw3RuwUmn 0hPQmVUdxf0adrLDU0g1hPSyPJacNjZ1NmXywJeGmpmOuMH8dCEQn+HjemeYiS0idPar 1lOQtjftTM4u3zdPjrsP4iMfgKfMD4uk+Rrnljf2bghQM6IPZYrx5fhjSKlm1YYMhr9a wFoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728090565; x=1728695365; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=rWMRSSlXropyUeYfxLvSjR8OyCr9dfmX2vBf313rnmE=; b=nHJPUYUhX6kZxB2y2NPfTAJ4mXWxwofUB/9YDIzE3E6QXho9RJy3S0fFXtx5nYd/YU 1b9Pai4UqRPTF6Y7WH7YvGz9UrnocVsuEgZ1BuQHxyZEObvnH137PenVDTbXfFAeIS8M LgApxhTuXlqWLfZyfYCQyDoxyWCQqsfv5v9vhv9rIVtM3rGFYV52u8LAkt+G9Zv822s4 e1epTsTZsma/dxtgFp3Bj0c2HPagHFHnSm92TH82hfMaG8QPAz5ZOGhKgMq+yCu57JP8 NfKA2r/pi5NUaBk55IWNIcmHo1LlB49VX/J7ctA/1GYO31TomMFbR+eaGQhqxnCcK65J /ftA== X-Gm-Message-State: AOJu0Yy880644Y/D3iPW1ZsfvYcadZ+uA+7SctUtqvB1v3ZbDCy502V2 wUocwZfdxiJLz5Ieu2jwyJVAAgaO9FJw1LwFcTtyuTxcFeSXkxl2fxfJc2IwE8QAIAsc82WRILJ Urp+9DcltshCxQdwgXPDAcOx8aDI= X-Google-Smtp-Source: AGHT+IFS7igjK9NNxKKedXAaGuPRx5gfOnFhbaL4/PS9ibjE0eNPj9atI2/MQYb4bD9FlsA33yLl5EreCAmLy0mBSOA= X-Received: by 2002:a05:6402:35cf:b0:5c5:cb49:2f28 with SMTP id 4fb4d7f45d1cf-5c8d2e16faemr4344944a12.4.1728090564864; Fri, 04 Oct 2024 18:09:24 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Fri, 4 Oct 2024 18:09:24 -0700 From: Stefan Kangas In-Reply-To: (Stefan Kangas's message of "Tue, 24 Sep 2024 11:24:02 -0700") References: <871q19k5v1.fsf@gmx.com> MIME-Version: 1.0 Date: Fri, 4 Oct 2024 18:09:24 -0700 Message-ID: Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) 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 (-) Stefan Kangas writes: > tags 73445 + pending > thanks > > Could you resend the patch with a correct "From" line so that we > can get the attribution right? > > Currently, the "From" line says: > >> From: none > > Other than that, LGTM. > > Bonus points if you include a ChangeLog according to CONTRIBUTE, but I > can easily write that for you. Ping! From unknown Sat Sep 06 05:55:24 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Vitaliy Chepelev Subject: bug#73445: closed (Re: bug#73445: [PATCH] image-dired: quote file name fore search-forward-regexp) Message-ID: References: <871q19k5v1.fsf@gmx.com> X-Gnu-PR-Message: they-closed 73445 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 73445@debbugs.gnu.org Date: Sun, 15 Dec 2024 18:58:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1734289082-20558-1" This is a multi-part message in MIME format... ------------=_1734289082-20558-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #73445: [PATCH] image-dired: quote file name fore search-forward-regexp which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 73445@debbugs.gnu.org. --=20 73445: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D73445 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1734289082-20558-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 73445-done) by debbugs.gnu.org; 15 Dec 2024 18:57:29 +0000 Received: from localhost ([127.0.0.1]:52099 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMto0-0005Kg-Dr for submit@debbugs.gnu.org; Sun, 15 Dec 2024 13:57:29 -0500 Received: from mail-ed1-f46.google.com ([209.85.208.46]:45257) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMtny-0005KO-R3 for 73445-done@debbugs.gnu.org; Sun, 15 Dec 2024 13:57:27 -0500 Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-5d122cf8dd1so5817098a12.2 for <73445-done@debbugs.gnu.org>; Sun, 15 Dec 2024 10:57:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734288976; x=1734893776; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=u9F433RPgqVcbf84Q7de13I8AOZeBfBWOoYkuj5ol3c=; b=HJZHxOUbkzRiuMCNREhcfqoHHCltfW8GTJzwWetZA6ObVPbqVqJEB3yhy5tifBIMM7 TWjzezRoAjNH2CSsTWjA2N+nzfoEclui7M/cegPsJixD8ELmxYJhAR5RNEsaC9O8E9q3 J+YcGFQCB6/FzRZLTVERczha00EDnnuBCYC8k42C60/vEAo0BljNjEypp+4WjJ/PsfPw VObUEOaO7zBjfqrEtA+qpruZvdK1SB+lnPTlBVrsgTgbbpK4GT6dIgQkP8cJTloQn5q8 CmZILIf0gtGO3/XLAgtL032IaaoOa0RNsAze0IufN3tmLc2CLYqBWhr1/rqAS9bcqZN4 ralw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734288976; x=1734893776; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=u9F433RPgqVcbf84Q7de13I8AOZeBfBWOoYkuj5ol3c=; b=vWD0u+faLHymJ/8M4huU9D6/P7165BJiXeWbkkdQJnm5/CPHrg24G8HzYRHYgR8Ksm ayDXiRtlG700sUVKBuPiiUel8W6IS+4t6g9Be7MCD6WAPNRG5YosWy3jU2xv9W+Uiqbu 4WcvsUiNt2sIouALDNwn6Hac6105luwpJUuK5SElaYRQINVwbfvbqTqj8Rx/BX8sCckC EGfNDHd9U3T7eAXho36bRRfuWPdrN1ANEUop9xkpv0ix4sqgyqRES8u+btwE8ipr6dzf vxKnssqhXhoEUhx4ivakoOs1DMDiMRI9JQYTebX33UmpGPRI6q7YAlsK/gIg/LdqLcXd BEzA== X-Gm-Message-State: AOJu0Yz9HSlMi58glhNbQifJk9MSox2PZExWXv2ivU+f5icPHwB8foTM PdI6FBUp6USumxe4o2Gas743ArDuKmXmBU1tQs+/wwK3G790dyOMsI92rcHMzFrQ99TRrmlUzkQ cfyNGNwwUHkuf/6NMsvnu6B8a96k= X-Gm-Gg: ASbGncs2DtNgDPqrCnHvaWWtO/Sz4CLmNXv8HCC+X1DCh/eynoc+Zsxig3/YcaTIfmD oHM4jz7zDWLooP5YgMBFZvIIjxFvn7raiphKd9Ws= X-Google-Smtp-Source: AGHT+IFfe/uHbcQX0NzzWxwmBheYY83C3P67PuxIsRgwyY9hdVwjxVi0P6I568/kzhd9QS8QyDVjWUduf4SU+rrcNzI= X-Received: by 2002:a05:6402:3885:b0:5d0:b931:8db9 with SMTP id 4fb4d7f45d1cf-5d63c32efcemr8965343a12.20.1734288975624; Sun, 15 Dec 2024 10:56:15 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 15 Dec 2024 18:56:15 +0000 From: Stefan Kangas In-Reply-To: <87h67896bi.fsf@gmx.com> References: <871q19k5v1.fsf@gmx.com> <87h67896bi.fsf@gmx.com> MIME-Version: 1.0 Date: Sun, 15 Dec 2024 18:56:15 +0000 Message-ID: Subject: Re: bug#73445: [PATCH] image-dired: quote file name fore search-forward-regexp To: Vitaliy Chepelev Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 73445-done Cc: 73445-done@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 (-) Version: 31.1 Vitaliy Chepelev writes: > From fixed inside .patch. I don't know how to "include a ChangeLog > according to CONTRIBUTE", sorry. Thanks for the patch. Installed on master as commit 7930fe2f44f. > From d0e7b67e10d3ecb34969c0af18ef6317fd96636d Mon Sep 17 00:00:00 2001 > From: vitalij > Date: Tue, 24 Sep 2024 04:25:13 +0000 > Subject: [PATCH] image-dired: quote file name fore search-forward-regexp > > For example when you have file with name "file[image].jpg". and use M-x image-dired you will have error: image-dired-list-tags: Invalid regexp: "Unmatched [ or [^" > --- > lisp/image/image-dired-dired.el | 2 +- > lisp/image/image-dired-tags.el | 10 +++++----- > 2 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/lisp/image/image-dired-dired.el b/lisp/image/image-dired-dired.el > index 7219a10..c4e82e9 100644 > --- a/lisp/image/image-dired-dired.el > +++ b/lisp/image/image-dired-dired.el > @@ -383,7 +383,7 @@ matching tag will be marked in the Dired buffer." > (file-name-directory curr-file))) > (setq curr-file (file-name-nondirectory curr-file)) > (goto-char (point-min)) > - (when (search-forward-regexp (format "\\s %s[*@]?$" curr-file) nil t) > + (when (search-forward-regexp (format "\\s %s[*@]?$" (regexp-quote curr-file)) nil t) > (setq hits (+ hits 1)) > (dired-mark 1)))) > (message "%d files with matching tag marked" hits))) > diff --git a/lisp/image/image-dired-tags.el b/lisp/image/image-dired-tags.el > index 54595ad..828372e 100644 > --- a/lisp/image/image-dired-tags.el > +++ b/lisp/image/image-dired-tags.el > @@ -79,7 +79,7 @@ FILE-TAGS is an alist in the following form: > (setq file (car elt) > tag (cdr elt)) > (goto-char (point-min)) > - (if (search-forward-regexp (format "^%s.*$" file) nil t) > + (if (search-forward-regexp (format "^%s.*$" (regexp-quote file)) nil t) > (progn > (setq end (point)) > (beginning-of-line) > @@ -103,7 +103,7 @@ FILES can be a name of a single file (a string) or a list of file names." > (error "Files must be a string or a list of strings!"))) > (dolist (file files) > (goto-char (point-min)) > - (when (search-forward-regexp (format "^%s;" file) nil t) > + (when (search-forward-regexp (format "^%s;" (regexp-quote file)) nil t) > (end-of-line) > (setq end (point)) > (beginning-of-line) > @@ -125,7 +125,7 @@ Value is a list of all tags for FILE." > (image-dired-sane-db-file) > (image-dired--with-db-file > (let (end (tags "")) > - (when (search-forward-regexp (format "^%s" file) nil t) > + (when (search-forward-regexp (format "^%s" (regexp-quote file)) nil t) > (end-of-line) > (setq end (point)) > (beginning-of-line) > @@ -179,7 +179,7 @@ FILE-COMMENTS is an alist on the following form: > (setq file (car elt) > comment (cdr elt)) > (goto-char (point-min)) > - (if (search-forward-regexp (format "^%s.*$" file) nil t) > + (if (search-forward-regexp (format "^%s.*$" (regexp-quote file)) nil t) > (progn > (setq end (point)) > (beginning-of-line) > @@ -236,7 +236,7 @@ Optionally use old comment from FILE as initial value." > (image-dired-sane-db-file) > (image-dired--with-db-file > (let (end comment-beg-pos comment-end-pos comment) > - (when (search-forward-regexp (format "^%s" file) nil t) > + (when (search-forward-regexp (format "^%s" (regexp-quote file)) nil t) > (end-of-line) > (setq end (point)) > (beginning-of-line) > -- > 2.44.2 > > > Stefan Kangas writes: > >> Stefan Kangas writes: >> >>> tags 73445 + pending >>> thanks >>> >>> Could you resend the patch with a correct "From" line so that we >>> can get the attribution right? >>> >>> Currently, the "From" line says: >>> >>>> From: none >>> >>> Other than that, LGTM. >>> >>> Bonus points if you include a ChangeLog according to CONTRIBUTE, but I >>> can easily write that for you. >> >> Ping! > > -- > Best regards, > Vitaliy Chepelev > Python Middle Data Scientist > https://t.me/vitdata > Magic numbers: 7850B0B5E3F536601D2E6A9DE1C43E074A047699 ------------=_1734289082-20558-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 24 Sep 2024 05:32:11 +0000 Received: from localhost ([127.0.0.1]:45050 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ssy9h-0000Iy-4T for submit@debbugs.gnu.org; Tue, 24 Sep 2024 01:32:11 -0400 Received: from lists.gnu.org ([209.51.188.17]:40760) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ssxc1-0006Zs-8j for submit@debbugs.gnu.org; Tue, 24 Sep 2024 00:57:21 -0400 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 1ssxbd-0005YB-4M for bug-gnu-emacs@gnu.org; Tue, 24 Sep 2024 00:56:57 -0400 Received: from mout.gmx.net ([212.227.17.20]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ssxbb-00064g-B8 for bug-gnu-emacs@gnu.org; Tue, 24 Sep 2024 00:56:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.com; s=s31663417; t=1727153813; x=1727758613; i=vitalij@gmx.com; bh=abOAwcT7nG0u4F/SYF3cJWfiOJFqmrheyEJevBUfN2A=; h=X-UI-Sender-Class:From:To:Subject:Date:Message-ID:MIME-Version: Content-Type:cc:content-transfer-encoding:content-type:date:from: message-id:mime-version:reply-to:subject:to; b=tzw/nV9hE52qLCmo8FUNeksofUeZIDG6O9AhKThbwkfaZWq7447M4fspw6ztFweU Se8vkX+FjpwOOlvDLNLRDPcN/VPZ6ToU4BPOea7R/4K4OquwusKfZD6QviNa6Xzxb a3r/5QxAA61Um0RQfHrfkXxV7ygutyPbUcWmCC8iEDmYtsatCBO83ab1AYIgoAdde OcX6oBTE/kRG8iVgrYotiycytfWfqyH+fj67kU9u2llclKltXOf+UJy9E7naN9xWf CHtpV0BqPHYqXauTRJi6EqPIMlUMwqKVPBKRW4w3UEewiSNSpZi7sirzte8ZgjZ5P XS4vu3EHXTRQKF5SlQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from localhost ([217.196.104.210]) by mail.gmx.net (mrgmx105 [212.227.17.174]) with ESMTPSA (Nemesis) id 1Mel3t-1sLGsa22Mv-00kEah for ; Tue, 24 Sep 2024 06:56:53 +0200 From: Vitaliy Chepelev To: bug-gnu-emacs@gnu.org Subject: [PATCH] image-dired: quote file name fore search-forward-regexp Date: Tue, 24 Sep 2024 04:55:46 -0000 Message-ID: <871q19k5v1.fsf@gmx.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K1:1NvTaAFIC+i1tJJ61oky3u/Sc919AgPYdplF5r/Z+Ekq/fWrLMF Ujn6PeB/a50QkfW1Kjkkh1oWWTZcYA7L0ThSHYC0K0k6yJvARmk+TuBvArR/nzQ+zFZztAt LVVwl552vELWXhLdxoAwUCG98hQRXOcKRlSNdvRnZhO4pufkZpWDst0xTjAJp5J+OGy9BbG VXqs7jtLOp5W6I2Z8snuA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:cPXnrrI3acI=;EY5i6HgrlzlG2wDa+NjLmaHXvjk IYfSu4TfNtr/3ADXn2iQaDhL/+7CovDDM/Vn0gc2j3C5K8DG/nnwjUww8M6KzcEVBjN8RqysF 4Ldc9qtzYug0XHhCwLHYTPX4/KbAR160WtFf+W4Dr/zBVWhN8ifYGE56cLSwYDyUADgpmt84t bfv8NIPNFOnDz3XjSGR/s0iqko3kgnYbAgmzlo8NsNfFCDJytc3vr0Z0sm3Pi4zpHDVsCQiFl hyvaUS57zBPG8ayzXjXAe+kEW2QwUnq6LKYXZk8s1xrlbjTFeUuk5XJakUtCIbHAJqBDYUP3P 4uFWruVUHh2V1R7LVbO7a9FF2EN5HWCxKBqumUAZmSAO7l58PCGax7vQlP2gZJdMPdkucSdtJ wHEKEMPmhmj6BLx1n4dD3n0AKiozSVII+mPkcpKyHXQbImZ042jsjhNi7EaGeE68IpgS4jc8P 1V36/LTjT87YbKenmCRl44ZBFSEPVdKfJdZ5Jx0Mg1d36O6UFC7tCMSqEl+rpI3rDpxysz8go Q6NkPRoIR0hQo8uaFiKy65NT2vsmAWnvGWb06+w6nwpzjGKW4oEK2ojuYz+JQLBqz8aAOGdWO scgVIcAgcuQpccyVmB2/DFZAl/EsJ5VbqbSDwjBWmFB0RmLc4ovpW25Lnqe9IpSHEAx/9yfbz L8v4GaGUFAoB00GdfqhFXNRqjhobkcm4GlcOmJbvP6I6W0VmiSglRjJDQ/7hbwTFNrpdCePlE 3K01r4bDh8xAB5sUj+H7tgUVLY0fgYl5enbtSPLJsoLVM8vLPiEy2uttuwaL1/B0/XD85Z0dA C4zG84s4DgDLc2UqLPYmW5TbHTyEV7N6oGFBO2OHX3al4= Received-SPF: pass client-ip=212.227.17.20; envelope-from=vitalij@gmx.com; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 24 Sep 2024 01:32:05 -0400 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.3 (--) --=-=-= Content-Type: text/plain Tags: patch In GNU Emacs 29.4 (build 1, x86_64-pc-linux-gnu, X toolkit) of 2024-07-29 built on localhost Windowing system distributor 'The X.Org Foundation', version 11.0.12101013 System Description: Gentoo Linux --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-image-dired-quote-file-name-fore-search-forward-rege.patch Content-Transfer-Encoding: quoted-printable =46rom d0e7b67e10d3ecb34969c0af18ef6317fd96636d Mon Sep 17 00:00:00 2001 From: none Date: Tue, 24 Sep 2024 04:25:13 +0000 Subject: [PATCH] image-dired: quote file name fore search-forward-regexp For example when you have file with name "file[image].jpg". and use M-x im= age-dired you will have error: image-dired-list-tags: Invalid regexp: "Unm= atched [ or [^" =2D-- lisp/image/image-dired-dired.el | 2 +- lisp/image/image-dired-tags.el | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lisp/image/image-dired-dired.el b/lisp/image/image-dired-dire= d.el index 7219a10..c4e82e9 100644 =2D-- a/lisp/image/image-dired-dired.el +++ b/lisp/image/image-dired-dired.el @@ -383,7 +383,7 @@ matching tag will be marked in the Dired buffer." (file-name-directory curr-file))) (setq curr-file (file-name-nondirectory curr-file)) (goto-char (point-min)) - (when (search-forward-regexp (format "\\s %s[*@]?$" curr-file) ni= l t) + (when (search-forward-regexp (format "\\s %s[*@]?$" (regexp-quote= curr-file)) nil t) (setq hits (+ hits 1)) (dired-mark 1)))) (message "%d files with matching tag marked" hits))) diff --git a/lisp/image/image-dired-tags.el b/lisp/image/image-dired-tags.= el index 54595ad..828372e 100644 =2D-- a/lisp/image/image-dired-tags.el +++ b/lisp/image/image-dired-tags.el @@ -79,7 +79,7 @@ FILE-TAGS is an alist in the following form: (setq file (car elt) tag (cdr elt)) (goto-char (point-min)) - (if (search-forward-regexp (format "^%s.*$" file) nil t) + (if (search-forward-regexp (format "^%s.*$" (regexp-quote file)) = nil t) (progn (setq end (point)) (beginning-of-line) @@ -103,7 +103,7 @@ FILES can be a name of a single file (a string) or a l= ist of file names." (error "Files must be a string or a list of strings!"))) (dolist (file files) (goto-char (point-min)) - (when (search-forward-regexp (format "^%s;" file) nil t) + (when (search-forward-regexp (format "^%s;" (regexp-quote file)) = nil t) (end-of-line) (setq end (point)) (beginning-of-line) @@ -125,7 +125,7 @@ Value is a list of all tags for FILE." (image-dired-sane-db-file) (image-dired--with-db-file (let (end (tags "")) - (when (search-forward-regexp (format "^%s" file) nil t) + (when (search-forward-regexp (format "^%s" (regexp-quote file)) nil= t) (end-of-line) (setq end (point)) (beginning-of-line) @@ -179,7 +179,7 @@ FILE-COMMENTS is an alist on the following form: (setq file (car elt) comment (cdr elt)) (goto-char (point-min)) - (if (search-forward-regexp (format "^%s.*$" file) nil t) + (if (search-forward-regexp (format "^%s.*$" (regexp-quote file)) = nil t) (progn (setq end (point)) (beginning-of-line) @@ -236,7 +236,7 @@ Optionally use old comment from FILE as initial value.= " (image-dired-sane-db-file) (image-dired--with-db-file (let (end comment-beg-pos comment-end-pos comment) - (when (search-forward-regexp (format "^%s" file) nil t) + (when (search-forward-regexp (format "^%s" (regexp-quote file)) nil= t) (end-of-line) (setq end (point)) (beginning-of-line) =2D- 2.44.2 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable =2D- Best regards, --=-=-=-- ------------=_1734289082-20558-1--