From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.devel Subject: Re: goto-address-at-point doesn't get the right url when there is a trailing ')' Date: Thu, 15 Jun 2017 09:51:31 +0000 Message-ID: References: <878tkv3rii.fsf@gmail.com> <877f0e5169.fsf@gmail.com> <8737b14o6r.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="001a11407a7ab416d00551fc9dff" X-Trace: blaine.gmane.org 1497520317 14525 195.159.176.226 (15 Jun 2017 09:51:57 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 15 Jun 2017 09:51:57 +0000 (UTC) Cc: Emacs developers , Yuri Khan To: Amos Bird Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 15 11:51:53 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dLRRP-0003MY-4w for ged-emacs-devel@m.gmane.org; Thu, 15 Jun 2017 11:51:51 +0200 Original-Received: from localhost ([::1]:52951 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLRRU-0007ie-5L for ged-emacs-devel@m.gmane.org; Thu, 15 Jun 2017 05:51:56 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLRRJ-0007iY-4Y for emacs-devel@gnu.org; Thu, 15 Jun 2017 05:51:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dLRRH-0003oz-W8 for emacs-devel@gnu.org; Thu, 15 Jun 2017 05:51:45 -0400 Original-Received: from mail-ot0-x234.google.com ([2607:f8b0:4003:c0f::234]:34612) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dLRRH-0003os-PZ for emacs-devel@gnu.org; Thu, 15 Jun 2017 05:51:43 -0400 Original-Received: by mail-ot0-x234.google.com with SMTP id r67so6305954ota.1 for ; Thu, 15 Jun 2017 02:51:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=U/Y9hodrghl+rh5AYsfKAU4Y4q3PGjnT+6UwN0tlnVc=; b=Tf/323V/bmgPVGMgX1vBr+IdspYORK3kZvutD4GlzURu75WWd4hySVmG1qWxFvPlJg czHt8udIC4HzFQ7gwHpF94+MAAFYE3i0TorgDWXY5yln0lEvZjj1zNIv9mQxa8T4SKqc gKgZMfnbokG/h4XjnRHkETXpp6lHncNFCSFNjliVg6sQiBy0BUZuiLXvotDqZfXElRNR bSZKdKGq4pTmXPqlaE4sfQroviZN1ZdkBOIubXLdkYa+vZGlDI86Ke91AkKMoFXB4sR3 3oMJLn6PkLn1z0+uAUEDQo5r04+ZsVvvxWA7ykKnWIQnfe6U4pHfXhq4ee1CQr1EvOwA /AHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=U/Y9hodrghl+rh5AYsfKAU4Y4q3PGjnT+6UwN0tlnVc=; b=V8CHMHI37QiRMveEQl4/WU08TbhOF7WkFobGg6q/C/b59LIln+NRXZE9eSc/GSRI9A OdzmldT6O9JKd3FDGXXn0xNGcGYHXgyQqSDTUBYZe7E9Cc01Oh1skfN3b+hpv8xH1fhi uGWkDr70LTBxy+frPk72dmJKwdP/PpIi1UrC27uQvfX4qEcWbhh0rqiLnfaBIyTv8O0N eeGVF1+q9sHeUni/BIZ6wYaZe+BbiSwLS0Vs+xKn1W9GmlujNoUCsxgm2JqmNP+JuOra s99p3QOxQwN5P1vSngEs6IIH4IRZllopqN0JrSrdhi+cni17p88aT2ZfTmXn6xZ0H53N XC/A== X-Gm-Message-State: AKS2vOyjJtOjXVCZnHm2idBscPZG14zZ7kUFel4x1pfJ7Hqi5e1J3UC2 6gDwWthvfqd7666ga2TaZoONwudvHA== X-Received: by 10.157.16.8 with SMTP id h8mr2907290ote.80.1497520302971; Thu, 15 Jun 2017 02:51:42 -0700 (PDT) In-Reply-To: <8737b14o6r.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c0f::234 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:215634 Archived-At: --001a11407a7ab416d00551fc9dff Content-Type: multipart/alternative; boundary="001a11407a7ab416cb0551fc9dfd" --001a11407a7ab416cb0551fc9dfd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable The attached patch appears to do the right thing for me (but I haven't tested it extensively). Amos Bird schrieb am Do., 15. Juni 2017 um 11:04 Uhr: > > hmm, can you try doing it at a prog mode? say cc-mode or java-mode. > > Philipp Stephani writes: > > > Yuri Khan schrieb am Mi., 14. Juni 2017 um > > 17:03 Uhr: > > > >> On Wed, Jun 14, 2017 at 5:11 PM, Amos Bird wrote: > >> > >> > When doing (goto-address-at-point) at parenthesis surrounded urls > like > >> this > >> > (https://github.com/nikomatsakis/rayon/issues/231) in any prog mode > (c, > >> java, python ...) > >> > > >> > it will grab the trailing ')' thus ends up with opening a wrong url. > >> > >> > Could you tell me a workaround for this? > >> > >> Don=E2=80=99t do that, then? > >> > >> A closing parenthesis is a valid URL character. Any heuristic that > >> fixes your problem will break legal, standard-conforming URLs, such as > >> this: > >> > >> https://en.wikipedia.org/wiki/Dunnet_(video_game) > >> > > > > The URL heuristic could match only paired parentheses. At least that's > what > > my mail app appears to be doing, as it correctly matches both URLs. > > --001a11407a7ab416cb0551fc9dfd Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
The attached patch appears to do the right thing for me (b= ut I haven't tested it extensively).

=
Amos Bird <amosbi= rd@gmail.com> schrieb am Do., 15. Juni 2017 um 11:04=C2=A0Uhr:

hmm, can you try doing it at a prog mode? say cc-mode or java-mode.

Philipp Stephani <p.stephani2@gmail.com> writes:

> Yuri Khan <yuri.v.khan@gmail.com> schrieb am Mi., 14. Juni 2017 um
> 17:03 Uhr:
>
>> On Wed, Jun 14, 2017 at 5:11 PM, Amos Bird <amosbird@gmail.com> wrote:
>>
>> > When doing=C2=A0 (goto-address-at-point) at parenthesis surro= unded urls like
>> this
>> > (https://github.com/nikomatsakis/rayon= /issues/231) in any prog mode (c,
>> java, python ...)
>> >
>> > it will grab the trailing ')' thus ends up with openi= ng a wrong url.
>>
>> > Could you tell me a workaround for this?
>>
>> Don=E2=80=99t do that, then?
>>
>> A closing parenthesis is a valid URL character. Any heuristic that=
>> fixes your problem will break legal, standard-conforming URLs, suc= h as
>> this:
>>
>>=C2=A0 =C2=A0 =C2=A0https://en.wikipedia.or= g/wiki/Dunnet_(video_game)
>>
>
> The URL heuristic could match only paired parentheses. At least that&#= 39;s what
> my mail app appears to be doing, as it correctly matches both URLs.
--001a11407a7ab416cb0551fc9dfd-- --001a11407a7ab416d00551fc9dff Content-Type: text/plain; charset="US-ASCII"; name="0001-Correctly-detect-URLs-surrounded-by-parentheses-in-com.txt" Content-Disposition: attachment; filename="0001-Correctly-detect-URLs-surrounded-by-parentheses-in-com.txt" Content-Transfer-Encoding: base64 Content-ID: <15cab2a33f388723bf51> X-Attachment-Id: 15cab2a33f388723bf51 RnJvbSA5Yzc4MGI2ZWYwNmNhY2FkOTg5ZWE2MTc1OTQ0YWY5NWMzOTczZjE0IE1vbiBTZXAgMT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AgICAgICAgICAgICAgICAgICAgICAgICAgICAobGV0ICgocGFyc2Utc2V4cC1pZ25v cmUtY29tbWVudHMgbmlsKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHNj YW4tbGlzdHMgKDEtIHVybC1iZWcpIDEgMCkpKSkpCiAJICAgICAobm90IChibGluay1tYXRjaGlu Zy1jaGVjay1taXNtYXRjaCAoMS0gdXJsLWJlZykgcGFyZW4tZW5kKSkKIAkgICAgIChzZXRxIGVu ZCAoMS0gcGFyZW4tZW5kKSkpCiAJOzsgRW5zdXJlIFBUIGlzIGFjdHVhbGx5IHdpdGhpbiBCT1VO REFSWS4gQ2hlY2sgdGhlIGZvbGxvd2luZwotLSAKMi4xMy4xCgo= --001a11407a7ab416d00551fc9dff--