Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A general way to exclude files matching regexp from dblocks and maybe more (was: Exclude keywords while using dblocks) #421

Open
bioingenieroDiegol opened this issue Sep 1, 2024 · 4 comments

Comments

@bioingenieroDiegol
Copy link

Hello! I've started using dblocks to help me write metanotes, but I'm having trouble filtering notes to exclude certain keyword. For example, I want to list notes that contain the word "-adventure", but exclude the ones with the keyword "_books". I tried first with regexp and then with RX notation without success, the result is always empty. This was my last attempt:

#+BEGIN: denote-links :regexp (rx (and (regexp ".*-adventure") (not (regexp ".*_books.*")))) :sort-by-component title :reverse-sort nil :id-only nil

#+END:

Is there any error on this expression? Is there any alternative or easier way to achieve this? Also, I'm not sure if this is the right place to ask for help.

Thanks a lot to Prot and contributors for this excellent package!

@protesilaos
Copy link
Owner

protesilaos commented Sep 2, 2024 via email

@protesilaos
Copy link
Owner

I think what we need here is a more general way of specifying a :not-regexp in the dblock parameters. This would be a regular expression like the one for :regexp for files to filter out. I guess we have no better way of going about it.

[ And this will probably extend to denote-sort-dired, because there is where the retrieval and sorting happens. ]

@protesilaos protesilaos changed the title Exclude keywords while using dblocks A general way to exclude files matching regexp from dblocks and maybe more (was: Exclude keywords while using dblocks) Sep 9, 2024
@protesilaos
Copy link
Owner

I am working on this feature in the new not-regexp branch: https://github.com/protesilaos/denote/tree/not-regexp (cc @swflint who also asked about this).

It is still a work-in-progress. I was about to finalise it today, but there is a storm now and will be out of electricity soon...

@protesilaos
Copy link
Owner

I just merged it into main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants