From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 0KwJLhfXl2YhQAAAqHPOHw:P1 (envelope-from ) for ; Wed, 17 Jul 2024 14:37:11 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id 0KwJLhfXl2YhQAAAqHPOHw (envelope-from ) for ; Wed, 17 Jul 2024 16:37:11 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=sOCqxo3x; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1721227031; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=mVcjic025jqHh9C62eKSpid9ALVas3DjTgojIuHk8tU=; b=CuFxQEjuNIvkBGzksvNF2gwQiJNtUKJaTzJxePJn9JKTk2Tdur9TI1kY5ZihittYusk6BX WYci0Dbmh35GYxtv7ImU/s64uwoMX4joO8lG0ctw/sy6I0xJzMPOZ3ICHGJZr8vucP0gpz 4c9QfBPNB6CiPu20X3+MLl0cEsJ2VKeXtVtAAXLYmGD68DsIAomyaOJwGBc22//3qQQ/jW +8Lrbxm262KRMVAvY+KUA5TjX4Kz3Ytq18RDbSPgRC1qiUdI5asJIxxJApXwClAxWwo8l0 79g4mKtvSPL3AvouWQ4hxN/T1zC9QQJ4XslsaZdroeAWA0d22y9MqXcRqKf2VA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=sOCqxo3x; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1721227031; a=rsa-sha256; cv=none; b=bsbz5coLwvpIg44ebmCKunFb2LM/iaNaXBN/O9c6xfrxxsFKsj1DmzK69R8ARsjVUX0bIj xOzN9LO4l4+tXfrD4va0iN0TKsYDl9z7beeU5FquMK4+QzM2bmdNJ1BM6y43mHK7XwUbFf P5ONJMAqgbasSgxGKBRLLuEarPJGk0sDJQpiUNG8Q2TPlulIauj/yxNnGJURFavU+IA0bP 0JyOnW+O7gYdsgKU3FgNqxs7+AVHj4sfmr1cu96bxRWk8z0fBudyuVPREGn/9ym+hl6g1O H7SDfeJ6Y2JCqFjT4GK/9LojmpYhhaTGcJdxov8Nlpjy2LNDQOs8ieVzq2uyaQ== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7488D7D91C for ; Wed, 17 Jul 2024 16:37:11 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sU5lc-0001KM-Ec; Wed, 17 Jul 2024 10:36:28 -0400 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 1sU5la-0001K3-59 for emacs-orgmode@gnu.org; Wed, 17 Jul 2024 10:36:26 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sU5lX-0006Ak-S7 for emacs-orgmode@gnu.org; Wed, 17 Jul 2024 10:36:25 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 976FD240104 for ; Wed, 17 Jul 2024 16:36:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1721226981; bh=OSH6y8dOwItBGP5rzWEfVIdt5mygSm4wkFfv1x7Rd/4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=sOCqxo3xymw6HLZ+YT/e1X3nketwxKi/O4jbyhcUSypgH1tpy3POc8KszAa+p/sWz IYOVJDCzbdm4xY5aszk9ViUk2BRLNsY4VCGZUR5K9nZnYzCmmvoWWpJDu+qsiYj3w+ gFWGnu2m6cxnvQI4a39eDHjKjR7wuFBjkDYwepVubEvz2TMiyFRkE7Wm0WmgItFCsI jNm+3EVlWs05MtVVQxqsJ0JTpGDvFJSiBtUvwFqboCUXiM+XuAb5biu0fRqA2yzxWx HNzwKUQH5vs+GhV7JfLVfrZrUZTn47kR8dv3cEm64t9dP6l1IJCWfGHxB01WBfhfKC kbxNpziZIBW0w== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4WPJQs1HP9z9rxK; Wed, 17 Jul 2024 16:36:21 +0200 (CEST) From: Ihor Radchenko To: Karl Fogel Cc: Org Mode Subject: Re: Possible bug getting bounds of URL at point? In-Reply-To: <875xt59iuq.fsf@red-bean.com> References: <87h6cp9jyc.fsf@red-bean.com> <875xt5cclk.fsf@localhost> <875xt59iuq.fsf@red-bean.com> Date: Wed, 17 Jul 2024 14:37:51 +0000 Message-ID: <87cync6q4g.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Spam-Score: -8.63 X-Migadu-Queue-Id: 7488D7D91C X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -8.63 X-TUID: VUFMFckt/W0p Karl Fogel writes: > I admit that I don't immediately understand why this is a good > thing. The user asked for the bounds of the URL at point, but got > instead the bounds of some other thing (the Org "node"). > Especially in the case of a standalone URL, with no description > text, I don't see how including the whitespace is useful. > > However, there could be issues here that I'm not familiar with. > It sounds like you've already thought this out and concluded that > that including the trailing whitespace is the right behavior. If > you have time to explain why in more detail, I'd appreciate a > chance to learn more about it. However, if you don't have time to > do that, it's no problem. The notion of "URL", and especially "URL at point" in Org mode needs to be special. Consider something like [[https://orgmode.org][this is a very long and /convoluted/ description of this url; all the text here is clickable as a link]]. Org mode will consider point anywhere inside the link as "at URL". That "URL" will be https://orgmode.org, and it is indeed what (thing-at-point 'url) will return on that link in Org mode, even when point is on the link description. Hope it makes sense. What does not make sense in such scenario is returning (bounds-of-thing-at-point 'url) to not include point. So, we instead return the relevant syntax object - link object. And that object includes description, brackets, and whitespace after. There is no reason to make plain links special in this regard, so we don't. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at