From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: David Ponce Newsgroups: gmane.emacs.bugs Subject: bug#65496: 30.0.50; Issue with the regexp used to auto-detect PBM image data Date: Wed, 6 Sep 2023 16:05:39 +0200 Message-ID: <92beee30-616b-0f9d-c3ec-52ef66fc9db3@orange.fr> References: <2fea228e-a8e8-5b8e-b91d-2d808d624649@orange.fr> <83wmx54z95.fsf@gnu.org> <6e4af25a-03b1-ef82-b1c0-2da81938e215@orange.fr> <83ledk5140.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10609"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 Cc: 65496@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 06 16:06:24 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qdtAl-0002Vu-DE for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 06 Sep 2023 16:06:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qdtAT-0001Rq-Jf; Wed, 06 Sep 2023 10:06:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qdtAR-0001RK-1d for bug-gnu-emacs@gnu.org; Wed, 06 Sep 2023 10:06:03 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qdtAQ-00009k-HC for bug-gnu-emacs@gnu.org; Wed, 06 Sep 2023 10:06:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qdtAQ-0003FU-9i for bug-gnu-emacs@gnu.org; Wed, 06 Sep 2023 10:06:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: David Ponce Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 Sep 2023 14:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65496 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 65496-submit@debbugs.gnu.org id=B65496.169400914512450 (code B ref 65496); Wed, 06 Sep 2023 14:06:02 +0000 Original-Received: (at 65496) by debbugs.gnu.org; 6 Sep 2023 14:05:45 +0000 Original-Received: from localhost ([127.0.0.1]:37055 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdtA8-0003Ek-Gb for submit@debbugs.gnu.org; Wed, 06 Sep 2023 10:05:44 -0400 Original-Received: from smtp-25.smtpout.orange.fr ([80.12.242.25]:56698 helo=smtp.smtpout.orange.fr) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdtA6-0003Ea-7B for 65496@debbugs.gnu.org; Wed, 06 Sep 2023 10:05:43 -0400 Original-Received: from [192.168.1.15] ([2.7.71.181]) by smtp.orange.fr with ESMTPA id dtA3qUEYV1in9dtA3qhkim; Wed, 06 Sep 2023 16:05:39 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=orange.fr; s=t20230301; t=1694009139; bh=ZkgmNEG1V+Cxn4IgXP0ZCtJpSaot3v1gKfgtI6c1gr8=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=gOPRs1HyylrLuAuqg6WmrIZuLa+QLYCVFi+6KbWjm2TWQnFzsIJs3bwKmviZm0b0v gD2Rtt1AJBQIfXKiXb0Rb8+q0yiDc7SeTSAk6vpZWXpziTkm5pr9uv6IjrQbj1Zf7Z cJmlXHQ2ARtQWlhmGpIgtuYZYursqHEFd2fANtptMxQaVUEQknmlCUKuXH7Vncos+f 6emCGzJq0QQ+gaGl+VF0TtrUepW9YgKo7ZW3dL5HCgJpPnsHOxCObrfUW1oqCZVW2X Vbq8aCMV1M9YI7Sj/0lMW6Pq0cniHG1OdzBBY+y6SaekcrqZiwah26czlbLAlzJo9r BySzRfJmg0plQ== X-ME-Helo: [192.168.1.15] X-ME-Auth: ZGFfdmlkQHdhbmFkb28uZnI= X-ME-Date: Wed, 06 Sep 2023 16:05:39 +0200 X-ME-IP: 2.7.71.181 Content-Language: fr, en-US In-Reply-To: <83ledk5140.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:269546 Archived-At: On 05/09/2023 13:08, Eli Zaretskii wrote: > [I presume you didn't intend to discuss this only with me in private.] Hi Eli, You are right, my mistake, I did reply instead of reply to all :-\ I am sorry. > >> Date: Mon, 4 Sep 2023 23:43:56 +0200 >> From: David Ponce >> >> On 04/09/2023 19:36, Eli Zaretskii wrote: >>>> Date: Mon, 4 Sep 2023 18:32:22 +0200 >>>> From: David Ponce >>>> >>>> I wonder if it is expected that matching a regular expression >>>> against a string object depends on the syntax-table setup in current >>>> buffer? Shouldn't (standard-syntax-table) implied when matching a >>>> regexp against a string object, that is, regardless of any buffer >>>> context? >>> >>> Not necessarily, because you wouldn't expect, say, looking-at to >>> return a different result than (string-match-p (buffer-string)), would >>> you? >> >> Sure, from this perspective you are right. However, for other cases >> where the string object is not related to a buffer value, it's not so >> clear ;-) >> >>> This belongs to the gray areas of Emacs. The same situation exists >>> with functions like downcase, which use the buffer-local value of >>> case-table. >> >> I can understand that. Many things are not only black or white ;-) >> >> Maybe for the use case of auto-detecting image type from image data, >> my proposed patch to replace character class by a list of unambiguous >> explicit character values in the regexp could make sense? > > Yes, it makes sense, but are you sure you mention there all the > characters that can happen in PBM images, and only those characters? Yes, according to the specification of pbm available at : "Each PBM image consists of the following: * A "magic number" for identifying the file type. A pbm image's magic number is the two characters "P4". ==> * Whitespace (blanks, TABs, CRs, LFs). <== * The width in pixels of the image, formatted as ASCII characters in decimal. ..." Thanks