~jonsterling/forester-discuss

4 3

Feature Request: Querying by prefix

Details
Message ID
<D0ZV58LERXYL.1QFR0IG4T8WXM@gmail.com>
DKIM signature
pass
Download raw message
I often find myself wanting something like

\query{
  \query/and{
    \query/prefix{foo}
    \query/taxon{theorem}
  }
}

If this is desirable, I can prepare a patch.

Best, Kento
Details
Message ID
<CAETRDC=Yz0dDhWkwC9JuPW_iNpNe93mGZjWa5VbUBTORjk6HFQ@mail.gmail.com>
In-Reply-To
<D0ZV58LERXYL.1QFR0IG4T8WXM@gmail.com> (view parent)
DKIM signature
pass
Download raw message
1. I have the same feature request, without querying with prefixes, I
have to tag all the notes with the same prefix with a same tag.
2. I have figured out how to use the undocumented `\query/not` which
is very helpful, but I also wish for `\query/xxx{empty}` family which
should match empty tags/taxons etc. otherwise I have to use
`\query/not` to explicitly exclude known tags/taxons to me.
3. I wonder to what extent can query do, can query match arbitrary XML
tags? I tried things like matching `addr` to achieve the effect of 1,
or `\query/title` for a partial match, no luck yet.

To further xy what I'm trying to do: I was trying to transclude all
notes about the same topic (thus sharing the same prefix) that is not
a part of the parent article, i.e. scattered notes. I wish to preview
notes when I'm writing them, but transcluding each and every of them
is tedious and distracting.

Thanks,

Utensil Song
Details
Message ID
<CAETRDCm3eQmpEBORFxWVKffBe3kj-d_u_qnjcW_Do2u1gmM7SA@mail.gmail.com>
In-Reply-To
<CAETRDC=Yz0dDhWkwC9JuPW_iNpNe93mGZjWa5VbUBTORjk6HFQ@mail.gmail.com> (view parent)
DKIM signature
pass
Download raw message
One more related feature request is to order the query. It seems that
currently it's ordered by the numeric postfix of the trees, but
reversed.

I think lexical order (and their reverse) by any metadata field would
be sufficient if that naturally includes the dates?

On Tue, May 7, 2024 at 5:06 PM Utensil Song <utensilcandel@gmail.com> wrote:
>
> 1. I have the same feature request, without querying with prefixes, I
> have to tag all the notes with the same prefix with a same tag.
> 2. I have figured out how to use the undocumented `\query/not` which
> is very helpful, but I also wish for `\query/xxx{empty}` family which
> should match empty tags/taxons etc. otherwise I have to use
> `\query/not` to explicitly exclude known tags/taxons to me.
> 3. I wonder to what extent can query do, can query match arbitrary XML
> tags? I tried things like matching `addr` to achieve the effect of 1,
> or `\query/title` for a partial match, no luck yet.
>
> To further xy what I'm trying to do: I was trying to transclude all
> notes about the same topic (thus sharing the same prefix) that is not
> a part of the parent article, i.e. scattered notes. I wish to preview
> notes when I'm writing them, but transcluding each and every of them
> is tedious and distracting.
>
> Thanks,
>
> Utensil Song



-- 
In fascination of creating worlds by words,and in pursuit of words
behind the world.
Details
Message ID
<7CB6A03F-7DEB-425B-B6EA-02409FB366B9@jonmsterling.com>
In-Reply-To
<D0ZV58LERXYL.1QFR0IG4T8WXM@gmail.com> (view parent)
DKIM signature
pass
Download raw message
On 3 May 2024, at 9:23, Kento Okura wrote:

> I often find myself wanting something like
>
> \query{
>   \query/and{
>     \query/prefix{foo}
>     \query/taxon{theorem}
>   }
> }
>
> If this is desirable, I can prepare a patch.
>
> Best, Kento

Hi Kento,

In connection with our other discussions on prefixes (with Nick as 
well), I would actually very much like to avoid this usage. Prefixes are 
not meant to be semantic in any sense (and making them semantic invites 
a lot of needless forest-refactoring); I think that a better approach is 
to use the existing '\tag' mechanism, or (if this is not versatile 
enough), for us to design some better categorising mechanism.

Best,
Jon
Details
Message ID
<D1J03VGWC72W.2YWHF23F9Y0YB@gmail.com>
In-Reply-To
<7CB6A03F-7DEB-425B-B6EA-02409FB366B9@jonmsterling.com> (view parent)
DKIM signature
pass
Download raw message
Yeah, I changed my mind on this and agree with you. In fact, I would be
in support of removing the `query prefix` command. The neovim plugin no
longer relies on it. The vscode plugin does, however.

https://github.com/Trebor-Huang/vscode-forester/issues/7
Reply to thread Export thread (mbox)