all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Visuwesh <visuweshm@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: philipk@posteo.net, 67600@debbugs.gnu.org
Subject: bug#67600: [PATCH] Add dashes to 'thing-at-point-email-regexp'
Date: Tue, 12 Dec 2023 19:55:37 +0530	[thread overview]
Message-ID: <875y13ts4e.fsf@gmail.com> (raw)
In-Reply-To: <83r0jrtugl.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 12 Dec 2023 15:35:06 +0200")

[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@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 "<?[-+_~a-zA-Z0-9][-+_.~:a-zA-Z0-9/]*@[-a-zA-Z0-9]+[-.a-zA-Z0-9]*>?" 
>>      "/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.

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".





  reply	other threads:[~2023-12-12 14:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-03 12:52 bug#67600: [PATCH] Add dashes to 'thing-at-point-email-regexp' Philip Kaludercic
2023-12-03 13:14 ` Eli Zaretskii
2023-12-12  7:21   ` Philip Kaludercic
2023-12-12 12:06     ` Eli Zaretskii
2023-12-12 12:21       ` Visuwesh
2023-12-12 12:27         ` Eli Zaretskii
2023-12-12 12:41           ` Visuwesh
2023-12-12 13:08             ` Eli Zaretskii
2023-12-12 13:23               ` Visuwesh
2023-12-12 13:35                 ` Eli Zaretskii
2023-12-12 14:25                   ` Visuwesh [this message]
2023-12-16 10:41       ` Philip Kaludercic
2023-12-16 13:38         ` Eli Zaretskii
2023-12-16 14:50           ` Philip Kaludercic
2023-12-16 14:59             ` Eli Zaretskii
2023-12-17 12:11               ` Philip Kaludercic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875y13ts4e.fsf@gmail.com \
    --to=visuweshm@gmail.com \
    --cc=67600@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=philipk@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.