bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#61519: 30.0.50; thing-at-point misdetects emails with numerals in us


From: Robert Pluim
Subject: bug#61519: 30.0.50; thing-at-point misdetects emails with numerals in user part
Date: Thu, 23 Feb 2023 15:40:41 +0100

>>>>> On Wed, 15 Feb 2023 12:15:48 +0100, Robert Pluim <rpluim@gmail.com> said:

>>>>> On Wed, 15 Feb 2023 08:04:26 +0900, Aaron Madlon-Kay 
>>>>> <aaron@madlon-kay.com> said:
    Aaron> 1. Launch Emacs with `emacs -Q`
    Aaron> 2. Enter an email address with a numeral in the user part, like
    Aaron> foo0bar@example.com
    Aaron> 3. With point inside the domain part of the email address, evaluate
    Aaron> `(thing-at-point 'email)`
    Aaron> 4. Result will be `bar@example.com` (expected `foo0bar@example.com`)

    Aaron> The cause of this is the implementation of 
`thing-at-point-looking-at'
    Aaron> where it backs up one character at a time to find the start of the
    Aaron> email. The value for `thing-at-point-email-regexp' allows numbers in
    Aaron> the user part only from the *second* character, so as the function
    Aaron> backs up it will mistakenly find the `0` in `0bar@example.com` to be
    Aaron> outside of the email address.

    Robert> That regexp has a few other issues, but breaking out the full rfc 
822
    Robert> parser for this would be overkill. Could you try the following 
patch?

ping

The patch works for me, so Iʼll commit it sometime in the next few
days unless I hear any different from you.

Robert
-- 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]