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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 67600 in the body.
You can then email your comments to 67600 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#67600; Package emacs. (Sun, 03 Dec 2023 12:53:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Philip Kaludercic <philipk <at> posteo.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 03 Dec 2023 12:53:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Philip Kaludercic <philipk <at> posteo.net>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Add dashes to 'thing-at-point-email-regexp'
Date: Sun, 03 Dec 2023 12:52:04 +0000
[Message part 1 (text/plain, inline)]
Tags: patch


I noticed this recently when trying to extract a link to an mailing list
of mine hosted on SourceHut.

In GNU Emacs 30.0.50 (build 3, x86_64-pc-linux-gnu, X toolkit, cairo
 version 1.16.0, Xaw scroll bars) of 2023-11-25 built on icterid
Repository revision: 78eb99c72c6834a9161fc4e3f3cef3fc6bdffefd
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101007
System Description: Debian GNU/Linux 12 (bookworm)

Configured using:
 'configure --with-imagemagick --with-x-toolkit=lucid
 --with-native-compilation=aot --with-tree-sitter 'CFLAGS=-O2
 -march=native -mtune=native -pipe''

[0001-Add-dashes-to-thing-at-point-email-regexp.patch (text/patch, attachment)]
[Message part 3 (text/plain, inline)]
-- 
Philip Kaludercic

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67600; Package emacs. (Sun, 03 Dec 2023 13:15:02 GMT) Full text and rfc822 format available.

Message #8 received at 67600 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: 67600 <at> debbugs.gnu.org
Subject: Re: bug#67600: [PATCH] Add dashes to 'thing-at-point-email-regexp'
Date: Sun, 03 Dec 2023 15:14:45 +0200
> 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?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67600; Package emacs. (Tue, 12 Dec 2023 07:22:01 GMT) Full text and rfc822 format available.

Message #11 received at 67600 <at> debbugs.gnu.org (full text, mbox):

From: Philip Kaludercic <philipk <at> posteo.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 67600 <at> debbugs.gnu.org
Subject: Re: bug#67600: [PATCH] Add dashes to 'thing-at-point-email-regexp'
Date: Tue, 12 Dec 2023 07:21:18 +0000
[Message part 1 (text/plain, inline)]
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:

[0001-Add-slashes-to-thing-at-point-email-regexp.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67600; Package emacs. (Tue, 12 Dec 2023 12:07:02 GMT) Full text and rfc822 format available.

Message #14 received at 67600 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: 67600 <at> debbugs.gnu.org
Subject: Re: bug#67600: [PATCH] Add dashes to 'thing-at-point-email-regexp'
Date: Tue, 12 Dec 2023 14:06:03 +0200
> 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?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67600; Package emacs. (Tue, 12 Dec 2023 12:22:01 GMT) Full text and rfc822 format available.

Message #17 received at 67600 <at> debbugs.gnu.org (full text, mbox):

From: Visuwesh <visuweshm <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Philip Kaludercic <philipk <at> posteo.net>, 67600 <at> debbugs.gnu.org
Subject: Re: bug#67600: [PATCH] Add dashes to 'thing-at-point-email-regexp'
Date: Tue, 12 Dec 2023 17:51:32 +0530
[Tuesday December 12, 2023] Eli Zaretskii wrote:

> 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?

I am running Emacs with the same change before Philip created this bug
report and so far I haven't had false positives for email addresses
because files with a @ in its name is rare.  In practise, I think this
patch is harmless in that regard.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67600; Package emacs. (Tue, 12 Dec 2023 12:28:02 GMT) Full text and rfc822 format available.

Message #20 received at 67600 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Visuwesh <visuweshm <at> gmail.com>
Cc: philipk <at> posteo.net, 67600 <at> debbugs.gnu.org
Subject: Re: bug#67600: [PATCH] Add dashes to 'thing-at-point-email-regexp'
Date: Tue, 12 Dec 2023 14:27:13 +0200
> From: Visuwesh <visuweshm <at> gmail.com>
> Cc: Philip Kaludercic <philipk <at> posteo.net>,  67600 <at> debbugs.gnu.org
> Date: Tue, 12 Dec 2023 17:51:32 +0530
> 
> [Tuesday December 12, 2023] Eli Zaretskii wrote:
> 
> > 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?
> 
> I am running Emacs with the same change before Philip created this bug
> report and so far I haven't had false positives for email addresses
> because files with a @ in its name is rare.  In practise, I think this
> patch is harmless in that regard.

Remote files that have user <at> host in their names do have that
character.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67600; Package emacs. (Tue, 12 Dec 2023 12:43:02 GMT) Full text and rfc822 format available.

Message #23 received at 67600 <at> debbugs.gnu.org (full text, mbox):

From: Visuwesh <visuweshm <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: philipk <at> posteo.net, 67600 <at> debbugs.gnu.org
Subject: Re: bug#67600: [PATCH] Add dashes to 'thing-at-point-email-regexp'
Date: Tue, 12 Dec 2023 18:11:47 +0530
[Tuesday December 12, 2023] Eli Zaretskii wrote:

>> From: Visuwesh <visuweshm <at> gmail.com>
>> Cc: Philip Kaludercic <philipk <at> posteo.net>,  67600 <at> debbugs.gnu.org
>> Date: Tue, 12 Dec 2023 17:51:32 +0530
>> 
>> [Tuesday December 12, 2023] Eli Zaretskii wrote:
>> 
>> > 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?
>> 
>> I am running Emacs with the same change before Philip created this bug
>> report and so far I haven't had false positives for email addresses
>> because files with a @ in its name is rare.  In practise, I think this
>> patch is harmless in that regard.
>
> Remote files that have user <at> host in their names do have that
> character.

AFAIU, user cannot have slashes in them as per the POSIX standards [1]
and likewise with hostname so remote files should not pose a problem.
Of course this assumes that you're only looking at methods like ssh,
doas, sudo, etc.  It seems like tramp disallows slashes in user and host
anyway, try:

    (file-remote-p "/ssh:userwith/@host:/") ;; => nil
    (file-remote-p "/ssh:userwith <at> host/:/") ;; => nil
    (file-remote-p "/ssh:userwith <at> host:/") ;; => /ssh:userwith <at> host:

1. https://serverfault.com/a/578264




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67600; Package emacs. (Tue, 12 Dec 2023 13:10:02 GMT) Full text and rfc822 format available.

Message #26 received at 67600 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Visuwesh <visuweshm <at> gmail.com>
Cc: philipk <at> posteo.net, 67600 <at> debbugs.gnu.org
Subject: Re: bug#67600: [PATCH] Add dashes to 'thing-at-point-email-regexp'
Date: Tue, 12 Dec 2023 15:08:41 +0200
> From: Visuwesh <visuweshm <at> gmail.com>
> Cc: philipk <at> posteo.net,  67600 <at> debbugs.gnu.org
> Date: Tue, 12 Dec 2023 18:11:47 +0530
> 
> [Tuesday December 12, 2023] Eli Zaretskii wrote:
> 
> >> I am running Emacs with the same change before Philip created this bug
> >> report and so far I haven't had false positives for email addresses
> >> because files with a @ in its name is rare.  In practise, I think this
> >> patch is harmless in that regard.
> >
> > Remote files that have user <at> host in their names do have that
> > character.
> 
> AFAIU, user cannot have slashes in them as per the POSIX standards [1]
> and likewise with hostname so remote files should not pose a problem.
> Of course this assumes that you're only looking at methods like ssh,
> doas, sudo, etc.  It seems like tramp disallows slashes in user and host
> anyway, try:
> 
>     (file-remote-p "/ssh:userwith/@host:/") ;; => nil
>     (file-remote-p "/ssh:userwith <at> host/:/") ;; => nil
>     (file-remote-p "/ssh:userwith <at> host:/") ;; => /ssh:userwith <at> host:

Why are you talking about slashes in user and host names?  There are
slashes in remote file names outside of those two.  Are you saying
that slashes in thing-at-point-email-regexp will only ever match if
they are in the user or host names?  That's not what I see:

  (string-match "<?[-+_~a-zA-Z0-9/][-+_.~:a-zA-Z0-9/]*@[-a-zA-Z0-9]+[-.a-zA-Z0-9]*>?" 
    "/ssh:userwith <at> host:/what/ever/it/can/be")
      => 0




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67600; Package emacs. (Tue, 12 Dec 2023 13:24:02 GMT) Full text and rfc822 format available.

Message #29 received at 67600 <at> debbugs.gnu.org (full text, mbox):

From: Visuwesh <visuweshm <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: philipk <at> posteo.net, 67600 <at> debbugs.gnu.org
Subject: Re: bug#67600: [PATCH] Add dashes to 'thing-at-point-email-regexp'
Date: Tue, 12 Dec 2023 18:53:25 +0530
[Tuesday December 12, 2023] Eli Zaretskii wrote:

>> From: Visuwesh <visuweshm <at> gmail.com>
>> Cc: philipk <at> posteo.net,  67600 <at> debbugs.gnu.org
>> Date: Tue, 12 Dec 2023 18:11:47 +0530
>> 
>> [Tuesday December 12, 2023] Eli Zaretskii wrote:
>> 
>> >> I am running Emacs with the same change before Philip created this bug
>> >> report and so far I haven't had false positives for email addresses
>> >> because files with a @ in its name is rare.  In practise, I think this
>> >> patch is harmless in that regard.
>> >
>> > Remote files that have user <at> host in their names do have that
>> > character.
>> 
>> AFAIU, user cannot have slashes in them as per the POSIX standards [1]
>> and likewise with hostname so remote files should not pose a problem.
>> Of course this assumes that you're only looking at methods like ssh,
>> doas, sudo, etc.  It seems like tramp disallows slashes in user and host
>> anyway, try:
>> 
>>     (file-remote-p "/ssh:userwith/@host:/") ;; => nil
>>     (file-remote-p "/ssh:userwith <at> host/:/") ;; => nil
>>     (file-remote-p "/ssh:userwith <at> host:/") ;; => /ssh:userwith <at> host:
>
> Why are you talking about slashes in user and host names?  There are
> slashes in remote file names outside of those two.  Are you saying
> that slashes in thing-at-point-email-regexp will only ever match if
> they are in the user or host names?  That's not what I see:
>
>   (string-match "<?[-+_~a-zA-Z0-9/][-+_.~:a-zA-Z0-9/]*@[-a-zA-Z0-9]+[-.a-zA-Z0-9]*>?" 
>     "/ssh:userwith <at> host:/what/ever/it/can/be")
>       => 0

I see what you mean now.  But the problem is that even without the
slashes in the regexp, the filename you gave matches:

   (string-match "<?[-+_~a-zA-Z0-9][-+_.~:a-zA-Z0-9]*@[-a-zA-Z0-9]+[-.a-zA-Z0-9]*>?" 
     "/ssh:userwith <at> host:/what/ever/it/can/be") ;; => 1

the matched string is ssh:userwith <at> host.  So the old regexp will still
return false positives when the point is on userwith <at> host I think.

With the slashes, the matched string is /ssh:userwith <at> host.  If we drop
the slash from the first character class i.e.,

   (string-match "<?[-+_~a-zA-Z0-9][-+_.~:a-zA-Z0-9/]*@[-a-zA-Z0-9]+[-.a-zA-Z0-9]*>?" 
     "/ssh:userwith <at> host:/what/ever/it/can/be") ;; => 1

then the matched string is again ssh:userwith <at> host.  And this regexp
still matches the sr.ht list email addresses (this is the regexp I use
in my Emacs checkout).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67600; Package emacs. (Tue, 12 Dec 2023 13:37:01 GMT) Full text and rfc822 format available.

Message #32 received at 67600 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Visuwesh <visuweshm <at> gmail.com>
Cc: philipk <at> posteo.net, 67600 <at> debbugs.gnu.org
Subject: Re: bug#67600: [PATCH] Add dashes to 'thing-at-point-email-regexp'
Date: Tue, 12 Dec 2023 15:35:06 +0200
> From: Visuwesh <visuweshm <at> gmail.com>
> Cc: philipk <at> posteo.net,  67600 <at> debbugs.gnu.org
> Date: Tue, 12 Dec 2023 18:53:25 +0530
> 
> >>     (file-remote-p "/ssh:userwith/@host:/") ;; => nil
> >>     (file-remote-p "/ssh:userwith <at> host/:/") ;; => nil
> >>     (file-remote-p "/ssh:userwith <at> host:/") ;; => /ssh:userwith <at> host:
> >
> > Why are you talking about slashes in user and host names?  There are
> > slashes in remote file names outside of those two.  Are you saying
> > that slashes in thing-at-point-email-regexp will only ever match if
> > they are in the user or host names?  That's not what I see:
> >
> >   (string-match "<?[-+_~a-zA-Z0-9/][-+_.~:a-zA-Z0-9/]*@[-a-zA-Z0-9]+[-.a-zA-Z0-9]*>?" 
> >     "/ssh:userwith <at> host:/what/ever/it/can/be")
> >       => 0
> 
> I see what you mean now.  But the problem is that even without the
> slashes in the regexp, the filename you gave matches:
> 
>    (string-match "<?[-+_~a-zA-Z0-9][-+_.~:a-zA-Z0-9]*@[-a-zA-Z0-9]+[-.a-zA-Z0-9]*>?" 
>      "/ssh:userwith <at> host:/what/ever/it/can/be") ;; => 1
> 
> the matched string is ssh:userwith <at> host.  So the old regexp will still
> return false positives when the point is on userwith <at> host I think.
> 
> With the slashes, the matched string is /ssh:userwith <at> host.  If we drop
> the slash from the first character class i.e.,
> 
>    (string-match "<?[-+_~a-zA-Z0-9][-+_.~:a-zA-Z0-9/]*@[-a-zA-Z0-9]+[-.a-zA-Z0-9]*>?" 
>      "/ssh:userwith <at> host:/what/ever/it/can/be") ;; => 1

Yes, but now it matches without the leading slash, i.e. not entirely.
But see bug#67688.  My bother is that this change could perhaps
increase the probability of such mis-guesses.  Not sure it matters,
I'm just asking.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67600; Package emacs. (Tue, 12 Dec 2023 14:27:02 GMT) Full text and rfc822 format available.

Message #35 received at 67600 <at> debbugs.gnu.org (full text, mbox):

From: Visuwesh <visuweshm <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: philipk <at> posteo.net, 67600 <at> debbugs.gnu.org
Subject: Re: bug#67600: [PATCH] Add dashes to 'thing-at-point-email-regexp'
Date: Tue, 12 Dec 2023 19:55:37 +0530
[Tuesday December 12, 2023] Eli Zaretskii wrote:

>> I see what you mean now.  But the problem is that even without the
>> slashes in the regexp, the filename you gave matches:
>> 
>>    (string-match "<?[-+_~a-zA-Z0-9][-+_.~:a-zA-Z0-9]*@[-a-zA-Z0-9]+[-.a-zA-Z0-9]*>?" 
>>      "/ssh:userwith <at> host:/what/ever/it/can/be") ;; => 1
>> 
>> the matched string is ssh:userwith <at> host.  So the old regexp will still
>> return false positives when the point is on userwith <at> host I think.
>> 
>> With the slashes, the matched string is /ssh:userwith <at> host.  If we drop
>> the slash from the first character class i.e.,
>> 
>>    (string-match "<?[-+_~a-zA-Z0-9][-+_.~:a-zA-Z0-9/]*@[-a-zA-Z0-9]+[-.a-zA-Z0-9]*>?" 
>>      "/ssh:userwith <at> host:/what/ever/it/can/be") ;; => 1
>
> Yes, but now it matches without the leading slash, i.e. not entirely.
> But see bug#67688.  My bother is that this change could perhaps
> increase the probability of such mis-guesses.  Not sure it matters,
> I'm just asking.

Thanks for the pointer but changing the email address regexp will have
no effect on the return value of (thing-at-point 'filename), and this is
what ffap does (along with other heuristics), and others will do when
they want to get the filename at point.

But IME, the filename thing-at-point matches are really limited compared
to the additional heuristics that ffap employs to match filename but
they still aren't perfect: filenames with spaces in them are only picked
up by ffap only when the point is over the "first word".




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67600; Package emacs. (Sat, 16 Dec 2023 10:42:01 GMT) Full text and rfc822 format available.

Message #38 received at 67600 <at> debbugs.gnu.org (full text, mbox):

From: Philip Kaludercic <philipk <at> posteo.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 67600 <at> debbugs.gnu.org
Subject: Re: bug#67600: [PATCH] Add dashes to 'thing-at-point-email-regexp'
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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67600; Package emacs. (Sat, 16 Dec 2023 13:40:02 GMT) Full text and rfc822 format available.

Message #41 received at 67600 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: 67600 <at> debbugs.gnu.org
Subject: Re: bug#67600: [PATCH] Add dashes to 'thing-at-point-email-regexp'
Date: Sat, 16 Dec 2023 15:38:31 +0200
> 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?

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67600; Package emacs. (Sat, 16 Dec 2023 14:51:02 GMT) Full text and rfc822 format available.

Message #44 received at 67600 <at> debbugs.gnu.org (full text, mbox):

From: Philip Kaludercic <philipk <at> posteo.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 67600 <at> debbugs.gnu.org
Subject: Re: 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67600; Package emacs. (Sat, 16 Dec 2023 15:01:02 GMT) Full text and rfc822 format available.

Message #47 received at 67600 <at> debbugs.gnu.org (full text, mbox):

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

Thanks.

If you think the patch is safe enough, feel free to install.  If there
are problems with it, I guess we will hear about them sooner or later.




Reply sent to Philip Kaludercic <philipk <at> posteo.net>:
You have taken responsibility. (Sun, 17 Dec 2023 12:12:01 GMT) Full text and rfc822 format available.

Notification sent to Philip Kaludercic <philipk <at> posteo.net>:
bug acknowledged by developer. (Sun, 17 Dec 2023 12:12:02 GMT) Full text and rfc822 format available.

Message #52 received at 67600-done <at> debbugs.gnu.org (full text, mbox):

From: Philip Kaludercic <philipk <at> posteo.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 67600-done <at> debbugs.gnu.org
Subject: Re: bug#67600: [PATCH] Add dashes to 'thing-at-point-email-regexp'
Date: Sun, 17 Dec 2023 12:11:26 +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 14:50:27 +0000
>> 
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>> 
>> > 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.
>
> Thanks.
>
> If you think the patch is safe enough, feel free to install.  If there
> are problems with it, I guess we will hear about them sooner or later.

OK thanks, done.

-- 
Philip Kaludercic




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 14 Jan 2024 12:24:05 GMT) Full text and rfc822 format available.

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

Previous Next


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