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.devel,gmane.emacs.orgmode Subject: Re: Adding custom providers for thingatpt.el (was: [PATCH] Add support for 'thing-at-point' to get URL at point) Date: Sat, 18 May 2024 11:26:29 +0300 Message-ID: <868r07fruy.fsf@gnu.org> References: <87leba3ame.fsf@localhost> <88435424-afa3-d7a3-56ff-df9f0a2ca6ba@gmail.com> <875xz39cgp.fsf@localhost> <87ttk6da89.fsf@localhost> <673a0f71-c91f-8461-7388-9efbed6ba24f@gmail.com> <0c66ae28-7088-3ac7-be39-7714b8f80455@gmail.com> <87mspcave3.fsf@localhost> <253c058a-d349-41a7-7733-c73075bffcb6@gmail.com> <87sez36pvl.fsf@localhost> <2f344439-d0d6-a3e5-963c-773bb5c833d6@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7888"; mail-complaints-to="usenet@ciao.gmane.io" Cc: yantar92@posteo.net, emacs-devel@gnu.org, emacs-orgmode@gnu.org To: Jim Porter Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat May 18 10:27:04 2024 Return-path: Envelope-to: ged-emacs-devel@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 1s8FPE-0001tv-Nk for ged-emacs-devel@m.gmane-mx.org; Sat, 18 May 2024 10:27:04 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s8FOn-0003sv-TK; Sat, 18 May 2024 04:26:37 -0400 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 1s8FOj-0003s3-OL; Sat, 18 May 2024 04:26:33 -0400 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 1s8FOj-00020i-6h; Sat, 18 May 2024 04:26:33 -0400 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=ku7sdAT2JjFb2f6X/r6WZZIBR3MlL68q/SeSsgB3/k0=; b=bgsGTjr3ixM5 jLiUrtTACkyQI6DbAI5m6hnkTHu9s6r0QkpfO2riCmhNlM1+n+kR2QLIc/+d1DnArdYQL/3g1dGUo 3cM6wcpLG3O2IHNNvSwBNCoUQjRjuRgxlhkJmN7GQswoCLQMR7OX0PRvZrGgLCFzuT/7KrUFI8Coo ygqjTXLyg83KOculiCgecxe9pLWSX9yjhcji5HfR1uu4ewzVqdicmAl33OBGl5jAOkfI6ZNn5a2Z+ +ik6zXtNGgZoo10RpfII7U5OM2zsPe+lXwFyc+BZhPNS9ljDfers18ZXBB3aG6YUe41wuILZ1UX87 L44DTiX3syKlXFssEWxyzA==; In-Reply-To: <2f344439-d0d6-a3e5-963c-773bb5c833d6@gmail.com> (message from Jim Porter on Tue, 30 Apr 2024 11:27:04 -0700) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:319341 gmane.emacs.orgmode:161656 Archived-At: > Date: Tue, 30 Apr 2024 11:27:04 -0700 > Cc: eliz@gnu.org, emacs-devel@gnu.org, emacs-orgmode@gnu.org > From: Jim Porter > > On 4/30/2024 4:39 AM, Ihor Radchenko wrote: > > What happens if you have multiple providers for an URL? > > You add the provider to the end, so it will have the lower priority in > > this scenario. I guess that you want the opposite - EWW provider to take > > precedence. Same for other changes. > > That's probably reasonable. I was just keeping things the way they were > historically here, but we might as well fix this now. > > > It would make sense to add tests for "first wins" behaviour. > > Done. > > I've also fixed a bug in EWW and bug-reference-mode where it would > return nil for (thing-at-point 'url) if point was at the *end* of a URL. > It's now consistent with how 'thing-at-point' works by default. (If you > have two consecutive URLs and point is between them - only possible with > the custom provider function, I think - it'll prefer the second one.) I think you can install this now.