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
[v2] a debugging tip with Empty SQL vector expression #1534
Comments
🤔 this script should not cause such problem because ;; if roam_key is present but is empty, ROAM_REFS will not be create
(when-let* ((ref (vulpea-buffer-prop-get "roam_key")))
(org-set-property "ROAM_REFS" ref)
(let ((case-fold-search t))
(org-with-point-at 1
(while (re-search-forward "^#\\+roam_key:" (point-max) t)
(beginning-of-line)
(kill-line 1))))) Usage example:
> (vulpea-buffer-prop-get "roam_alias")
nil
> (vulpea-buffer-prop-get-list "roam_alias")
nil While I was writing this message, I realised that |
Hi @d12frosted : Sorry for the delaying this response. V2 is so good that I enjoy it too much. The migration was not smooth probably because I have some personal hooks in Org-mode. I remembered that I executed and killed the migration script a couple of times before the database was built. The root cause might be very hard to detect. The migration script is good. I test it with the problematic file again. The (defun org-roam-v1-to-v2 ()
;; Create file level ID
(org-with-point-at 1
(org-id-get-create))
;; Replace roam_key into properties drawer roam_ref
(when-let* ((refs (mapcan #'split-string-and-unquote
(cdar (org-collect-keywords '("roam_key"))))))
(let ((case-fold-search t))
(org-with-point-at 1
(org-set-property "ROAM_REFS" (combine-and-quote-strings refs))
(while (re-search-forward "^#\\+roam_key:" (point-max) t)
(kill-line 1)))))
;; Replace roam_alias into properties drawer roam_aliases
(when-let* ((aliases (mapcan #'split-string-and-unquote
(cdar (org-collect-keywords '("roam_alias"))))))
(let ((case-fold-search t))
(org-with-point-at 1
(org-set-property "ROAM_ALIASES" (combine-and-quote-strings aliases))
(while (re-search-forward "^#\\+roam_alias:" (point-max) t)
(kill-line 1)))))
;; Replace #+roam_tags into #+filetags
(org-with-point-at 1
(let ((case-fold-search t))
(while (search-forward "#+filetags:" nil t)
(replace-match "#+filetags:" nil t))))
(save-buffer)) P.s.: I also enjoy your blog about dynamic agendas. It is really cool! Thanks for your contribution @d12frosted and the community. I really appreciate it. |
Just want to share my experience with V2 migration b183fd4.
If the file-level info is like this:
Emacs will through an error, which is very hard to detect the cause.
:ROAM_ALIASES:
is automatically generated by this script which was written by @jethrokuan with inputs from @d12frostedJust make sure
:ROAM_ALIASES:
has something.I spent a lot of time finding the root cause. I hope someone else can save a little bit of time just in case.
The text was updated successfully, but these errors were encountered: