Closed nameiwillforget closed 7 months ago
Thanks for the bug report. I see several things going wrong here, which will need several bug fixes. Please stay tuned, I'll try to commit fixes this weekend.
Please check out the fixes in the develop
branch. Does it solve your problem?
I've pulled the development branch and evaluated ekg-logseq.el and ekg-logesq-test.el, then tried ekg-org-roam-import
again, but it didn't seem to do anything differently. When I checked the created tags it didn't list the notes underneath them and when I modified the import function to show me the tags of the created notes I received the same output as before.
Correction: now the tags don't display notes that have been egk-captured either, and this is true even if I remove the develop version from the Emacs path and start a new Emacs instance. Maybe the importing through the develop version corrupted the database somehow? I'll delete the database and try it again with a new one.
I've removed the old database and created a new one, but I don't think it changed anything. It seems to display tags inconsistently. I'll attach a screenshot. I don't know what's going on. Refreshing the tags doesn't help either, and it shows no notes if I use ekg-show-notes-with-tags-all
without any tags (and also if I use-any
). But it shows all notes if I use ekg-show-notes-for-today
.
I think what has happened is that you removed the database but didn't close it first, which would explain some of the issues you are seeing. Let me explicitly show you how I'm testing on your example, from the develop
branch.
M-x
ekg-close
(setq ekg-db-file "~/tmp/test-ekg.db")
(in *scratch*
or in ielm
)ekg-show-notes-latest-captured
to verify it is an empty dbM-x
ekg-logseq-sync
Here's what I see when I do that:
One note is that for ekg-show-notes-with-all-tags
this takes a list of tags and show you notes that have all of them. It does not show notes with all the tags available (I see now that this might be a bit confusing, but the docstring, README and doc should hopefully explain it).
Alright, I tried that, but it still doesn't work again. I noticed a warning printed though:
⛔ Warning (emacs): EKG: No field could be parsed from metadata line at point 11
⛔ Warning (emacs): EKG: No function found for field tag
When I now capture a test note and have its tag open, it appears without even needing to be refreshed:
But when I refresh the tag, it disappears:
Hm, this is really weird. At what point in my above steps do you get that warning message?
About your test tag not showing a note, I'm not sure why, this isn't an error I've seen before. If this is a test data and doesn't have anything personal, feel free to attach the database if possible, so I can have a look.
Hm, this is really weird. I don't understand it either. I've just tried it on my desktop, where ekg was newly installed, and where I didn't use the develop version, and the result is the same (note that my desktop has almost exactly the same system and emacs config as my laptop). But it had worked already! I questioned whether I was doing something really basic wrong, but I can't see what it could be.
At what point in my above steps do you get that warning message?
I don't know when the error message appeared, I don't think it popped up, I just found it in a tab at some point.
About your test tag not showing a note, I'm not sure why, this isn't an error I've seen before. If this is a test data and doesn't have anything personal, feel free to attach the database if possible, so I can have a look.
Here is the database:
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.
On Thursday, February 29th, 2024 at 4:07 AM, Andrew Hyatt @.***> wrote:
Hm, this is really weird. At what point in my above steps do you get that warning message?
About your test tag not showing a note, I'm not sure why, this isn't an error I've seen before. If this is a test data and doesn't have anything personal, feel free to attach the database if possible, so I can have a look.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
Thank you, but I don't think your attachment came through, can you add it directly to the page, not via email? It may be more reliable that way.
I tried but gh said the file type wasn't supported. But maybe I can trick it by removing the suffix of the file name. Alright, it doesn't complain if I call it .txt. test-ekg.txt
Thanks! I was able to open your database without issues.
Since these problems seem weird and unique to your experience, I'm guessing there might be something in your config that is causing the issue. Can you try this with emacs -Q
, loading only the triples
and ekg
modules? I think just opening your database should be sufficient.
Other possibilities: your emacs may be too new (I'm still using 29.1), and perhaps there's something in the newer emacs that is causing sqlite incompatibilities. But as a first step, please try it with a clean config.
"Andrew Hyatt" @.***> writes:
Thanks! I was able to open your database without issues. image.png (view on web)
Since these problems seem weird and unique to your experience, I'm guessing there might be something in your config that is causing the issue. Can you try this with emacs -Q, loading only the triples and ekg modules? I think just opening your database should be sufficient.
Other possibilities: your emacs may be too new (I'm still using 29.1), and perhaps there's something in the newer emacs that is causing sqlite incompatibilities. But as a first step, please try it with a clean config.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.
If started this way, it works! So I guess now the question is what exactly is causing it not to work if my config is loaded. Is there any convenient way to do that?
"Andrew Hyatt" @.***> writes:
Thanks! I was able to open your database without issues. image.png (view on web)
Since these problems seem weird and unique to your experience, I'm guessing there might be something in your config that is causing the issue. Can you try this with emacs -Q, loading only the triples and ekg modules? I think just opening your database should be sufficient.
Other possibilities: your emacs may be too new (I'm still using 29.1), and perhaps there's something in the newer emacs that is causing sqlite incompatibilities. But as a first step, please try it with a clean config.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.
I got a bit closer: the bug appears when I leave this code snippet uncommented in my config:
(use-package forge
:after magit)
That's a bit unexpected to me. What can forge have to do with ekg? It seems at least that the other stuff in my config is unrelated.
Getting back to the original problem of org-roam import, it seems to work now if I use the develop version of ekg-org-roam. However, it only imports the notes in my org-roam base directory. I have a system where I'm using org-roam subdirectories as described here. I can import those notes by running ekg-org-roam-import
in those subdirectories, but it would be better if it would do that automatically. Before the other bug, I wanted to try to write this myself, and maybe I'll do that, but right now I'm just glad ekg is functioning at all.
Great find about the forge
package. I looked through it, and I'm guessing there may be some issue due to this package's use of emacsql
at the same time you are using ekg
through sqlite
. I don't know how, but that's my guess at the moment.
About ekg-org-roam-import
, the page you linked to describes directory-local variables that allow multiple different directories depending on where you are. The problem is, ekg
doesn't have access to all those directory-local variables. We could add something, but anything we add would require you to essentially just give us a list of every directory again, and keep it up to date with all these other directories.
In the meantime, you can do something like this:
(cl-loop for org-roam-directory in '("~/org-roam-directory1" "~/org-roam-directory2" "~/src/project/roam-directory")
(ekg-org-roam-import))
Thanks! Since the import seems to work I guess we can close this for now.
Ah, sorry, I was so happy that I didn't notice that the import from org-roam still doesn't include tags from the imported node. For instance, this file:
(With .txt replaced by .org) still doesn't assign the tag "test" to the note.
I also rewrote the import function to consider folders in org-roam (not several org-roam directories but subfolders of one directory). This function adds the relative path of a node from the org-roam base directory as a prefix to a node and all directories in that path as tags to the node. Might be worth taking into the upstream:
(again replace .txt with .el).
Yes, sorry about that - my fix was for logseq, not org-roam. org-roam is something where people may have different ideas on how it should be imported. That said, it seems reasonable to add all the tags in a note, so I've now done that (in the develop
branch). Perhaps there was some reason I didn't do it before, but if so, I've forgotten why. Thanks for reporting this.
If I run
ekg-org-roam-import
, the titles of the org-roam nodes appear as tags but nothing seems to be tagged by them. I've backed up my org-roam-directory and removed all but one file:Now, if I run
ekg-org-roam-import
, the tagwerden
is created but neithersein
andnichts
are created and if I runekg-show-notes-with-tag
to view thewerden
notes, no notes are displayed under it. Similarly, if I create a new notesenf
using the default template, and runekg-org-roam-import
again, the tagsenf
appears but no note is associated to it. If I print out thetext
variable inekg-org-roam-import
, it does print the text of thewerden
note. If I putunder
it prints out
If I instead put
there, it prints out
I'm not sure what's going wrong.
Edit: Emacs version is 30.0.50, Org-roam version is 20240114.1941, Ekg is freshly installed from Melpa.