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#74132: 31.0.50; thing-at-pt, ffap and Github markdown Date: Sat, 09 Nov 2024 12:29:10 +0200 Message-ID: <86msi8n1jd.fsf@gnu.org> References: <20241031.160649.1619221016115134543.enometh@meer.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27994"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 74132@debbugs.gnu.org To: Madhu , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 09 11:30:15 2024 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 1t9ijO-00076b-1q for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 09 Nov 2024 11:30:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t9ijI-0002zL-Lt; Sat, 09 Nov 2024 05:30:08 -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 1t9ijE-0002wj-6q for bug-gnu-emacs@gnu.org; Sat, 09 Nov 2024 05:30:04 -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 1t9ijD-0000p0-TX for bug-gnu-emacs@gnu.org; Sat, 09 Nov 2024 05:30:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=9+QLby33DRgk3RKE2qTIYHI0Tb0vvK/CrvQMOOWsoik=; b=BPt0nBifQtwldzWGORKKyTpRXiU/zGlYUgr53ZRvOi5u0SNUH0VEYGjBlv//pWK+ToluAWZcm1T3vxyOHtKVlG6ZmtDPn/aFNYmq4/ebWvakcAvYs9c+XEJStuMagkplvFwVzlQWdR1a6VmsmVM5Q+sunncb8RBU77Oah611jzS0IfFWCu8Wi2s5/1FGurSr2FkPA4mZcMWLApda6eEoqxTF9btVTm7kgqG9laBAplugeLhAUA6C6eycyuZKBt56ABZ1NNuMB54E+r+G47R6UhfDGY1njxR18uH/euBco2m1zMt4Y9LponAacyoTF13VKi5zyNGuyB9m//4nM9XfTw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t9ijC-0004mc-P7 for bug-gnu-emacs@gnu.org; Sat, 09 Nov 2024 05:30:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 09 Nov 2024 10:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74132 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 74132-submit@debbugs.gnu.org id=B74132.173114816618316 (code B ref 74132); Sat, 09 Nov 2024 10:30:02 +0000 Original-Received: (at 74132) by debbugs.gnu.org; 9 Nov 2024 10:29:26 +0000 Original-Received: from localhost ([127.0.0.1]:53531 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t9iib-0004lM-V5 for submit@debbugs.gnu.org; Sat, 09 Nov 2024 05:29:26 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:40462) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t9iiY-0004l8-GN for 74132@debbugs.gnu.org; Sat, 09 Nov 2024 05:29:25 -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 1t9iiS-0000kb-1D; Sat, 09 Nov 2024 05:29:16 -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=9+QLby33DRgk3RKE2qTIYHI0Tb0vvK/CrvQMOOWsoik=; b=FytwC3NOfnDY kHvyg9C6IyW7ID4gCGIL13XrRUBLB6vo+ZAtGTMor6VsNj2VoPwuitG4tMiQrB5hrIAhME5ZwJUz3 Sl2m1qixwDmOuzz3wsCB/8LZWG88MkNYQOJ9K/HjfLe1hOTzykgoV1YqHQxm1HtU/2qZJMLRUywBC SX36b7jS78fWAmGQ9EzphazFKgTZULdsgnEmv76kL+vkiqp5/HyY4ShQKHQMxQXS9vcVo21tV4kFK AlbtLu/IXiLFz4dyWVlVVjlE8y30uM/y5ES30gjrV98i8mDxEupFabVVFbryMjzocIdL4d5GLVzxo vvw3ammPUEc6MDMEZXWxqA==; In-Reply-To: <20241031.160649.1619221016115134543.enometh@meer.net> (message from Madhu on Thu, 31 Oct 2024 16:06:49 +0530 (IST)) 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:295120 Archived-At: > Date: Thu, 31 Oct 2024 16:06:49 +0530 (IST) > From: Madhu > > Consider the following text as is typically found on README.md > > ``` > [![GitHub Releases Downloads](https://img.shields.io/github/downloads/raysan5/raylib/total)](https://github.com/raysan5/raylib/releases) > ``` > > If the point is say at "r" at "raylib/releases", invoking > (ffap-url-at-point) fails. this eventually calls > thing-at-point-bounds-of-url-at-point, which has hardcoded behaviour > to, skip over "allowed characters" backwards to find the beginning of > the bound. here it it finds the space character (in "Release > Downloads") and the whole thing fails. > > This particular failure can be addressed by supplying the lim > paramater to the skip-chars-backward, as shown in the attached > patch. > > does this look like a problem which ought to be solved? and is this > appropriate? (I was going to post on emacs-devel but decided to post > to the bug list instead) -- Best Regards, Madhu > > >From 5971b7c10d7c38d540fdf278a0cd559c96b10ed2 Mon Sep 17 00:00:00 2001 > From: Madhu > Date: Thu, 31 Oct 2024 15:40:42 +0530 > Subject: [PATCH] lisp/thingatpt.el: recognize urls better in markdown text > > * lisp/thingatpt.el: (thing-at-point-bounds-of-url-at-point): supply a > LIM when calling (skip-chars-backward allowed-chars), which is the > position where `thing-at-point-beginning-of-url-regexp' matches > backwards > > problematic url e.g. > ``` > [![GitHub Releases Downloads](https://img.shields.io/github/downloads/raysan5/raylib/total)](https://github.com/raysan5/raylib/releases) > ``` > If the point is in the the second url, skip-chars-backwards goes to the > space (between s and D) and `ffap-url-at-point' eventually fails. > but if we supply a limit with a left anchor, we work around it. What will this do to URLs such as http://web.archive.org/web/20240221082647/https://www.imdb.com/ ? More generally, to any URL that has another URL embedded in it? I'm not sure I see how to resolve this dilemma. Stefan, any ideas?