Coder Social home page Coder Social logo

Comments (11)

protesilaos avatar protesilaos commented on July 28, 2024

Hello @felipebalbi,

Perhaps there's some interest in integrating something like this as part of denote.

Let's leave this issue open as a point of discussion to read what others may have to say.

What are your thoughts?

I think it is not necessary. Users have different ways to access their files. Standard C-x C-f (find-file) already gives you minibuffer completion---you don't have to used Dired first.

There is a package called consult-bookmark which lets you pick a bookmarked directory and then uses find-file on its contexts. This is a general solution for all your regularly-visited directories.

Personally, when I don't do it through Dired I tend to use C-x p f (project-find-file) and related commands. This is because I treat my notes as a "project" with a git history, so it is easy to use the built-in capabilities for this. project-find-file is like find-file but only for the given project.

from denote.

felipebalbi avatar felipebalbi commented on July 28, 2024

Hello @felipebalbi,

Hi @protesilaos,

Perhaps there's some interest in integrating something like this as part of denote.

Let's leave this issue open as a point of discussion to read what others may have to say.

sure thing

What are your thoughts?

I think it is not necessary. Users have different ways to access their files. Standard C-x C-f (find-file) already gives you minibuffer completion---you don't have to used Dired first.

The difference, however, is that my suggestion above is extracting the note's title, instead of using the raw filename, which may provide for a more pleasant user experience, although it's debatable.

There is a package called consult-bookmark which lets you pick a bookmarked directory and then uses find-file on its contexts. This is a general solution for all your regularly-visited directories.

Personally, when I don't do it through Dired I tend to use C-x p f (project-find-file) and related commands.

Interesting, one benefit of this approach is that one can search for title and/or keywords. I'll probably use a combination of my suggestion above and filtering by keyword too. Wonder if I can figure out how to feed this information into marginalia and still allow for filtering on the keywords.

This is because I treat my notes as a "project" with a git history, so it is easy to use the built-in capabilities for this. project-find-file is like find-file but only for the given project.

I do too, all my notes are kept in a git repository as well.

from denote.

protesilaos avatar protesilaos commented on July 28, 2024

The difference, however, is that my suggestion above is extracting the note's title, instead of using the raw filename, which may provide for a more pleasant user experience, although it's debatable.

Yes, that is an improvement. Though we would then need to make it more consistent across all our relevant prompts/interfaces, such as when creating a link to a file and when showing backlinks.

Interesting, one benefit of this approach is that one can search for title and/or keywords. I'll probably use a combination of my suggestion above and filtering by keyword too. Wonder if I can figure out how to feed this information into marginalia and still allow for filtering on the keywords.

I don't know how to achieve this, though I am happy to make it happen.

About filtering using the marginalia annotations, I think that is not possible directly. You could use embark to produce a buffer out of the completion candidates and then invoke something like consult-keep-lines. But it no longer is a minibufffer-level interaction.

from denote.

svnsbck avatar svnsbck commented on July 28, 2024

Hi!

Interesting discussion. I have started to use the package consult-notes for these purposes. Once configured I only have to invoke consult-notes and then search through all my notes from the minubuffer using the title/tags. It's quite handy I think.

from denote.

protesilaos avatar protesilaos commented on July 28, 2024

@svnsbck Good call! It is also mentioned in the Denote manual.

from denote.

telenieko avatar telenieko commented on July 28, 2024

instead of using the raw filename, which may provide for a more pleasant user experience, although it's debatable.

About improving user experience during note finding:

I'm not sure if this falls really within the scope of Denote. One of its design goals is Composability. Then it may make more sense to provide an example in README about how to achieve this with already existing packages.

this being: showing the title (and the keywords) in a visually appealing way instead of the filename.

The infrastructure is there (the necessary functions). What's missing is an example of the "glue" needed to tie different packages together.

The difference, however, is that my suggestion above is extracting the note's title

What would be the performance implications? Listing a directory's contents is quite fast on pretty much every system. But in order to fetch the title you would need to open every single note file during completion, every time. So, the more your note collection grows the slower it would get.

About user experience, the main difference between the filename or the title is casing and the keywords ("The Lord of the Rings +book" becomes "1234567890--the_lord_of_the_rings__book.txt". So, making it visually more appealing could done by using something like marginalia and some regex on the filename.

Meaning, you could either use faces to color the output of find-file (I recall there was some example about that?) or rewrite the output to show the title and keywords (from the filename) in columns (with Marginalia?).

from denote.

protesilaos avatar protesilaos commented on July 28, 2024

Thank you @telenieko for your thoughts!

What would be the performance implications? Listing a directory's contents is quite fast on pretty much every system. But in order to fetch the title you would need to open every single note file during completion, every time. So, the more your note collection grows the slower it would get.

Perhaps this could work by leveraging the consult package's asynchronous functionality? Kind of like consult-find? But I have no knowledge of the internals.

This would be glue code, of course. Not something to add to denote.el.

Meaning, you could either use faces to color the output of find-file (I recall there was some example about that?)

We do this, for example, in the buffer where the backlinks are presented. Though adding faces to the completion UI may be tricky as it is uncharted territory for me. This seems to work with vertico, though I do not know if it is a good idea and/or what the possible downsides could be.

(completing-read
 "Do you see propertized candidates? "
 `(
   "one"
   
   ,(propertize "two" 'face 'error) ; red+bold

   "three"

   ,(propertize "four" 'face 'success) ; green+bold

   ,(format "%s--for-didactic-pursposes__testing_%s"
            (propertize "1234567890" 'face 'error)
            (propertize "hello" 'face 'success)
            )
   ))

from denote.

EFLS avatar EFLS commented on July 28, 2024

For what it's worth: I've been building on consult-notes package to achieve some of the things discussed here. In particular, I wanted to get an overview of what's in my notes folder, with note titles rather than file names. I've received some excellent help: mclear-tools/consult-notes#14

Adding things like keywords & number of words is possible as well by altering consult-notes-annotate-denote. That will be a next step.

from denote.

protesilaos avatar protesilaos commented on July 28, 2024

Thank you @EFLS! I have not tested any of the code, but my impression is that this is promising. I still have a TODO for consult-notes: I have used it before but need to actually integrate it into my setup.

If you have something to share with other users, consider contacting the mailing list as well. Also, I am happy to include any of this in the manual, perhaps under the existing entry for consult-notes (mutatis mutandis).

from denote.

EFLS avatar EFLS commented on July 28, 2024

I might do that at some point, @protesilaos! I'm currently still tinkering and experimenting with it. Currently I have included in the Consult buffer, next to the title: keywords, number of words, subdirectory, and modified time. One major drawback of the current setup is: it's no longer possible to quickly filter by keyword (as the candidates shown are titles, not filenames), nor to narrow to a directory (e.g. /journal/).

from denote.

ssl19 avatar ssl19 commented on July 28, 2024

I might do that at some point, @protesilaos! I'm currently still tinkering and experimenting with it. Currently I have included in the Consult buffer, next to the title: keywords, number of words, subdirectory, and modified time. One major drawback of the current setup is: it's no longer possible to quickly filter by keyword (as the candidates shown are titles, not filenames), nor to narrow to a directory (e.g. /journal/).

You could check my modified version of that snippet, it provided such functionality.
mclear-tools/consult-notes#14 (comment)

from denote.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.