From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id UOF8KYrZlmZQoAAA62LTzQ:P1 (envelope-from ) for ; Tue, 16 Jul 2024 20:35:22 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id UOF8KYrZlmZQoAAA62LTzQ (envelope-from ) for ; Tue, 16 Jul 2024 22:35:22 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=red-bean.com header.s=202005newsp header.b=dv8srVGd; dmarc=fail reason="SPF not aligned (relaxed)" header.from=red-bean.com (policy=none); 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1721162122; h=from:from:sender:sender:reply-to: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=IL9Cjj1srFtkGcetuWw2/5AQPJGohspvZ4FWcI8m3G8=; b=luY4p/xGXgoSSIOOsRhej9HCmizzKYUmprit5kR0pkxJHd5vH/SskOfIPr1bHedADtKBXS zYW8jZK5Qzp4KB88QZF/aswNDsIkwCGZdYQhcYF/3CR3hSS+BYXUtQpW5pq7zNR9nt/fh2 6ahDj8paqdHMxLwlfTGkD9mSEnsOQJwpSjiNEZLmMcwhxfqeMLuqlgFLZl3epBYvt3SbHG YhQAJskPePJbOeLzU4kfdxVZxukhadDCZf+gxjCqrxZucF7SPpWCJ21JPF4PxP8D5AV8/+ MDg1e2lwBFOXFd8iAyz/9FPeSxqwNbgBjyGnteyyvDgIwTDfLsqPRmgsHHgGrg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1721162122; a=rsa-sha256; cv=none; b=m5e7tuJRI3ZGSIJ+Yi7nsrqlKJhtjn3LV4JIQo6lmT4SWnpYXTFpH3pvtXdLfZM4y/lmpM ssHprJNT2dob5wGa/bsU6SPgCKUzTTUeyRjcz5y8c2VvTwPCKL6JIXXBAVYEQvW5otJ25F 8SlEWnDLU7cuzSU22qEf34gIHIu1thJIC/yHco/OmrbPvCLH3Oxy0dgNqxgwHn0hlh6u07 0ZLKuGaKBKbt4k1akF6dvsty43EzSz1YIRxRvk18Qg63GTYKxl3IsHN56HHwXdBGp2faG5 swmax5PVda8Fap+XSu3fYJzc23LwG7xgtbQPobtXehynnmTYx/SA0DM52bzgKw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=red-bean.com header.s=202005newsp header.b=dv8srVGd; dmarc=fail reason="SPF not aligned (relaxed)" header.from=red-bean.com (policy=none); 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" 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 5DAB4633B3 for ; Tue, 16 Jul 2024 22:35:22 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sTosX-0008Lt-6R; Tue, 16 Jul 2024 16:34:29 -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 1sTosV-0008La-96 for emacs-orgmode@gnu.org; Tue, 16 Jul 2024 16:34:27 -0400 Received: from sanpietro.red-bean.com ([45.79.25.59]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sTosR-0004jt-Gz for emacs-orgmode@gnu.org; Tue, 16 Jul 2024 16:34:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=red-bean.com; s=202005newsp; h=Content-Type:MIME-Version:Message-ID:Date: Reply-To:References:In-Reply-To:Subject:Cc:To:From:Sender: Content-Transfer-Encoding:Content-ID:Content-Description; bh=IL9Cjj1srFtkGcetuWw2/5AQPJGohspvZ4FWcI8m3G8=; t=1721162062; x=1722371662; b=dv8srVGdJWBm7ZSv4pkiGZ5DoNPIaH/l6LCam47k6+y4ZEEyKtVU58UQpcuQ9gdeiUwfFjXD3Fa ML2+4HadqmJ22DbIiNiiZD9be9nhSRGMmdohi3TwSd6/h/LNo0tu1P7hUGblPcri0pWpM+v/cSkr3 O/kXXhI4+QGV+R7V7YevPjtY1ljDsDNsDinGlTUwRQoIf0BqdahN2a7kRfEE4QmbjR6WLPAWH/Qr/ CwT3jMzBIetwrlG4GA2yJZOziuOG/r+vgtqa/rE0CQ1zkmBBN0RR+cOmT8ordyZ2QB03vw5Rlhdee BphrocYHKayyosj74g+7J4AMGnjm4T4ZTXrg==; Received: from [12.106.183.66] (port=11870 helo=hummy) by sanpietro.red-bean.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1sTosP-002Dpq-0g; Tue, 16 Jul 2024 20:34:21 +0000 From: Karl Fogel To: Ihor Radchenko Cc: Org Mode Subject: Re: Possible bug getting bounds of URL at point? In-Reply-To: <875xt5cclk.fsf@localhost> (Ihor Radchenko's message of "Tue, 16 Jul 2024 20:21:11 +0000") References: <87h6cp9jyc.fsf@red-bean.com> <875xt5cclk.fsf@localhost> Date: Tue, 16 Jul 2024 15:34:21 -0500 Message-ID: <875xt59iuq.fsf@red-bean.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; format=flowed Received-SPF: pass client-ip=45.79.25.59; envelope-from=kfogel@red-bean.com; helo=sanpietro.red-bean.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, SPF_HELO_PASS=-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: , Reply-To: Karl Fogel Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: 5DAB4633B3 X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -4.31 X-Spam-Score: -4.31 X-TUID: W7+0YU395N5H On 16 Jul 2024, Ihor Radchenko wrote: >> Assume we have this line in an Org Mode buffer (note there are >> three trailing spaces after the final "m" -- hopefully the MTAs >> and MUAs will leave those spaces there): >> >> https://example.com >> >> Let's say the initial "h" is at position 22205, the position >> right >> after the final "m" is 22224, and the final position on the >> line >> (after the three spaces) is 22227. >> >> With point anywhere inside the URL, if I run >> (bounds-of-thing-at-point 'url), I currently get this result: >> >> (22205 . 22227) >> >> But I expected this result instead: >> >> (22205 . 22224) >> >> Is (22205 . 22227) correct, and I'm just misunderstanding how >> URL >> boundaries are supposed to work in Org Mode? > >This is correct. Trailing whitespace belongs to the preceding >node in >Org syntax. This is not a bug. > >Moreover, if you have something like >[[https//orgmode.org][description]] >the whole thing will be considered a URL. Thank you, Ihor. 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. I can change the code I'm writing to do things a different way, so this behavior need not interfere with my current task, in any case. Best regards, -Karl