Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Issue handling notes with alphanumeric IDs #11

Closed
rockstorm101 opened this issue May 13, 2024 · 4 comments
Closed

[BUG] Issue handling notes with alphanumeric IDs #11

rockstorm101 opened this issue May 13, 2024 · 4 comments

Comments

@rockstorm101
Copy link
Contributor

I've got an issue with the following line of code. It does not properly handle note IDs starting with a letter like "abc123".

(string-match (format "[^0-9]*\\(%s\\)" zettelkasten-id-regexp) note)

I've made the following change locally, but I'm unsure it would work for everyone so I thought I would ask before submitting a PR. I don't 100% understand what the zettelkasten--get-id function does. I guess it tries to handle note files like "1234-my-note.md" by removing the suffix and the "-my-note" bit. If correct, then the change should work for anyone, if not then I don't fully understand the code, so please bear with me.

-  (string-match (format "[^0-9]*\\(%s\\)" zettelkasten-id-regexp) note)
+  (string-match (format "^\\(%s\\)" zettelkasten-id-regexp) note)

--
Emacs version: 29.3
zettelkasten version: 20230108.172
zettelkasten configuration: zettelkasten-id-regexp "[a-z0-9]+"

@ymherklotz
Copy link
Owner

Thanks for the report, I think you are right that this was an oversight, and still stems from the time when I had "hardcoded" ids to be only numbers. I think that your proposed solution is correct, especially with the ^ that was missing in the previous version too. And your interpretation about what the code should do is correct as well.

Let me know if you want me to make the change or if you want to submit this as a pull request.

@ymherklotz
Copy link
Owner

Btw, I'm glad if the package works for you otherwise and I'm happy to still work on it and implement new features or fix bugs, but I haven't really been adding any new features to it myself since I'm not actively using it myself any more. I just wanted to note that denote is also an excellent package that is newer and has similar goals to this package, just in case you hadn't come across it before.

I do think that zettelkasten.el is still simpler and a bit more minimal, so if that fits your need better then that's great!

rockstorm101 added a commit to rockstorm101/emacs-zettelkasten that referenced this issue May 15, 2024
@rockstorm101
Copy link
Contributor Author

Btw, I'm glad if the package works for you otherwise and I'm happy to still work on it and implement new features or fix bugs, but I haven't really been adding any new features to it myself since I'm not actively using it myself any more. I just wanted to note that denote is also an excellent package that is newer and has similar goals to this package, just in case you hadn't come across it before.

I do think that zettelkasten.el is still simpler and a bit more minimal, so if that fits your need better then that's great!

Thanks a lot for the support and for the alternative suggestion. I'll have a look at it. Though I'm happy with this package to be honest, it does just what I need. So I'm very thankful for your work on this.

@ymherklotz
Copy link
Owner

Great thanks, I've pushed that now and it should be on melpa soon. Let me know if that works for you.

ymherklotz pushed a commit that referenced this issue May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants