Subject: Re: bug#67600: [PATCH] Add dashes to 'thing-at-point-email-regexp'

From: Philip Kaludercic <[email-masked]>
Date: Sat, 16 Dec 2023 14:50:27 +0000

Eli Zaretskii <[email-masked]> writes:

>> From: Philip Kaludercic <[email-masked]>
>> Cc: [email-masked]
>> Date: Sat, 16 Dec 2023 10:41:32 +0000
>> 
>> Eli Zaretskii <[email-masked]> writes:
>> 
>> >> From: Philip Kaludercic <[email-masked]>
>> >> Cc: [email-masked]
>> >> Date: Tue, 12 Dec 2023 07:21:18 +0000
>> >> 
>> >> Eli Zaretskii <[email-masked]> writes:
>> >> 
>> >> >> From: Philip Kaludercic <[email-masked]>
>> >> >> Date: Sun, 03 Dec 2023 12:52:04 +0000
>> >> >> 
>> >> >> I noticed this recently when trying to extract a link to an mailing list
>> >> >> of mine hosted on SourceHut.
>> >> >
>> >> > Looks like you are adding slashes, not dashes?
>> >> 
>> >> Of course, my bad:
>> >
>> > Thanks.
>> >
>> > My bother here is that this could cause false positives whereby
>> > thing-at-point would recognize file names with slashes as email
>> > addresses.  Because otherwise I don't understand why the slash was
>> > omitted in the first place.  Can we somehow make sure this won't
>> > happen?
>> 
>> One idea might be to just add slashes to the user name part of the
>> address, which would suffice to solve the issue I was having.
>
> Can you show a patch, so we could make sure we are on the same page?

Never mind, I misremembered my own patch, this is already what I am
proposing.

-  "<?[-+_~a-zA-Z0-9][-+_.~:a-zA-Z0-9]*@[-a-zA-Z0-9]+[-.a-zA-Z0-9]*>?"
+  "<?[-+_~a-zA-Z0-9/][-+_.~:a-zA-Z0-9/]*@[-a-zA-Z0-9]+[-.a-zA-Z0-9]*>?"

I had falsely assumed that my suggestion was to apply this change

-  "<?[-+_~a-zA-Z0-9][-+_.~:a-zA-Z0-9]*@[-a-zA-Z0-9/]+[-.a-zA-Z0-9/]*>?"
+  "<?[-+_~a-zA-Z0-9/][-+_.~:a-zA-Z0-9/]*@[-a-zA-Z0-9/]+[-.a-zA-Z0-9/]*>?"

Which would risk more false positives.

-- 
Philip Kaludercic