namilus / denote-menu

View and filter Denote files in a tabulated list
https://www.scss.tcd.ie/~sulimanm/posts/denote-menu.html
GNU General Public License v3.0
53 stars 11 forks source link

Filtering out journal entries at start-up #9

Closed tobocsic closed 1 year ago

tobocsic commented 1 year ago

Hi all, I am very new at this, hopefully I am documenting things properly - but do let me know if that is not the case.

I enjoying using denote and denote-menu, it's a daily driver for me. And I create journal entries one for each day, leaving the title empty. But I would like to avoid seeing all of these in denote-menu when it is initialised.

In dired, when I use regexp like ^[?!._journal.] it works, but that is not the case in denote-menu when I try to filter?

Is there an option to set out the initial filter for denote-menu (denote-menu-initial-regex) such that it does not include the journal entries?

Any help would be greatly appreciated.

namilus commented 1 year ago

Hi @tobocsic,

Sorry for the late reply.

I think the kind of functionality you're looking for should be a part of denote-menu. I don't know enough about regexes to write one that filters out files that don't include a particular string. There is probably a better way to go about negative filtering beyond regular expressions.

namilus commented 1 year ago

@tobocsic again sorry for the late reply again!

If you check out the latest commit 8cc5ee3, I've added a new function that allows filtering out files by keyword, such as filtering out denote files tagged with "journal".

Adding the following elisp code to your config will then let you use this new function the same as previous:

(define-key denote-menu-mode-map (kbd "/ o") #'denote-menu-filter-out-keyword)

Of course, you can set this to any keybinding you wish. I will close this issue for now