Notemacs
just a little pet project I have been working on, really need to go back and dedicate some time to it.
Here is the Gitlab link: https://gitlab.com/merlindev1/notemacs
Development Log
Wednesday, January 29 2025: looking into known issues
I have been using this note taking system for quite a while, however, there are a number of bugs or missing features that I have simply been living with/without and working around. I shall list them here:
notes that have a * break the program
any note that starts with * on a new line such as:
=* name of note content of note *more content of note*
Breaks the function (notemacs-add-file), so I have just been avoiding this by putting a (;) in front of lines I want to start with a highlight. This should be an easy fix but I am just lazy.
Duplicate items in the Database
I initially started this project as a way to learn SQL, and I did learn a decent bit but my skills are still very much limited in this area. So, I often run into little data base problems, and when I do, I often just want to get along with writing my notes, so I have just been deleting the whole database, and running the (notemacs-sync) function on select directories to get everything back in order. Obviously I shouldn't have to delete and recreate my entire database anytime something goes wrong so this has to be rectified.
The main problem I have is various forms of duplicate items, and even though I already have this:
(format "INSERT OR REPLACE INTO %s VALUES (?,?,?,?,?)" table)
in my (db-add-note) function, which should not create any duplicates, when I move any note around in a file, the data of where the point is stored is changed, and thus is treated as a new note. Additionally, I cannot just replace all duplicates by name, since there are bound to be notes with similar or same names in a given category, or even in the same file. So, I need to change something before the (db-add-note) function to determine whether or not a given note should be updated or inserted. I think I may need to read up a bit more on SQL before continuing on this problem though.
Sources
I also initially started this project, so that I can not only keep track of all of my notes, but also connect all of my notes to a central repository of sources. I do have a master bibtex file that I keep all of my sources in, so it is just a matter of connecting the two. I'm thinking something like
=* example note= &[category: example] &[source: MY_SOURCE_2022]
with MY_SOURCE_2022
being the name of a source that is in my master bibtex file.
The pipe dream would be that the notemacs program could detect what the source and page number of that source would be, and then have a function that could automatically find this source on my computer (if it is a digital source) and open up to that page. Or create citations automatically. Or even just create the proper \parencite[pg. xx]{SOURCE}
format for when I am writing papers in latex.
Either way, I need to get some work done on this.
Monday, February 3 2025
I have not worked on this at all yet, however I did notice a norther easy bug to squash. If a category list in a tag ends with an ',' then the parser throws an SQL error. e.g.
=* some note &[category: this, that, other,]
this shows up in parser like:
("this" "that" "other" "")
So I can either change the parser to ignore the ',' or change the SQL function to ignore ' "" '. Either way should be an easy fix.
Monday February 17
I still haven't worked to much on the project, however, I did fix the problem with trailing ',', and also implemented the beginnings of an error/log system for problems that arise in parsing/serializing. Honestly though, I put my code through a couple stress tests and it worked fine. I cannot seem to reproduce the * newline problem either. maybe is fixed itself????? However, I have just thought of another feature that I want.
company mode integration for writing tags
I don't always know what all of my tags are, so it would be cool if I could have it so when I am typing in a tag box (e.g. &[category: x]), it would help with auto completing available tag options. I am hoping I can avoiding writing a mode to do this, but I think I may just be able to find some kind of company-mode-hook
function or something. IDK :)