From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id 0EonCcBjPGbi0AAAqHPOHw:P1 (envelope-from ) for ; Thu, 09 May 2024 07:48:48 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id 0EonCcBjPGbi0AAAqHPOHw (envelope-from ) for ; Thu, 09 May 2024 07:48:48 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=g5Kphmaw; 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=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1715233727; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=GwYsNezeW6hvEnv3Gc58Rpp5vH3uMFI8aJdnts6LvuA=; b=dHVo9mP2gGo8JPrIcQn9sjbIBhmn17axmzKwmbevNIrcMXODYdeVFQjuXiSuBon+RgnFhR Vi1zE2sp9uhnAa1YQPtZmPNHFLWRaytj80Hk02LSrB/AJ00KwvkE9dlKdd71f0oRKHzZv6 2TxbmgO+lcNWXUNHi75VZrZXYn35b4hH2CXzZl7+EjUJD2asXD0OcSlXVOBlOKlghCkAuF idNywJXgCxgsO2vSsxVCcy6uIUUatcLZx4tERpaB1mVqbPe6Mb4Gl80Sx5WaYcn8VQo08E NUpz17qk8nv2zEGCXPxoN+quaw+q4Xf1WLnBkSkBnTeczTIxPOC8t4BLA8Zo3g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=g5Kphmaw; 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=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1715233727; a=rsa-sha256; cv=none; b=tSif12u6tNgi4o6vT51Beb9R22e8VxxmO+lYeAy/4Z7jC0/VfMwaWodQ0iCwnXNsiiLMNO XaSJWopZe+B37oMpH8ott5xvCtNm3nhGwd8c7qjQL3LBdkz4FYfC1UQgmFTYwCKOF9zohQ tMjEoNBR+1hLsJ6XsRoYsmGbtXGqIAhtO/l9iq930WFUFxhMTfR4ZGwr8D7DPJk7oYv7rV PKQ+LAwuFEm60E2Sd/XVn135S5A478H6JW5yGuZCQ2yvq+bW69680WqLwEvw0Rl2VzGUoH xE6k+kJTB1p0LU8pr9wupqf5m5gN6/dfV36WC+b5e6YmWf+X+PslRzuFFMLsTw== 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 D2F4C159AD for ; Thu, 9 May 2024 07:48:47 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s4wdB-0007wt-OE; Thu, 09 May 2024 01:47:54 -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 1s4wcb-0007WV-M0 for emacs-orgmode@gnu.org; Thu, 09 May 2024 01:47:19 -0400 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s4wcU-0006Jl-EZ for emacs-orgmode@gnu.org; Thu, 09 May 2024 01:47:08 -0400 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-a59ae3efbb3so46888466b.1 for ; Wed, 08 May 2024 22:47:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715233624; x=1715838424; darn=gnu.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=GwYsNezeW6hvEnv3Gc58Rpp5vH3uMFI8aJdnts6LvuA=; b=g5KphmawKC/bUPqH9vFjdI3Gxt5/Uitbr1K35tubCccpzzB44DnFezGvIYo4w2hZak yUDtRHRYzSJ49x1KUsVm9RFqJ4wxEXUsjMtPdUieZlsesVgh32RP4EAYwNXQui3a50os FCvNqmZPNuWvDQP020+Ad4R1Wde4oKMsaa0p1ujwBiH6YAl2OM/0E8Wq0p526HYPo8ea 8mrATJt1m2fra7SIGU/BOlKz9XztBgPBDsIEqT7rtQDXZWXVycFEoIAjbRtkKHTujewK Ui8C5dalhqTpWtsjEoMt19l/Xt6Yx4He9jhX68yNehspeIYMfbdqb2b4krYEIjQJWvj8 pdog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715233624; x=1715838424; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=GwYsNezeW6hvEnv3Gc58Rpp5vH3uMFI8aJdnts6LvuA=; b=e4dFe6N1CRf5HN3rdlbCQdWQdKf2Xkq4LXHQM1PT9wGFoaCQMvbONDDIjDARPKWjwZ GsrNbNS8Fk994hRHzfmSyqq6Bf8o/jXe5Degx4/o3gv8y28e0+mHXrxROFEOgyhJFAyu kFY/UbY+lw+r+RLV4LbWnspiIo+XoSXffsU3u3UdAGD0QvdG1LVUHIhRHWnBWii7fMwU sESlAJCifyRECZSfELOjQ2NZY1itmVy55IcMn8iSIcL9KLJs/UyK6dVneQHb/hcON6HR I3EbDIutyEywEuxhSDo18+Q8Wwx3mPzDx+EIhw2/52mUZ1SKJ9kDAREFrwDzSfgQ5J4R amZw== X-Forwarded-Encrypted: i=1; AJvYcCVMdhETBH/bV2yVXA7EDtJt8qiOyoQzZ9wFphzMF1hNqwx2ZhWl5kP9r6FTipkTKRj8dXfqdtwcf4Aqyud39WaDReT5TRA= X-Gm-Message-State: AOJu0YxRi68gZQjwUWKpPgXgO/p+8JAwmAYawOFCpjH623WZsZ/RZ4am PRaEwZxqr5XkdCz5dVueQlFVkDGvMEpMhMlmiRbrEp39tFcHk/BNlDbLob7OdWSHMzWjKLNk828 SpkrM85gYkeRLZbw1tOndYGWe6hE= X-Google-Smtp-Source: AGHT+IH5DSggveMk6v7sPbQDUoF7fc1RAbviF2bmp7fXaUfoGvQ8/mgPfsMWKGflGTPdP3JkpctZ4VbkcUYG96ZZEE0= X-Received: by 2002:a50:a417:0:b0:572:67d9:6c3b with SMTP id 4fb4d7f45d1cf-5731da621b3mr4304917a12.26.1715233623562; Wed, 08 May 2024 22:47:03 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Pedro Andres Aranda Gutierrez Date: Thu, 9 May 2024 07:46:37 +0200 Message-ID: Subject: Re: Re: [External] : Re: Adding custom providers for thingatpt.el (was: [PATCH] Add support for 'thing-at-point' to get URL at point) To: Drew Adams , Org Mode List Content-Type: multipart/alternative; boundary="000000000000d6e26a0617fef26b" Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=paaguti@gmail.com; helo=mail-ej1-x635.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, HTML_MESSAGE=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-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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -9.71 X-Spam-Score: -9.71 X-Migadu-Queue-Id: D2F4C159AD X-Migadu-Scanner: mx13.migadu.com X-TUID: zdw8dZ6XBujt --000000000000d6e26a0617fef26b Content-Type: text/plain; charset="UTF-8" H, Drew Hmmm... thanks for the clarification. That's going to be extremely helpful once I'm back on track after the "grading season" ;-) All this started, at least for me, when I was trying to write a simple interactive function to copy the contents of the cell the point is in to the kill-ring (and eventually to the clipboard). I eventually came up with a simple solution. This make org-mode tables very comfortable for longer Web formularies with complex data, like bank accounts. Best, /PA On Wed, 8 May 2024 at 20:14, Drew Adams wrote: > >> At the risk of veering off-topic (I mainly care about adding > >> 'bounds-of-thing-at-point-provider-alist' and > >> 'forward-thing-provider-alist'), would adding a new optional STRICT > >> argument to 'thing-at-point' and friends be an ok resolution for > >> everyone? This argument would enable Drew's proposed behavior. That way, > >> users get all the nice behavior by default just like today, and > >> programmers who require strict correctness in their code also have an > >> option. > > > > 1+ if STRICT means thing starting at point > > and without it we may need to look for the > > beginning of the thing (lazy point setting).... > > Why "starting" at point? STRICT shouldn't mean > checking whether a THING starts at point. > > The "strict" behavior that's needed is checking > _whether_ there is a THING at point, that is, > checking whether the char at point (which really > means just after point) is on/inside a THING. > > That's for `bounds-of-thing-at-point' etc. For > thing-at-point etc., IF there's a THING at point > then that THING is the non-nil value returned. > > In terms of implementation, I suggest you take > a look at the code in thingatpt+.el. Look at > functions `tap-bounds-of-thing-at-point' and > `tap-thing-at-point'. Just remove the `tap-' > prefix for code that DTRT. The file Commentary > explains things in detail. > > My code adds an optional arg SYNTAX-TABLE, but > you need not bother with that. Elisp now has > `with-syntax-table', which can be used as a > workaround if there's no such argument. > > In the end, `bounds-of-thing-at-point' and > `thing-at-point' should return nil if there's > no THING at the char at point. > > For "lax" behavior that corresponds to the > current vanilla behavior, if the strict > behavior would return nil then they return > what the strict behavior would return at > (1- point). > > But really such a lax behavior is pretty lame. > What's needed, for trying to grab a THING near > point is not just checking backward one char > but checking backward, forward, up, and down > N chars, where N determines what "near" means. > > thingatpt+.el provides two user options, > `tap-near-point-x-distance' and > `tap-near-point-y-distance', the max number of > chars from point to check for a THING (for X: > left and right, for Y: up and down). Setting > the Y value to zero constrains search to the > same line as point. > -- Fragen sind nicht da, um beantwortet zu werden, Fragen sind da um gestellt zu werden Georg Kreisler Headaches with a Juju log: unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run a leader-deposed hook here, but we can't yet --000000000000d6e26a0617fef26b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
H, Drew
Hmmm... thanks for the clarification. Th= at's going to be extremely helpful once I'm back on track after the= "grading season" ;-) All this started, at least for me, when I w= as trying to write a simple interactive function to copy the contents of th= e cell the point is in to the kill-ring (and eventually to the clipboard). = I eventually came up with a simple solution. This make org-mode tables very= comfortable for longer Web formularies with complex data, like bank accoun= ts.

Best, /PA

=
On Wed, 8 May 2024 at 20:14, Drew Ada= ms <drew.adams@oracle.com&g= t; wrote:
>&g= t; At the risk of veering off-topic (I mainly care about adding
>> 'bounds-of-thing-at-point-provider-alist' and
>> 'forward-thing-provider-alist'), would adding a new option= al STRICT
>> argument to 'thing-at-point' and friends be an ok resoluti= on for
>> everyone? This argument would enable Drew's proposed behavior.= That way,
>> users get all the nice behavior by default just like today, and >> programmers who require strict correctness in their code also have= an
>> option.
>
> 1+ if STRICT means thing starting at point
> and without it we may need to look for the
> beginning of the thing (lazy point setting)....

Why "starting" at point?=C2=A0 STRICT shouldn't mean
checking whether a THING starts at point.

The "strict" behavior that's needed is checking
_whether_ there is a THING at point, that is,
checking whether the char at point (which really
means just after point) is on/inside a THING.

That's for `bounds-of-thing-at-point' etc.=C2=A0 For
thing-at-point etc., IF there's a THING at point
then that THING is the non-nil value returned.

In terms of implementation, I suggest you take
a look at the code in thingatpt+.el.=C2=A0 Look at
functions `tap-bounds-of-thing-at-point' and
`tap-thing-at-point'.=C2=A0 Just remove the `tap-'
prefix for code that DTRT.=C2=A0 The file Commentary
explains things in detail.

My code adds an optional arg SYNTAX-TABLE, but
you need not bother with that.=C2=A0 Elisp now has
`with-syntax-table', which can be used as a
workaround if there's no such argument.

In the end, `bounds-of-thing-at-point' and
`thing-at-point' should return nil if there's
no THING at the char at point.

For "lax" behavior that corresponds to the
current vanilla behavior, if the strict
behavior would return nil then they return
what the strict behavior would return at
(1- point).

But really such a lax behavior is pretty lame.
What's needed, for trying to grab a THING near
point is not just checking backward one char
but checking backward, forward, up, and down
N chars, where N determines what "near" means.

thingatpt+.el provides two user options,
`tap-near-point-x-distance' and
`tap-near-point-y-distance', the max number of
chars from point to check for a THING (for X:
left and right, for Y: up and down).=C2=A0 Setting
the Y value to zero constrains search to the
same line as point.


--
Fragen sind nicht da, um bea= ntwortet zu werden,
Fragen sind da um gestellt zu werden
= Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should ru= n a leader-deposed hook here, but we can't yet

--000000000000d6e26a0617fef26b--