unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: David Ponce <da_vid@orange.fr>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 65496@debbugs.gnu.org
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	[thread overview]
Message-ID: <92beee30-616b-0f9d-c3ec-52ef66fc9db3@orange.fr> (raw)
In-Reply-To: <83ledk5140.fsf@gnu.org>

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 <da_vid@orange.fr>
>>
>> On 04/09/2023 19:36, Eli Zaretskii wrote:
>>>> Date: Mon, 4 Sep 2023 18:32:22 +0200
>>>> From: David Ponce <da_vid@orange.fr>
>>>>
>>>> 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
<https://netpbm.sourceforge.net/doc/pbm.html>:

   "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







  reply	other threads:[~2023-09-06 14:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-24 10:55 bug#65496: 30.0.50; Issue with the regexp used to auto-detect PBM image data David Ponce
2023-09-04 16:32 ` David Ponce
2023-09-04 17:36   ` Eli Zaretskii
     [not found]     ` <6e4af25a-03b1-ef82-b1c0-2da81938e215@orange.fr>
2023-09-05 11:08       ` Eli Zaretskii
2023-09-06 14:05         ` David Ponce [this message]
2023-09-06 16:00           ` Eli Zaretskii
2023-09-06 16:19             ` David Ponce

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=92beee30-616b-0f9d-c3ec-52ef66fc9db3@orange.fr \
    --to=da_vid@orange.fr \
    --cc=65496@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).