From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#67600: [PATCH] Add dashes to 'thing-at-point-email-regexp' Date: Tue, 12 Dec 2023 15:35:06 +0200 Message-ID: <83r0jrtugl.fsf@gnu.org> References: <87v89fh2iz.fsf@posteo.net> <83plzn77i2.fsf@gnu.org> <87wmtjnaxd.fsf@posteo.net> <831qbrvd5g.fsf@gnu.org> <87il53txv7.fsf@gmail.com> <83y1dztxlq.fsf@gnu.org> <87edfrtwxg.fsf@gmail.com> <83ttontvom.fsf@gnu.org> <87a5qftv02.fsf@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2830"; mail-complaints-to="usenet@ciao.gmane.io" Cc: philipk@posteo.net, 67600@debbugs.gnu.org To: Visuwesh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 12 14:37:10 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 1rD2we-0000Sd-EC for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 12 Dec 2023 14:37:08 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rD2wK-0007j7-ND; Tue, 12 Dec 2023 08:36:48 -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 1rD2wI-0007it-Q4 for bug-gnu-emacs@gnu.org; Tue, 12 Dec 2023 08:36:47 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rD2wI-0008I6-Hr for bug-gnu-emacs@gnu.org; Tue, 12 Dec 2023 08:36:46 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rD2wX-0004w3-TP for bug-gnu-emacs@gnu.org; Tue, 12 Dec 2023 08:37:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 12 Dec 2023 13:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67600 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 67600-submit@debbugs.gnu.org id=B67600.170238816318895 (code B ref 67600); Tue, 12 Dec 2023 13:37:01 +0000 Original-Received: (at 67600) by debbugs.gnu.org; 12 Dec 2023 13:36:03 +0000 Original-Received: from localhost ([127.0.0.1]:55552 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rD2vb-0004ug-6b for submit@debbugs.gnu.org; Tue, 12 Dec 2023 08:36:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34748) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rD2vZ-0004u8-3l for 67600@debbugs.gnu.org; Tue, 12 Dec 2023 08:36:01 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rD2v9-0008CD-Js; Tue, 12 Dec 2023 08:35:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=6G17fJH0Yb0Xrl53Qvaq1H9/SHf0sHLEMLkeffDuomQ=; b=NmDnA1KlPQRf TSQ6j3IUBrfg0REAtQhpg2M+Jm9h37pBoa7wT6mwsFlw/bsSlhmwwlDvIByZHzLdtoBy0vFeZv6Vx Av/tjAGCJk16tqx2qeL8+VZzlLlekIYahq2ClLCcuKxVe5402eJjSqoEpzTIOYSVs87sGV9/QhxjL 9QqwOSU0uBh6b0LIZTcQmekzFxoQptYEzSbE/R22RnrBFJHt/85TJu91XQEdCnSB/n2nim4IePAmP ZiJbiuuR0YdTnXeblTv6gE8HZha+Xu9WsY7yFJk08rTNy433HJ+dZrf/Vefb7cg1jIDsRaeaXwzV9 If+wzCFVxe5cBFrhKsO0EA==; In-Reply-To: <87a5qftv02.fsf@gmail.com> (message from Visuwesh on Tue, 12 Dec 2023 18:53:25 +0530) 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:276041 Archived-At: > From: Visuwesh > Cc: philipk@posteo.net, 67600@debbugs.gnu.org > Date: Tue, 12 Dec 2023 18:53:25 +0530 > > >> (file-remote-p "/ssh:userwith/@host:/") ;; => nil > >> (file-remote-p "/ssh:userwith@host/:/") ;; => nil > >> (file-remote-p "/ssh:userwith@host:/") ;; => /ssh:userwith@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 "?" > > "/ssh:userwith@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 "?" > "/ssh:userwith@host:/what/ever/it/can/be") ;; => 1 > > the matched string is ssh:userwith@host. So the old regexp will still > return false positives when the point is on userwith@host I think. > > With the slashes, the matched string is /ssh:userwith@host. If we drop > the slash from the first character class i.e., > > (string-match "?" > "/ssh:userwith@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.