Code Monkey home page Code Monkey logo

Comments (8)

minad avatar minad commented on July 19, 2024 1

Very good. Note that I am currently improving the file preview (minad/consult@3b0d745), so it makes a lot of sense to not duplicate consult--temporary-files.

However, in the future I will have to figure out how to pass the relevant position of the headline to the open-function. (If you have any ideas on this, please let me know.

You can use the buffer returned by consult--temporary-files and then move the point inside that buffer. The point is made available by the org-roam-node struct it seems. Or you use the title string and jump there.

from consult-org-roam.

jgru avatar jgru commented on July 19, 2024

Hi @minad,

thank you very much for looking at the code. Your interest in this package and the input on this is much appreciated!
PR #4 implements almost all of you proposals for improvement. However, I refrained from reusing consult--temporary-files for consult-org-roam--temporary-nodes for two reasons: First, I need to derive the filename via org-roam-node-file node for each node, and, secondly, I intend to improve this function to open the actual org-roam-node and not just the housing file. Is this okay for you? I hope #4 is fine, do you have any further recommendations?

Thanks again and best regards,
jgru

from consult-org-roam.

minad avatar minad commented on July 19, 2024

Of course not using the temporary file function is perfectly okay if it is sufficiently different. But I don't get what the difference is between a node and a file. From my understanding I thought these are just the same? Or at least you have to open the file first and then jump to the headline. In this case you should still reuse consult--temporary-files for the file opening.

from consult-org-roam.

jgru avatar jgru commented on July 19, 2024

Of course not using the temporary file function is perfectly okay if it is sufficiently different. But I don't get what the difference is between a node and a file. From my understanding I thought these are just the same? Or at least you have to open the file first and then jump to the headline. In this case you should still reuse consult--temporary-files for the file opening.

Actually, a node is represented by an ID (of a headline) within an org-file. In code a node is a struct created by cl-defstruct.
I was wondering whether there is a better approach, but I didn't find a way to pass a filepath instead of a node-struct to consult-org-roam--temporary-nodes. Can you give me a hint, how to pass filenames (at best with a precise position inside it) instead of nodes to consult--temporary-files?

from consult-org-roam.

minad avatar minad commented on July 19, 2024

It should be possible to retrieve the node id and file path from the org roam node struct, or not?

from consult-org-roam.

jgru avatar jgru commented on July 19, 2024

It should be possible to retrieve the node id and file path from the org roam node struct, or not?

Sure, I did this in my "sodomized" version of consult--temporary-files, but now I moved this functionality into consult-org-roam--node-preview. (See 6885fb1)
I think this resolves all of the valuable remarks brought up by you. However, in the future I will have to figure out how to pass the relevant position of the headline to the open-function. (If you have any ideas on this, please let me know.

Thanks again for helping out and best regards,
jgru

from consult-org-roam.

jgru avatar jgru commented on July 19, 2024

Closed by #4.

from consult-org-roam.

jgru avatar jgru commented on July 19, 2024

Very good. Note that I am currently improving the file preview (minad/consult@3b0d745), so it makes a lot of sense to not duplicate consult--temporary-files.

Good to hear. I will keep an eye on this improvement. :)

You can use the buffer returned by consult--temporary-files and then move the point inside that buffer. The point is made available by the org-roam-node struct it seems. Or you use the title string and jump there.

Okay, then I will just have to modify the preview function. Thanks for the hint on this.

from consult-org-roam.

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.