GNU bug report logs - #61519
30.0.50; thing-at-point misdetects emails with numerals in user part

Previous Next

Package: emacs;

Reported by: Aaron Madlon-Kay <aaron <at> madlon-kay.com>

Date: Tue, 14 Feb 2023 23:05:01 UTC

Severity: normal

Tags: fixed

Found in version 30.0.50

Fixed in version 30.1

Done: Robert Pluim <rpluim <at> gmail.com>

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 61519 in the body.
You can then email your comments to 61519 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#61519; Package emacs. (Tue, 14 Feb 2023 23:05:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Aaron Madlon-Kay <aaron <at> madlon-kay.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 14 Feb 2023 23:05:02 GMT) Full text and rfc822 format available.

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

From: Aaron Madlon-Kay <aaron <at> madlon-kay.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; thing-at-point misdetects emails with numerals in user part
Date: Wed, 15 Feb 2023 08:04:26 +0900

1. Launch Emacs with `emacs -Q`
2. Enter an email address with a numeral in the user part, like
   foo0bar <at> example.com
3. With point inside the domain part of the email address, evaluate
   `(thing-at-point 'email)`
4. Result will be `bar <at> example.com` (expected `foo0bar <at> example.com`)

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

---


In GNU Emacs 30.0.50 (build 1, x86_64-apple-darwin22.3.0, NS
appkit-2299.40 Version 13.2 (Build 22D49)) of 2023-01-30 built on
Macmac.local
Windowing system distributor 'Apple', version 10.3.2299
System Description:  macOS 13.2.1

Configured using:
'configure --prefix=/opt/local --disable-silent-rules --without-dbus
--without-gconf --without-libotf --without-m17n-flt --with-libgmp
--with-gnutls --with-json --with-xml2 --with-modules --infodir
/opt/local/share/info/emacs --with-sqlite3 --with-webp --with-ns
--with-lcms2 --without-harfbuzz --without-imagemagick --without-xaw3d
--with-tree-sitter --with-rsvg --with-native-compilation=aot
'CFLAGS=-pipe -Os -Wno-attributes
-isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -arch
x86_64' 'CPPFLAGS=-I/opt/local/include
-isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk'
'LDFLAGS=-L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-rpath
/opt/local/lib/gcc12 -Wl,-no_pie
-Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk
-arch x86_64''

Configured features:
ACL GIF GLIB GMP GNUTLS JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP
NOTIFY KQUEUE NS PDUMPER PNG RSVG SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM ZLIB

Important settings:
  value of $LC_ALL: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: ELisp/l

Minor modes in effect:
  paredit-mode: t
  global-diff-hl-mode: t
  diff-hl-mode: t
  dap-tooltip-mode: t
  dap-ui-many-windows-mode: t
  dap-ui-controls-mode: t
  dap-ui-mode: t
  treemacs-filewatch-mode: t
  treemacs-follow-mode: t
  treemacs-git-mode: t
  treemacs-fringe-indicator-mode: t
  dap-auto-configure-mode: t
  dap-mode: t
  rainbow-delimiters-mode: t
  rainbow-mode: t
  company-quickhelp-mode: t
  company-quickhelp-local-mode: t
  global-company-mode: t
  company-mode: t
  editorconfig-mode: t
  csv-field-index-mode: t
  beacon-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  global-flycheck-mode: t
  flycheck-mode: t
  which-key-mode: t
  auto-sudoedit-mode: 0
  recentf-mode: t
  counsel-projectile-mode: t
  projectile-mode: t
  all-the-icons-ivy-rich-mode: t
  ivy-rich-mode: t
  counsel-mode: t
  pcre-mode: t
  global-git-commit-mode: t
  magit-auto-revert-mode: t
  pdf-occur-global-minor-mode: t
  ivy-mode: t
  shell-dirtrack-mode: t
  global-subword-mode: t
  subword-mode: t
  desktop-save-mode: t
  override-global-mode: t
  pixel-scroll-precision-mode: t
  server-mode: t
  global-display-line-numbers-mode: t
  display-line-numbers-mode: t
  delete-selection-mode: t
  electric-pair-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  global-prettify-symbols-mode: t
  prettify-symbols-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  hs-minor-mode: t

Load-path shadows:
/opt/local/share/emacs/site-lisp/cmake-mode hides /Users/amake/.emacs.d/elpa-30/cmake-mode-20230209.1921/cmake-mode
/Users/amake/.emacs.d/elpa-30/transient-20230213.1337/transient hides /Applications/MacPorts/Emacs.app/Contents/Resources/lisp/transient

Features:
(shadow mail-extr emacsbug cl-print amk-vterm benchmark ido loaddefs-gen
tar-mode arc-mode archive-mode mm-archive url-cache magit-patch
magit-subtree magit-extras magit-gitignore magit-ediff emoji-github
py-autopep8 emacs-news-mode paredit dired-aux vc-hg vc-bzr vc-src
vc-sccs vc-svn vc-cvs vc-rcs diff-hl-dired all-the-icons-dired
dired-collapse dired-hacks-utils tcl make-mode org-eldoc image-file
image-converter oc-basic ol-eww ol-rmail ol-mhe ol-irc ol-info ol-gnus
nnselect gnus-art mm-uu mml2015 mm-view mml-smime smime dig gnus-sum
gnus-group gnus-undo gnus-start gnus-dbus dbus gnus-cloud nnimap nnmail
mail-source utf7 nnoo gnus-spec gnus-int gnus-range gnus-win ol-docview
doc-view ol-bibtex bibtex ol-bbdb ol-w3m ol-doi org-link-doi conf-mode
hl-tags-mode cl rng-xsd xsd-regexp rng-cmpct rng-nxml rng-valid rng-loc
rng-uri rng-parse nxml-parse rng-match rng-dt rng-util rng-pttrn nxml-ns
nxml-mode nxml-outln nxml-rap nxml-util nxml-enc xmltok shfmt flyspell
ispell yaml-mode diff-hl log-view vc-dir dap-mouse dap-ui gdb-mi bindat
gud bui bui-list bui-info bui-entry bui-core bui-history bui-button
bui-utils lsp-modeline lsp-headerline lsp-icons lsp-diagnostics view
lsp-zig lsp-steep lsp-svelte lsp-sqls lsp-ruby-syntax-tree lsp-yaml
lsp-xml lsp-vimscript lsp-vhdl lsp-volar lsp-vetur lsp-html lsp-verilog
lsp-vala lsp-v lsp-typeprof lsp-ttcn3 lsp-toml lsp-terraform lsp-tex
lsp-sourcekit lsp lsp-sorbet lsp-solargraph lsp-rust lsp-rf lsp-remark
lsp-racket lsp-r lsp-purescript lsp-pylsp lsp-pyls lsp-pwsh lsp-php
lsp-pls lsp-perlnavigator lsp-perl lsp-openscad lsp-ocaml lsp-magik
lsp-nix lsp-nim lsp-nginx lsp-mint lsp-marksman lsp-markdown lsp-lua
lsp-kotlin lsp-json lsp-javascript lsp-idris lsp-haxe lsp-groovy
lsp-hack lsp-graphql lsp-gleam lsp-go lsp-completion lsp-gdscript
lsp-fsharp lsp-fortran lsp-eslint lsp-erlang lsp-emmet lsp-elixir
lsp-elm lsp-dockerfile lsp-dhall lsp-d lsp-css lsp-csharp lsp-crystal
lsp-cmake lsp-clojure lsp-semantic-tokens lsp-clangd lsp-beancount
lsp-bash lsp-astro lsp-ansible lsp-angular lsp-ada lsp-actionscript
lsp-ui lsp-ui-flycheck lsp-ui-imenu lsp-ui-peek lsp-ui-sideline
lsp-ui-doc goto-addr csharp-mode c-ts-common dap-java lsp-java lsp-ivy
lsp-dart lsp-dart-commands lsp-dart-flutter-widget-guide
lsp-dart-flutter-fringe-colors lsp-dart-flutter-colors lsp-dart-outline
lsp-dart-code-lens lsp-lens lsp-dart-test-tree lsp-treemacs
lsp-treemacs-generic lsp-treemacs-themes treemacs-treelib
treemacs-projectile treemacs treemacs-header-line treemacs-compatibility
treemacs-mode treemacs-bookmarks treemacs-tags treemacs-interface
treemacs-persistence treemacs-filewatch-mode treemacs-follow-mode
treemacs-rendering treemacs-annotations treemacs-async
treemacs-workspaces treemacs-dom treemacs-visuals
treemacs-fringe-indicator treemacs-scope pulse treemacs-faces
treemacs-icons treemacs-themes treemacs-core-utils pfuture hl-line
treemacs-logging treemacs-customization treemacs-macros
lsp-dart-test-output lsp-dart-test-support lsp-dart-dap
lsp-dart-devtools lsp-dart-flutter-daemon jsonrpc ert dap-utils dap-mode
dap-tasks dap-launch lsp-docker posframe dap-overlays
lsp-dart-closing-labels lsp-dart-utils lsp-dart-protocol lsp-mode
spinner network-stream lv inline ewoc lsp-protocol ht lsp-ui-util vc-git
vc vc-dispatcher hideshow rainbow-delimiters rainbow-mode
flutter-l10n-flycheck flutter flutter-l10n flutter-project dart-mode
company-oddmuse company-keywords company-etags etags fileloop
company-gtags company-dabbrev-code company-dabbrev company-files
company-clang company-capf company-cmake company-semantic
company-template company-bbdb company-quickhelp pos-tip company init
nodejs-repl pug-mode coffee-mode docker docker-volume docker-network
docker-image docker-container docker-faces docker-core docker-compose
docker-process docker-utils docker-group aio editorconfig
editorconfig-core editorconfig-core-handle editorconfig-fnmatch csv-mode
sort vterm term disp-table ehelp vterm-module term/xterm xterm
cmake-mode rst jq-mode beacon yasnippet flycheck-kotlin
flycheck-commitlint flycheck-committed flycheck-yard flycheck-dart-sass
flycheck-sassc flycheck-innosetup flycheck-shfmt shfmt-common sh-script
executable flycheck-package package-lint finder flycheck kotlin-mode
kotlin-mode-indent kotlin-mode-lexer which-key vue-l10n helpful cc-langs
trace edebug debug backtrace info-look help-fns radix-tree elisp-refs
nginx-mode auto-sudoedit tramp-sh recentf tree-widget f f-shortdoc
vlf-setup vlf vlf-base vlf-tune dumb-jump popup s edit-string
counsel-projectile projectile lisp-mnt grep all-the-icons-ibuffer
all-the-icons-ivy-rich ivy-rich all-the-icons all-the-icons-faces
data-material data-weathericons data-octicons data-fileicons
data-faicons data-alltheicons two-column counsel xref swiper
ruby-test-mode inf-ruby ruby-mode cc-mode cc-fonts cc-guess cc-menus
cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs crdt forms
forms-mode pcre2el rxt re-builder git-link orgit-forge orgit forge-list
forge-commands forge-semi forge-bitbucket buck forge-gogs gogs
forge-gitea gtea forge-gitlab glab forge-github ghub-graphql treepy
gsexp ghub url-http url-gw nsm url-auth gnutls forge-notify
forge-revnote forge-pullreq forge-issue forge-topic yaml bug-reference
forge-post markdown-mode edit-indirect forge-repo forge forge-core
forge-db closql emacsql-sqlite emacsql emacsql-compiler magit-bookmark
magit-submodule magit-obsolete magit-blame magit-stash magit-reflog
magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote
magit-commit magit-sequence magit-notes magit-worktree magit-tag
magit-merge magit-branch magit-reset magit-files magit-refs magit-status
magit magit-repos magit-apply magit-wip magit-log which-func magit-diff
smerge-mode diff diff-mode git-commit log-edit message sendmail
yank-media rfc822 mml mml-sec epa derived epg rfc6068 epg-config
mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045
ietf-drums mailabbrev gmm-utils pcvs-util add-log magit-core
magit-autorevert autorevert filenotify magit-margin magit-transient
magit-process with-editor comp comp-cstr warnings magit-mode magit-git
magit-base magit-section crm org-pdftools pdf-occur ibuf-ext ibuffer
ibuffer-loaddefs pdf-isearch let-alist pdf-annot tablist advice
tablist-filter semantic/wisent/comp semantic/wisent
semantic/wisent/wisent semantic/util-modes semantic/util semantic
semantic/tag semantic/lex semantic/fw mode-local cedet pdf-misc
pdf-tools pdf-view bookmark jka-compr pdf-cache pdf-info tq pdf-util
pdf-macs org-noter org-element org-persist org-id avl-tree generator
org-refile org-backlog backlog ivy ivy-faces ivy-overlay colir request
mailheader org-tempo tempo dash async ob-ruby ob-python python project
ob-dot ob-shell org org-macro org-pcomplete org-list org-footnote
org-faces org-entities noutline outline ob-emacs-lisp org-table
org-loaddefs find-func cal-menu calendar cal-loaddefs ob-async tramp
tramp-loaddefs trampver tramp-integration files-x tramp-compat
parse-time iso8601 ls-lisp ob-passthrough ob ob-tangle ol org-src ob-ref
ob-lob ob-table ob-exp ob-comint ob-core org-cycle org-fold
org-fold-core ob-eval org-keys oc org-compat org-version org-macs
css-mode treesit smie imenu eww url-queue shr pixel-fill kinsoku
url-file svg xml puny mm-url gnus nnheader gnus-util time-date
mail-utils range mm-util mail-prsvr color dired-x amk-dired
amk-dired-mac image-dired image-dired-tags image-dired-external
image-dired-util xdg ediff ediff-merg ediff-mult ediff-wind ediff-diff
ediff-help ediff-init ediff-util cus-edit pp cus-load icons wid-edit
image-mode dired dired-loaddefs exif shell pcomplete cap-words superword
subword desktop frameset macports macports-select macports-installed
macports-outdated macports-describe thingatpt macports-core compile
text-property-search comint ansi-osc transient format-spec compat
scale-to-fit face-remap reformatter ansi-color amk-mac amk-xml sgml-mode
facemenu dom edmacro kmacro exec-path-from-shell
use-package-ensure-system-package diminish cl-extra help-mode finder-inf
use-package use-package-ensure use-package-delight use-package-diminish
use-package-bind-key bind-key easy-mmode use-package-core pixel-scroll
cua-base ring server display-line-numbers delsel elec-pair custom-file
pcase auto-sudoedit-autoloads lsp-ivy-autoloads reformatter-autoloads
hide-lines-autoloads counsel-projectile-autoloads lsp-java-autoloads
edit-indirect-autoloads lsp-sourcekit-autoloads diff-hl-autoloads
paredit-autoloads pyvenv-autoloads svelte-mode-autoloads
rainbow-delimiters-autoloads all-the-icons-ivy-rich-autoloads
helpful-autoloads elisp-refs-autoloads lsp-dart-autoloads
flycheck-package-autoloads yaml-mode-autoloads flycheck-kotlin-autoloads
counsel-autoloads ivy-rich-autoloads go-mode-autoloads
kotlin-mode-autoloads lsp-ui-autoloads cmake-mode-autoloads
company-quickhelp-autoloads company-autoloads docker-autoloads
aio-autoloads terraform-mode-autoloads nginx-mode-autoloads
csv-mode-autoloads ob-async-autoloads crdt-autoloads hcl-mode-autoloads
vlf-autoloads pug-mode-autoloads all-the-icons-dired-autoloads
jq-mode-autoloads swiper-autoloads ivy-autoloads org-contrib-autoloads
dash-at-point-autoloads coffee-mode-autoloads dumb-jump-autoloads
dart-mode-autoloads rainbow-mode-autoloads popup-autoloads
vterm-autoloads which-key-autoloads graphviz-dot-mode-autoloads
request-autoloads flycheck-autoloads pos-tip-autoloads
ruby-test-mode-autoloads py-autopep8-autoloads dap-mode-autoloads
lsp-docker-autoloads lsp-treemacs-autoloads expand-region-autoloads
json-mode-autoloads rx json-snatcher-autoloads org-pdftools-autoloads
org-noter-autoloads nodejs-repl-autoloads git-link-autoloads
apache-mode-autoloads pdf-tools-autoloads tablist-autoloads
inf-ruby-autoloads pkg-info-autoloads epl-autoloads diminish-autoloads
groovy-mode-autoloads typescript-mode-autoloads beacon-autoloads
bui-autoloads web-mode-autoloads treemacs-projectile-autoloads
treemacs-autoloads cfrs-autoloads posframe-autoloads hydra-autoloads
pfuture-autoloads ace-window-autoloads avy-autoloads
projectile-autoloads yasnippet-autoloads pcre2el-autoloads
dockerfile-mode-autoloads all-the-icons-ibuffer-autoloads
all-the-icons-autoloads dired-collapse-autoloads
dired-hacks-utils-autoloads lsp-mode-autoloads lv-autoloads
spinner-autoloads prettier-autoloads editorconfig-autoloads
nvm-autoloads f-autoloads s-autoloads iter2-autoloads ht-autoloads
jest-test-mode-autoloads async-autoloads free-keys-autoloads
package-lint-autoloads exec-path-from-shell-autoloads
orgit-forge-autoloads orgit-autoloads forge-autoloads yaml-autoloads
markdown-mode-autoloads magit-autoloads magit-section-autoloads
git-commit-autoloads with-editor-autoloads transient-autoloads
ghub-autoloads treepy-autoloads dash-autoloads closql-autoloads
emacsql-sqlite-autoloads emacsql-autoloads info compat-autoloads
swift-mode-autoloads early-init package browse-url url url-proxy
url-privacy url-expand url-methods url-history url-cookie
generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs password-cache json subr-x
map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc
iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook
vc-hooks lisp-float-type elisp-mode mwheel term/ns-win ns-win
ucs-normalize mule-util term/common-win tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads kqueue cocoa ns lcms2
multi-tty make-network-process native-compile emacs)

Memory information:
((conses 16 1620320 827570)
(symbols 48 102949 1121)
(strings 32 435004 231186)
(string-bytes 1 13032964)
(vectors 16 209870)
(vector-slots 8 4281952 1068627)
(floats 8 1654 3481)
(intervals 56 24416 11684)
(buffers 984 147))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61519; Package emacs. (Wed, 15 Feb 2023 11:16:02 GMT) Full text and rfc822 format available.

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

From: Robert Pluim <rpluim <at> gmail.com>
To: Aaron Madlon-Kay <aaron <at> madlon-kay.com>
Cc: 61519 <at> debbugs.gnu.org
Subject: Re: bug#61519: 30.0.50; thing-at-point misdetects emails with
 numerals in user part
Date: Wed, 15 Feb 2023 12:15:48 +0100
>>>>> On Wed, 15 Feb 2023 08:04:26 +0900, Aaron Madlon-Kay <aaron <at> 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 <at> 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 <at> example.com` (expected `foo0bar <at> 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 <at> 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-zA-Z][-+_.~: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 regular expression probably matching an email address.
 This does not match the real name portion, only the address, optionally
 with angle brackets.")




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61519; Package emacs. (Thu, 23 Feb 2023 14:41:01 GMT) Full text and rfc822 format available.

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

From: Robert Pluim <rpluim <at> gmail.com>
To: Aaron Madlon-Kay <aaron <at> madlon-kay.com>
Cc: 61519 <at> debbugs.gnu.org
Subject: Re: 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 <at> gmail.com> said:

>>>>> On Wed, 15 Feb 2023 08:04:26 +0900, Aaron Madlon-Kay <aaron <at> 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 <at> 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 <at> example.com` (expected `foo0bar <at> 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 <at> 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
-- 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61519; Package emacs. (Fri, 10 Mar 2023 15:36:02 GMT) Full text and rfc822 format available.

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

From: Robert Pluim <rpluim <at> gmail.com>
To: Aaron Madlon-Kay <aaron <at> madlon-kay.com>
Cc: 61519 <at> debbugs.gnu.org
Subject: Re: bug#61519: 30.0.50; thing-at-point misdetects emails with
 numerals in user part
Date: Fri, 10 Mar 2023 16:35:15 +0100
tags 61519 fixed
close 61519 30.1
quit

Closing.
Committed as 03cfede8f0a

This has been broken since at least emacs-23, so itʼs not an
emacs-29-worthy regression.

Robert
-- 




Added tag(s) fixed. Request was from Robert Pluim <rpluim <at> gmail.com> to control <at> debbugs.gnu.org. (Fri, 10 Mar 2023 15:36:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 30.1, send any further explanations to 61519 <at> debbugs.gnu.org and Aaron Madlon-Kay <aaron <at> madlon-kay.com> Request was from Robert Pluim <rpluim <at> gmail.com> to control <at> debbugs.gnu.org. (Fri, 10 Mar 2023 15:36:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 08 Apr 2023 11:24:05 GMT) Full text and rfc822 format available.

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

Previous Next


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