protesilaos / consult-denote

Use Consult in tandem with Denote
GNU General Public License v3.0
42 stars 2 forks source link

Listing all denote files with title, date and keywords as consult-buffer source #4

Open DamienCassou opened 4 months ago

DamienCassou commented 4 months ago

The command consult-buffer allows for choosing from much more than buffers: by default consult-buffer-sources includes recent files, files in bookmarks, files in registers. What about including all denote files there as well and not just denote buffers? Instead of displaying the filename, we could convert it to a title and maybe also format the date and display keywords?

protesilaos commented 4 months ago

From: Damien Cassou @.***> Date: Sat, 18 May 2024 05:58:12 -0700

The command consult-buffer allows for choosing from much more than buffers: by default consult-buffer-sources includes recent files, files in bookmarks, files in registers. What about including all denote files there as well and not just denote buffers?

The three sources we have now are one for buffers and two for directories. In principle, I am fine with having more resources.

Instead of displaying the filename, we could convert it to a title and maybe also format the date and display keywords?

My concern with this is performance because the transformation to the pretty format involves reading each file's front matter to get the correct letter casing of the title. If there is a way to do this without a big performance drop, then I am all for it.

In fact, if we can do that, it is worth having it as an alternative to denote-file-prompt or consult-denote-file-prompt (depending on the implementation details).

-- Protesilaos Stavrou https://protesilaos.com

DamienCassou commented 4 months ago

Protesilaos Stavrou @.***> writes:

My concern with this is performance because the transformation to the pretty format involves reading each file's front matter to get the correct letter casing of the title. If there is a way to do this without a big performance drop, then I am all for it.

What about using `denote-retrieve-filename-title'? It's not as beautiful as the title in the front matter but it could be a good first step. We could remove the dashes "-" to make it look better.

-- Damien Cassou

"Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill