Vidianos-Giannitsis / zetteldesk.el

Zetteldesk.el is an emacs library built on top of org-roam with the purpose of easier revision on various subjects and a better outliner tool for emacs
GNU General Public License v3.0
112 stars 7 forks source link

zettldesk link to node opens capture buffer #7

Closed uliw closed 2 years ago

uliw commented 2 years ago

When running any of the insert commands, once I select a node, it opens a capture buffer, not the already existing node,

Vidianos-Giannitsis commented 2 years ago

I would appreciate if you could give me some information on your setup like which Emacs version you are running, if you are on the latest commit of the package (or installed from MELPA) etc.

Also I need you to be more detailed if you expect me to be able to reproduce this issue. On my end, zetteldesk-insert-node-contents (which is the function I expect you tried) inserts nodes properly but I am not saying its impossible for it to go wrong, if you explain to me exactly what you did I can help you.

But I actually find it really bizarre for an insertion function such as this to open a capture buffer. These functions use org-roam-node-read as their backend, which doesn't have the ability to capture such as org-roam-node-find or org-roam-node-insert. But even in the case that function somehow "knew" how to capture, its still awkward cause the nodes you are able to select are supposed to exist in your org-roam repository, if they don't exist, you wouldn't be able to add them to the zetteldesk.

So yeah, I really have no clue what the issue is. I assume I will be able to help if you tell me exactly what you did step-by-step. Also I would suggest to be using Emacs 28.1 and installing the package from MELPA (which currently has the latest commit) because if you have something older it may have created an unexpected problem.

uliw commented 2 years ago

apologies!

GNU Emacs 28.0.90 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0)
 of 2022-04-25

Ok, I tried a minimal configuration, and then it appears that the insert process cannot see any of my nodes. As such it tries to create a new node.

Strangely, if I open a node in roam, that node becomes visible as an insertion candidate. Here my org-roam config

(use-package org-roam
 :ensure t)
(setq org-id-track-globally t)

(setq org-roam-v2-ack t)
(setq org-roam-directory (file-truename "~/Documents/org/roam"))
; (org-roam-db-autosync-mode)
(setq org-roam-mode-section-functions
      (list #'org-roam-backlinks-section
        #'org-roam-reflinks-section
        ;; #'org-roam-unlinked-references-section
        ))

(setq org-roam-mode-section-functions
      (list #'org-roam-backlinks-section
            #'org-roam-reflinks-section
            ;; #'org-roam-unlinked-references-section
            ))
; (require 'org-roam-protocol)
(define-key org-roam-mode-map [mouse-1] #'org-roam-visit-thing)
(org-roam-db-autosync-mode)
Vidianos-Giannitsis commented 2 years ago

So just to make sure, you did use zetteldesk-add-node-to-desktop to add the wanted nodes to the zetteldesk-desktop right?

Asking since what you mentioned that you can view the node only after you open it, makes sense since this system relies on buffer-local variables, but only if you haven't actually added the node to the zetteldesk-desktop. But the idea of the insertion functions is they function only on nodes that are part of the current zetteldesk-desktop. zetteldesk-add-node-to-desktop makes sure to open the file if the buffer does not exist, so this shouldn't be the problem, unless you forgot to run this.

I tested emacs -Q, with (require 'zetteldesk) and no other config option on either roam or zetteldesk and running the command (zetteldesk-add-node-to-desktop) selecting any node followed by (zetteldesk-node-insert-contents) inserts everything properly. If this isn't the case for you then I honestly don't know what's up. If that one works, then something else is going wrong with your config. However, your org-roam setup seems minimal enough that nothing would cause a problem.

I hope that you just forgot to add the node, as if that's not the case I don't know what is.

uliw commented 2 years ago

the above worked, and subsequent trials also worked. However, after restarting, I was back to square one. So it is possible that this is workflow dependent. That being said, I am in fact rather unclear about what the workflow is ( I did read the RTFM). I my understanding, ZD is a way to link to org-roam noes from outside org-roam in order to collect a string of notes. As such I would start with a scratch-desktop, and than I was expecting that C-c z i would allow me to link/insert org-roam nodes.

Vidianos-Giannitsis commented 2 years ago

Yeah, that is actually expected behaviour. The idea is every time you boot into Emacs you start with a clean slate. You add (with zetteldesk-add-node-to-desktop or any of the other addition functions) all the nodes that you want to look at right now to the desktop and essentially get a probably really small part of your zettelkasten. One part of the package is that you can use the core org-roam functions to act on this subset of notes as you would with your whole repository making this a filtered version of your repository with only what you want to see right now.

Then, the other part of this is the insertion functions. Once you have all your notes, you typically want to order them in a way that makes sense and read them in the same context if possible. zetteldesk-insert-node-contents is the primary function to do this. With this, you have now sorted everything in your mind into one singular buffer which you can now read.

That's basically the crust of this. If you want more workflow information and how I personally use this, some of that is documented fairly well in the "A Sample Workflow" page in the wiki, if you haven't already. Due to how this is envisioned it makes sense for it to reset in every emacs session and that's why this is the default behaviour (as its essentially an extension of what is on your mind right now, something that changes from day to day). However there is something to be said about saving older zetteldesk-desktops so you can restore them at one point, because some things might be omnipresent or you just didn't finish what you were doing.

Truth be told, this isn't implemented cause I don't really know how to, although it is something I hope to do eventually.

If you have any other questions feel free to ask however.

uliw commented 2 years ago

oh I see. I thought it was more like regular org-file but with the ability to link into your org-roam database. Thanks!

Vidianos-Giannitsis commented 1 year ago

Yeah, that is actually expected behaviour. The idea is every time you boot into Emacs you start with a clean slate. You add (with zetteldesk-add-node-to-desktop or any of the other addition functions) all the nodes that you want to look at right now to the desktop and essentially get a probably really small part of your zettelkasten. One part of the package is that you can use the core org-roam functions to act on this subset of notes as you would with your whole repository making this a filtered version of your repository with only what you want to see right now.

Then, the other part of this is the insertion functions. Once you have all your notes, you typically want to order them in a way that makes sense and read them in the same context if possible. zetteldesk-insert-node-contents is the primary function to do this. With this, you have now sorted everything in your mind into one singular buffer which you can now read.

That's basically the crust of this. If you want more workflow information and how I personally use this, some of that is documented fairly well in the "A Sample Workflow" page in the wiki, if you haven't already. Due to how this is envisioned it makes sense for it to reset in every emacs session and that's why this is the default behaviour (as its essentially an extension of what is on your mind right now, something that changes from day to day). However there is something to be said about saving older zetteldesk-desktops so you can restore them at one point, because some things might be omnipresent or you just didn't finish what you were doing.

Truth be told, this isn't implemented cause I don't really know how to, although it is something I hope to do eventually.

If you have any other questions feel free to ask however.

On Tue, 17 May 2022, 00:32 Ulrich Wortmann, @.***> wrote:

the above worked, and subsequent trials also worked. However, after restarting, I was back to square one. So it is possible that this is workflow dependent. That being said, I am in fact rather unclear about what the workflow is ( I did read the RTFM). I my understanding, ZD is a way to link to org-roam noes from outside org-roam in order to collect a string of notes. As such I would start with a scratch-desktop, and than I was expecting that C-c z i would allow me to link/insert org-roam nodes.

— Reply to this email directly, view it on GitHub https://github.com/Vidianos-Giannitsis/zetteldesk.el/issues/7#issuecomment-1128158454, or unsubscribe https://github.com/notifications/unsubscribe-auth/APGY5W4VWT5TCRZIMVM2G7TVKK5FXANCNFSM5WCFV7BQ . You are receiving this because you commented.Message ID: @.***>

uliw commented 1 year ago

the ability to store would be awesome!