From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#61519: 30.0.50; thing-at-point misdetects emails with numerals in user part Date: Wed, 15 Feb 2023 12:15:48 +0100 Message-ID: <87a61fp4bf.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34423"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 61519@debbugs.gnu.org To: Aaron Madlon-Kay Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 15 12:16:18 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pSFlp-0008jK-T1 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 15 Feb 2023 12:16:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSFld-0006nV-3t; Wed, 15 Feb 2023 06:16:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSFla-0006nF-Ug for bug-gnu-emacs@gnu.org; Wed, 15 Feb 2023 06:16:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pSFla-0005Mu-Lz for bug-gnu-emacs@gnu.org; Wed, 15 Feb 2023 06:16:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pSFla-0008TN-HQ for bug-gnu-emacs@gnu.org; Wed, 15 Feb 2023 06:16:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Feb 2023 11:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61519 X-GNU-PR-Package: emacs Original-Received: via spool by 61519-submit@debbugs.gnu.org id=B61519.167645975932557 (code B ref 61519); Wed, 15 Feb 2023 11:16:02 +0000 Original-Received: (at 61519) by debbugs.gnu.org; 15 Feb 2023 11:15:59 +0000 Original-Received: from localhost ([127.0.0.1]:58003 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSFlW-0008T3-TP for submit@debbugs.gnu.org; Wed, 15 Feb 2023 06:15:59 -0500 Original-Received: from mail-wm1-f46.google.com ([209.85.128.46]:36577) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSFlU-0008Sp-O3 for 61519@debbugs.gnu.org; Wed, 15 Feb 2023 06:15:57 -0500 Original-Received: by mail-wm1-f46.google.com with SMTP id g6-20020a05600c310600b003e1f6dff952so1297082wmo.1 for <61519@debbugs.gnu.org>; Wed, 15 Feb 2023 03:15:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=8rcIrB4NwAfw4fVEryeiSRrjPubRqjZlbUxv+NnoOR0=; b=GPg+AlsJtoph175nT6pmy9Ua3LrwfHhyXLrBfJwvQldG3vCdoMVVWsMxGhMkjlRYMV GFAInxV2dhZaeHSTeLVVHRtkkD28LUwRNWK4bn+Le8kbbUp6sqjnrybd5GsnQx1S/8eN aTKFqt8aRuF1l0wvXEiF6ClHSYPGR7wTO17GKxyXAOTytt6VJX28zwcFspg9sVYQFunj e6Cx8Lv6ZD8O8nkodMuaJi384gEyhT7e+sY73A1bTJ/Np4Xvk5MpeFNxnFkbOkvT0j6o 7+Z1tymej8xK2diPjxlEGTBFP9VywFXHfWCA5/6ZhLExTNtFB3ZAjV+TZj26Uk69U+3n tiWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=8rcIrB4NwAfw4fVEryeiSRrjPubRqjZlbUxv+NnoOR0=; b=HRzkw0Sgxw3jJQalhtF2DgvtLfmZVjDD5wJ1L9kajCo+HBoS+mXeml/4k81OVpoe5l +5vCLxRz1rrKMC8cJDTkfUmqvk5s7Q+JCp372/V6ceQUmIw+wy03sQtUsl+/HpttL096 mtCZDhMdS6nJUFZxCsrRn5t957HIsr8GGHF0S98mkBda4zA3+7qbVYlnZc3uaiWr5ob+ VQKIfQC2XRUQX3jdw7Oq+70QMjQwH+idHuXeQHP0vtutQYuocAKYV0gk9AGsThrcKVxD Cv6en/9JOEdioUyXCq55RBdr0he+VPkQeBDz1NfFW4a7D4qCUbKZvGFnzoSTjtL0wJoH xBcg== X-Gm-Message-State: AO0yUKVIBx+9Fu+FEtMTvZFUzxU6hwJeiJDi5Mm4e+30FyrikRML2sU4 fKMsygUP0ZJnYYTmegCBQhAZVv7q3sM= X-Google-Smtp-Source: AK7set/iDEwXs6RaDesvJ5FPbe3q780uRXkURqV5MuROBbNQmYSqVx+W8CxUcPGHCOK0J0X4zti2vg== X-Received: by 2002:a05:600c:91d:b0:3e2:5c3:bcfc with SMTP id m29-20020a05600c091d00b003e205c3bcfcmr853858wmp.18.1676459750161; Wed, 15 Feb 2023 03:15:50 -0800 (PST) Original-Received: from rltb ([82.66.8.55]) by smtp.gmail.com with ESMTPSA id w19-20020a05600c099300b003db03725e86sm1789725wmp.8.2023.02.15.03.15.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Feb 2023 03:15:49 -0800 (PST) In-Reply-To: (Aaron Madlon-Kay's message of "Wed, 15 Feb 2023 08:04:26 +0900") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:255679 Archived-At: >>>>> On Wed, 15 Feb 2023 08:04:26 +0900, Aaron Madlon-Kay 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. That regexp has a few other issues, but breaking out the full rfc 822 parser for this would be overkill. Could you try the following patch? Robert -- diff --git i/lisp/thingatpt.el w/lisp/thingatpt.el index 9363a474cb5..f3367290dee 100644 --- i/lisp/thingatpt.el +++ w/lisp/thingatpt.el @@ -645,7 +645,7 @@ thing-at-point-looking-at ;; Email addresses (defvar thing-at-point-email-regexp - "?" + "?" "A regular expression probably matching an email address. This does not match the real name portion, only the address, optionally with angle brackets.")