GNU bug report logs - #67600
[PATCH] Add dashes to 'thing-at-point-email-regexp'

Previous Next

Package: emacs;

Reported by: Philip Kaludercic <philipk <at> posteo.net>

Date: Sun, 3 Dec 2023 12:53:02 UTC

Severity: normal

Tags: patch

Done: Philip Kaludercic <philipk <at> posteo.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Philip Kaludercic <philipk <at> posteo.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 67600 <at> debbugs.gnu.org
Subject: bug#67600: [PATCH] Add dashes to 'thing-at-point-email-regexp'
Date: Sat, 16 Dec 2023 14:50:27 +0000
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Philip Kaludercic <philipk <at> posteo.net>
>> Cc: 67600 <at> debbugs.gnu.org
>> Date: Sat, 16 Dec 2023 10:41:32 +0000
>> 
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>> 
>> >> From: Philip Kaludercic <philipk <at> posteo.net>
>> >> Cc: 67600 <at> debbugs.gnu.org
>> >> Date: Tue, 12 Dec 2023 07:21:18 +0000
>> >> 
>> >> Eli Zaretskii <eliz <at> gnu.org> writes:
>> >> 
>> >> >> From: Philip Kaludercic <philipk <at> posteo.net>
>> >> >> 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




This bug report was last modified 1 year and 157 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.