Closed hwiorn closed 1 year ago
I hear you. There's honestly a lot of stuff it can do and it can seem intimidating. And my documentation is definitely not the greatest, although I have tried as best as I could to explain the process. I will try to answer your questions as best I can and if you need more help, I will be happy to provide it. Before that, I also want to mention that because there are a lot of functions and I understand its confusing to remember all of them, I highly recommend you also install the zetteldesk-kb
package. The hydra it includes has very explanatory descriptions instead of function names which I think will help sort out the mess.
For the workflow you mention. Step 1 is correct. Steps 2 and 3 not exactly. The idea is you have the *zetteldesk-scratch*
buffer, which is in the beginning empty. If you want to add the nodes you previously added to the zetteldesk-desktop
to the scratch, you use the function zetteldesk-insert-node-contents
(i n
in the hydra) which prompts for a node in the zetteldesk-desktop
and inserts its contents to the *zetteldesk-scratch*
and leaves a link to that node in the current buffer. The reason it inserts a link is due to how I personally use it (check here). If you do not want the link, you should use the function zetteldesk-insert-node-contents-without-link
which omits that part (i N in the hydra
). zetteldesk-node-insert
doesn't have any relation to this. Its confusing that it sounds very similar, but the idea of the naming scheme is that zetteldesk-node-insert
is the zetteldesk equivalent of org-roam-node-insert
(insert a link to a node, but filter it to view only zetteldesk nodes), while zetteldesk-insert-*
functions are functions that insert things to the scratch. For your step 3 of inserting the node contents to a different file, none of the functions can do that by default, but by setting the customization variable zetteldesk-insert-scratch-or-current-buffer
to nil, you can make it so all the zetteldesk-insert-*
functions insert to the current buffer. Hope I explained it well, if you need more clarification tell me.
Is zetteldesk-switch-to-buffer or zetteldesk-insert-org-file-contents is for index card? I thought the BUFFER is to write zetteldesk-scratch as persistent file.
The zetteldesk-switch-to-buffer
function is a filter function following the naming scheme of zetteldesk-node-insert
. It runs the generic switch-to-buffer
function, but filters it to only display buffers in the zetteldesk-desktop
. This does not include nodes as they are easier to view with a filter function such as zetteldesk-node-find
(which is the filtered version of org-roam-node-find
). Its mainly for use with other buffers you might have stored in the zetteldesk-desktop
.
zetteldesk-insert-org-file-contents
on the other hand, is the equivalent of zetteldesk-insert-node-contents
(as can be inferred from the similarity in their naming scheme) to insert the contents of an org file in the zetteldesk-desktop
(which with org file I do not mean an org-roam node, but a separate org file outside org roam). The BUFFER you see passed to many functions is any buffer stored in the zetteldesk-desktop
and doesn't have any real relation with the *zetteldesk-scratch*
. Except if you mean something else and I haven't fully understood what you are asking.
How to switch other topics or projects? Does zetteldesk-scratch buffer means desktop? Could I switch desktop like change between multiple desks in a room? I think the BUFFER can be a seperate DESKTOP, is this right?
The *zetteldesk-scratch*
is essentially the desktop yes. Switching between different desktops isn't something that is possible, because I personally haven't needed it. However, I can understand why someone would need it and it would make sense to develop something like that. The system recognizes the buffer named *zetteldesk-scratch*
as the desktop, so making this should be easy because it basically needs a few interactive renaming functions for setting the "active" desktop and all other open ones as "inactive" but stored in memory. I could try working that out when I have time.
If zetteldesk-scratch was closed once, new zetteldesk-scratch buffer will be created as fundamental-mode
Yes, this is indeed correct. On startup, *zetteldesk-scratch*
is initialized by the low level function zetteldesk--create-scratch-buffer
which makes sure that the buffer will start in org-mode
. If it is closed and a function tries to find the buffer (which doesn't exist) it will create it, but will not set it to org-mode
. Fixing that behavior would be kinda hard. It is theoretically possible to make the function that creates the scratch buffer an interactive function (which wouldn't cause increased friction to anything), but it just didn't make much sense to me personally. Maybe if the functionality to use multiple desktops is added as mentioned above it will make more sense. For now, you can reinitialize the buffer correctly by disabling and re-enabling the zetteldesk-mode
which has a hook to properly initialize the buffer, or just set it to org-mode manually.
zetteldesk-node-insert doesn't insert node into zetteldesk-scratch. Whereas zetteldesk-insert-node-contents does.
I hope to have answered your question above, while explaining the workflow. zetteldesk-node-insert
runs a filtered org-roam-node-insert
with everything that implies while zetteldesk-insert-node-contents
is a separate function to insert the contents of a node. I am sorry if it causes confusion, but I think if you understand the naming scheme it makes sense. Open to suggestions if you think you have a more fitting name to change it to.
zetteldesk-save-state doesn't save anything. It makes a directory only.
I personally don't use this so I am not sure if there is something that's wrong with it and I haven't noticed, but when I wrote the code, I tested multiple examples and they all seemed to work and nothing has changed since then. I believe the error here is that the file it tries to find doesn't exist and it can't create it. Its location is stored in the variable zetteldesk-saved-state-file
and its in the directory /libs under your emacs directory and in a file named zetteldesk-saves.el
. It needs a new file, because the only way I could think of implementing a save feature is storing the list of nodes you want to save in a file and then reading from that file in a new session. You can change the location of that file by setq
-ing that variable to a different location. Note that that location needs to be in your load path so that the restore function can read the code in that lisp file. But I am pretty positive that the issue is its trying to write to a file that doesn't exist. I am aware that this solution isn't very elegant, but I couldn't come up with a better one.
So zetteldesk-restore-desktop doesn't restore anything.
Naturally, if you can't save a state, you also can't restore it. If you can properly save and restoring still doesn't work, do tell me, although I doubt it as I just tested the function using some old save states I have from testing and it should 100% work should the saving part be done correctly.
There is no zetteldesk-insert-info-contents command in hydra "Wrong type argument: commandp, zetteldesk-insert-info-contents"
You are correct, there is no such function. The function this could mean is zetteldesk-info-insert-contents
. Naming it zetteldesk-insert-info-contents
would make more sense (and that was indeed its name in the beginning), but after deciding to split the info stuff to a separate package, to upload it to MELPA, it must be prefixed with zetteldesk-info-*
so this change was necessary. However, seeing the hydra on my local version of the repo and on the version uploaded here, the function zetteldesk-insert-info-contents
is nowhere to be found. The only thing that could be causing this is you having an old version of the hydra, in which case make sure to update it and check again.
zetteldesk-insert-node-with-contents inserts two headings that has same level. one is the title and another is a top heading of original body.
Yes that is intended behavior. The typical zettelkasten structure wants nodes to be atomic, meaning that if you would split something with headings, each one should probably be a different node. For this reason, I did not find it intuitive for zetteldesk-insert-node-contents
to handle headings as it expects a node to have a title (which will become a top level heading) and no other headings. However, because I heavily expect a general org file (or a literature node, which in my case is made with org-noter) to have many headings, this behavior has been implemented for those, so I can easily solve your issue. If you consider this behavior necessary, load this function to your config and use it instead of zetteldesk-insert-node-contents
.
(defun zetteldesk-insert-node-contents-with-headings (&optional arg)
"Select a node that is part of the current `zetteldesk-desktop'.
Add a link to it at point and then insert its contents to the
bottom of the *zetteldesk-scratch* buffer after inserting a
newline there. Remove the first 67 characters which is the
properties section if it only contains the ID of the node as its
unneeded and change the string #+title to a top level heading as
its more practical when inserting the contents of multiple
files. Then, demote all of its headings by one level (since the
title now acts as a top level heading).
If given the optional argument ARG, which needs to be the
`\\[universal-argument]' also switch to the *zetteldesk-scratch*
buffer in a split."
(interactive "P")
(let* ((node (org-roam-node-read nil #'zetteldesk-node-p))
(file (org-roam-node-file node))
(description (org-roam-node-formatted node))
(location (zetteldesk-insert-location)))
(insert (org-link-make-string
(concat "id:" (org-roam-node-id node))
description))
(with-current-buffer location
(goto-char (point-max))
(newline)
(insert-file-contents file nil 67)
(save-excursion
(while (not (org-next-visible-heading 1))
(org-metaright)))
(zetteldesk--replace-title)))
(zetteldesk-insert-switch-to-scratch arg))
I hope I explained all your issues enough, but if you need a better explanation, do mention it and I will try to explain it further. And if you have any other issue, do mention that as well so I can try and help you fix it.
Thank you for kind reply.
I will try to answer your questions as best I can and if you need more help, I will be happy to provide it. Before that, I also want to mention that because there are a lot of functions and I understand its confusing to remember all of them, I highly recommend you also install the zetteldesk-kb package. The hydra it includes has very explanatory descriptions instead of function names which I think will help sort out the mess.
I use zetteldesk-kb-complete
already. But I used hydra setting accroding to Doom configuration. So the wiki needs to be updated.
;; Doom-emacs setting
(use-package! zetteldesk
:after org-roam
:config
(setq zetteldesk-kb-hydra-prefix (kbd "C-c z"))
(zetteldesk-mode 1)
;; (require 'zetteldesk-kb)
(require 'zetteldesk-kb-complete)
(require 'zetteldesk-ref)
(require 'zetteldesk-info)
(require 'zetteldesk-remark)
...
I personally don't use this so I am not sure if there is something that's wrong with it and I haven't noticed, but when I wrote the code, I tested multiple examples and they all seemed to work and nothing has changed since then. I believe the error here is that the file it tries to find doesn't exist and it can't create it. Its location is stored in the variable zetteldesk-saved-state-file and its in the directory /libs under your emacs directory and in a file named zetteldesk-saves.el. It needs a new file, because the only way I could think of implementing a save feature is storing the list of nodes you want to save in a file and then reading from that file in a new session. You can change the location of that file by setq-ing that variable to a different location. Note that that location needs to be in your load path so that the restore function can read the code in that lisp file. But I am pretty positive that the issue is its trying to write to a file that doesn't exist. I am aware that this solution isn't very elegant, but I couldn't come up with a better one.
Okay, I'll check this out again. :)
You are correct, there is no such function. The function this could mean is zetteldesk-info-insert-contents. Naming it zetteldesk-insert-info-contents would make more sense (and that was indeed its name in the beginning), but after deciding to split the info stuff to a separate package, to upload it to MELPA, it must be prefixed with zetteldesk-info-* so this change was necessary. However, seeing the hydra on my local version of the repo and on the version uploaded here, the function zetteldesk-insert-info-contents is nowhere to be found. The only thing that could be causing this is you having an old version of the hydra, in which case make sure to update it and check again.
Yes, the wiki needs to be udpated.
Yes that is intended behavior. The typical zettelkasten structure wants nodes to be atomic, meaning that if you would split something with headings, each one should probably be a different node. For this reason, I did not find it intuitive for zetteldesk-insert-node-contents to handle headings as it expects a node to have a title (which will become a top level heading) and no other headings. However, because I heavily expect a general org file (or a literature node, which in my case is made with org-noter) to have many headings, this behavior has been implemented for those, so I can easily solve your issue. If you consider this behavior necessary, load this function to your config and use it instead of zetteldesk-insert-node-contents.
I see. My most of permernant notes doesn't have headlines. However my early (permernent) notes have one headline to represent as the atomic note. And I had added the literature notes for test. So the zetteldesk
showed duplicated headlines at that time.
Its a good point that I need to recheck the wiki for outdated things and
update them. And for the last point, since you say you added literature
notes for test, you should insert those with
zetteldesk-ref-insert-node-contents
which fixes all the heading stuff.
On Mon, Apr 17, 2023, 11:08 AM Tim Lee @.***> wrote:
Thank you for kind reply.
I will try to answer your questions as best I can and if you need more help, I will be happy to provide it. Before that, I also want to mention that because there are a lot of functions and I understand its confusing to remember all of them, I highly recommend you also install the zetteldesk-kb package. The hydra it includes has very explanatory descriptions instead of function names which I think will help sort out the mess.
I use zetteldesk-kb-complete already. But I used hydra setting accroding to Doom configuration https://github.com/Vidianos-Giannitsis/zetteldesk.el/wiki/Doom-Configuration. So the wiki https://github.com/Vidianos-Giannitsis/zetteldesk.el/wiki needs to be updated.
;; Doom-emacs setting (use-package! zetteldesk :after org-roam :config (setq zetteldesk-kb-hydra-prefix (kbd "C-c z")) (zetteldesk-mode 1) ;; (require 'zetteldesk-kb) (require 'zetteldesk-kb-complete) (require 'zetteldesk-ref) (require 'zetteldesk-info) (require 'zetteldesk-remark) ...
I personally don't use this so I am not sure if there is something that's wrong with it and I haven't noticed, but when I wrote the code, I tested multiple examples and they all seemed to work and nothing has changed since then. I believe the error here is that the file it tries to find doesn't exist and it can't create it. Its location is stored in the variable zetteldesk-saved-state-file and its in the directory /libs under your emacs directory and in a file named zetteldesk-saves.el. It needs a new file, because the only way I could think of implementing a save feature is storing the list of nodes you want to save in a file and then reading from that file in a new session. You can change the location of that file by setq-ing that variable to a different location. Note that that location needs to be in your load path so that the restore function can read the code in that lisp file. But I am pretty positive that the issue is its trying to write to a file that doesn't exist. I am aware that this solution isn't very elegant, but I couldn't come up with a better one.
Okay, I'll check this again. :)
You are correct, there is no such function. The function this could mean is zetteldesk-info-insert-contents. Naming it zetteldesk-insert-info-contents would make more sense (and that was indeed its name in the beginning), but after deciding to split the info stuff to a separate package, to upload it to MELPA, it must be prefixed with zetteldesk-info-* so this change was necessary. However, seeing the hydra on my local version of the repo and on the version uploaded here, the function zetteldesk-insert-info-contents is nowhere to be found. The only thing that could be causing this is you having an old version of the hydra, in which case make sure to update it and check again.
Yes, the wiki needs to be udpated.
Yes that is intended behavior. The typical zettelkasten structure wants nodes to be atomic, meaning that if you would split something with headings, each one should probably be a different node. For this reason, I did not find it intuitive for zetteldesk-insert-node-contents to handle headings as it expects a node to have a title (which will become a top level heading) and no other headings. However, because I heavily expect a general org file (or a literature node, which in my case is made with org-noter) to have many headings, this behavior has been implemented for those, so I can easily solve your issue. If you consider this behavior necessary, load this function to your config and use it instead of zetteldesk-insert-node-contents.
I see. My most of permernant notes doesn't have headlines. However my early (permernent) notes have one headline to represent as the atomic note. And I had added the literature notes for test. So the zetteldesk showed duplicated headlines at that time.
— Reply to this email directly, view it on GitHub https://github.com/Vidianos-Giannitsis/zetteldesk.el/issues/11#issuecomment-1510894529, or unsubscribe https://github.com/notifications/unsubscribe-auth/APGY5W66ZCXWKKHFWHE3MC3XBT3BDANCNFSM6AAAAAAWY7GDKI . You are receiving this because you commented.Message ID: @.***>
I'm closing the issue now, but if you have any other problems, feel free to re-open it for discussion, or start a new one
Hello, I would like to inform you that the feature you asked for
How to switch other topics or projects? Does zetteldesk-scratch buffer means desktop? Could I switch desktop like change between multiple desks in a room? I think the BUFFER can be a seperate DESKTOP, is this right?
The latest update of the package now has this feature built in and you can check the documentation for it in the README and its wiki section. Thanks for the idea, I believe it was a useful one.
I saw your emacs conf video and I thought this was what I've been searching for. I needed a desktop feature to writing text using my notes. So, I tried your package. I had read the wiki and followed some functions, but I found it was really difficult to use. It would've been nice your screencasts have command-log-mode window.
Is the workflow right?
Add org-roam notes(nodes) into
zetteldesk-deskop
desktop
byzetteldesk-add-node-to-desktop
zetteldesk-add-to-desktop
Switch
*zetteldesk-scratch*
buffer. The*zetteldesk-scratch*
buffer is empty at this time. Add node into*zetteldesk-scratch*
buffer fromzetteldesk-desktop
. Then, user can write and revise some text according*zetteldesk-scratch*
zetteldesk-node-insert
zetteldesk-insert-node-with-contents
Or open some
DRAFT-ABOUT-SOMETHING-COOL.org
. Insert node and contents byzetteldesk-insert-node-contents
Another questions.
zetteldesk-switch-to-buffer
orzetteldesk-insert-org-file-contents
is for index card?*zetteldesk-scratch*
as persistent file.*zetteldesk-scratch*
buffer means desktop? Could I switch desktop like change between multiple desks in a room? I think the BUFFER can be a seperate DESKTOP, is this right?Some functions don't work. The list below could be a seprate issue.
*zetteldesk-scratch*
was closed once, new*zetteldesk-scratch*
buffer will be created asfundamental-mode
.zetteldesk-node-insert
doesn't insert node into*zetteldesk-scratch*
. Whereaszetteldesk-insert-node-contents
does.zetteldesk-save-state
doesn't save anything. It makes a directory only.zetteldesk-restore-desktop
doesn't restore anything.zetteldesk-insert-info-contents
command in hydra"Wrong type argument: commandp, zetteldesk-insert-info-contents"
zetteldesk-insert-node-with-contents
inserts two headings that has same level. one is the title and another is a top heading of original body.