From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.devel,gmane.emacs.orgmode Subject: Re: RE: [External] : Re: Adding custom providers for thingatpt.el (was: [PATCH] Add support for 'thing-at-point' to get URL at point) Date: Mon, 6 May 2024 18:08:06 -0700 Message-ID: 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> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7755"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "eliz@gnu.org" , "emacs-devel@gnu.org" , "emacs-orgmode@gnu.org" To: Drew Adams , Ihor Radchenko Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue May 07 03:09:01 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 1s49KF-0001lT-RK for ged-emacs-devel@m.gmane-mx.org; Tue, 07 May 2024 03:08:59 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s49Ja-0005tI-6x; Mon, 06 May 2024 21:08:18 -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 1s49JV-0005se-DW; Mon, 06 May 2024 21:08:13 -0400 Original-Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s49JT-0002ra-EP; Mon, 06 May 2024 21:08:13 -0400 Original-Received: by mail-pg1-x532.google.com with SMTP id 41be03b00d2f7-5d3907ff128so2051602a12.3; Mon, 06 May 2024 18:08:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715044088; x=1715648888; darn=gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=OmjW/rIbjmiGi6dE4RS/gEemyAuAEkALlBuOJEd8gQ4=; b=kt5KzELANMtg7iy47SbOdP4/OPV+NAxFxDgLvfzIoi5M0Psygjy3B7W0POikIVOokD dC4BCBW22yPkXWsuVTDq/TLFT9/lnEx7cBAqUXhB7GbTwFz9znFBVb12/qQz2VZOePdX o/Xcp/8ad6XZmb9ipabPCeL9UViT1Q44GuF/y2scQLyrcx/7/KbdCyCq8w76pFxbKzx9 Cc+xb5fa2038hT8mtB4r+aVcxIf1zoCzlYmf+hubXpIEiBcq7IXzYlw6AxqzKszOdrr3 YWCHtYBpSYzemE3WLmx0CBwfnOu6rWVBPJycXKtB1zYg2xVlcz99E7nsBNRs9Wfs25Pj WAbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715044088; x=1715648888; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=OmjW/rIbjmiGi6dE4RS/gEemyAuAEkALlBuOJEd8gQ4=; b=t7XzIRk19M1/Lh0jlUIdKnuqQWjRBWFyC7Dlc3Gj6PsBz8HU2cWn+JLOBuJG2JpRQS uSXgF+4iBuUNvsTmKp/ZKKk9cJc3sbIugCO02H4k9Inmv+5BVOfe17vPkEr5EvZW0FtH jrXI/6hXU5ecWTOxENT+pBT6rmoKCsj0Zp8MRSSOr4BfANmi0l4NFJZ9mmwdtDfv1WVE KO/0wLwBP+gh5SlnOTDBEYYb2BEQCsaCs+S6l1RNmDpFt1Jf500JEZNLDYKdSmn+E6Nv nvFpXY7hLykdcBHCQVzIuna0g5OP+jKDPZ9viy/Xi9yNFIXd2vn/+NDOvdrngWBvwNj1 Sf2Q== X-Forwarded-Encrypted: i=1; AJvYcCXL8PKz8+AL6oahu0IqN4ZtX7GzfOCLqfknMGepmxxWDtXlAMqvnzwgZQh8/HLRtfdWwEhCp8417AiDE2Sbt0S5yBaJE+TLnH/P57YK1DlIXQe/IJSCR+y3klI= X-Gm-Message-State: AOJu0YyPVjveGk3r/pCrpoS7wazEQNjgebSt3SJ9HLy9SJo9qaunHWRh Wqf5JkxBCpImPUvSbS1Hm9me5Jc7/h3HM6ZTTL/8ZlPRo7AYuZtV X-Google-Smtp-Source: AGHT+IHE2JP/znPrWEXgUc3I2oGe9OngM/QJzBvBGV8/ejEd9cx/eDoKWvqHHrnAUrJaPO7CzGWTyQ== X-Received: by 2002:a05:6a21:3417:b0:1ad:6c36:ee82 with SMTP id yn23-20020a056a21341700b001ad6c36ee82mr16000734pzb.13.1715044087968; Mon, 06 May 2024 18:08:07 -0700 (PDT) Original-Received: from [192.168.1.2] (syn-023-240-098-037.res.spectrum.com. [23.240.98.37]) by smtp.googlemail.com with ESMTPSA id kp4-20020a056a00464400b006e580678dfbsm8334621pfb.193.2024.05.06.18.08.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 May 2024 18:08:07 -0700 (PDT) Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::532; envelope-from=jporterbugs@gmail.com; helo=mail-pg1-x532.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:318915 gmane.emacs.orgmode:161523 Archived-At: On 4/30/2024 2:10 PM, Drew Adams wrote: >> 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. > > By "at the end" I assume you really mean just > _after_ a URL, i.e., no longer on/at the URL. > > FWIW, that's actually _superior_ behavior. > > Unfortunately however, Emacs has chosen the > behavior you describe here: > >> It's now consistent with how 'thing-at-point' >> works by default. > >> (If you have two consecutive URLs and point >> is between them...it'll prefer the second one.) > > Which is better! It's what "at point" means. [snip] > See bug #9300, " `bounds-of-thing-at-point' > does not return nil when just after THING". I agree overall that your proposed behavior is more correct, and it's probably how I'd have implemented 'thing-at-point' if I were doing it from scratch. However, I think an even worse outcome than "thing-at-point looks at point or before-point" is "sometimes thing-at-point just looks at point, and other times it looks at point or before-point" (which is what it does today). I'd even be open to something like a 'thing-at-point-is-strict' defvar that people could let-bind as wanted, but I'm not going to *argue* for that myself. Ultimately though, this patch is really just about providing the necessary defcustoms for org-mode to be able to use 'thing-at-point' (and for Ihor to feel ok about it ;)). Changing 'thing-at-point's behavior should probably be handled separately, especially since there'd be an uphill battle to revisit the decision in bug#9300.