nobiot/md-roam

`org-roam-insert` gives an error

II-H opened this issue · 7 comments

II-H commented

org-roam-insert is giving me the following error in Emacs version 27.0.91 (9.0), MacOS Catalina 10.15.5

I'm running the latest versions of both Org-Roam and MD-Roam

  md-roam--format-link("/Users/guy/0/Semantic tags.md" "Semantic tags" nil)
  apply(md-roam--format-link ("/Users/guy/0/Semantic tags.md" "Semantic tags" nil))
  org-roam--format-link("/Users/guy/0/Semantic tags.md" "Semantic tags" nil)
  org-roam-insert(nil)
  funcall-interactively(org-roam-insert nil)
  call-interactively(org-roam-insert nil nil)
  command-execute(org-roam-insert)

If it helps, here's what the installations of both Roams look like in my init.el file:

(use-package md-roam
  :straight (:host github
                   :repo "nobiot/md-roam"
                   :branch "main"))
(require 'md-roam)
(setq org-roam-file-extensions '("org" "md"))
(setq org-roam-title-sources '((mdtitle title mdheadline headline) (mdalias alias)))

;; Disable Org-roam logic in favour of Md-roam's `roam_key: bibkey` syntax
;; for performance (regex) and aethetics
(setq md-roam-use-org-extract-ref nil) ; default is t

;; Enable backlinks with using Markdown link syntax [description](path/to/file.ext)
(setq md-roam-use-markdown-file-links t) ; default is nil

;; tag support
(setq org-roam-tag-sources '(md-frontmatter))

(use-package org-roam
      :ensure t
      :hook
      (after-init . org-roam-mode)
      :custom
      (org-roam-directory "~/0")
      :bind (:map org-roam-mode-map
              (("C-c n l" . org-roam)
               ("C-c n f" . org-roam-find-file)
               ("C-c n g" . org-roam-graph-show))
              :map org-mode-map
              (("C-c n i" . org-roam-insert))
              (("C-c n I" . org-roam-insert-immediate))))

Please help. And thank you for looking out for the Markdown-using blokes.

@II-H ,thank you. i am currently on vacation really away from my desktop and with very intermittent internet connection. i will look at the latest Org
-roam when i’m back in September. There have been many updates with Org-roam, so I will be excited to look at it, fully recharged after vacation—appreciate your patience. Thank you for posting an issue and for your kind comment.

@keliwang , thank you for your PR. i merged it. @II-H id appreciate it if you could see if the issue is fixed or not :)

II-H commented

Thank you to the both of you @nobiot @keliwang .

@keliwang's changes have succeeded in allowing me to insert Wiki-style MD Links into a document...

But now, it seems that upon saving, these Wikilinks revert to Org-mode style links

The process is as follows:

  • C-n n i to Insert a MD file titled Foo
  • We have [[Foo]] Foo placed into a MD document.
  • Save the document
  • [[Foo]] Foo instantly transforms into [[file:foo.md][Foo]]

Interestingly enough, it doesn't seem to affect all of the Wikilinks in a document. I cannot tell what sort of file triggers this transformation.

I've set md-roam-use-org-extract-ref to nil and it has not resolved this new issue.

Thanks again guys.

[[Foo]] Foo instantly transforms into [[file:foo.md][Foo]]

Yeah, I think this is how “fuzzy link” in the upstream Org-roam should work (introduces with its version 1.2.1). I haven’t made Md-roam catch up to that version yet. I’ll look at it when I’m back from holiday (back next week, so I think I’ll take some time the following weekend ;).

@II-H,
FYI.
Just quickly following up on your issue about "[[Foo]] Foo instantly transforms into [[file:foo.md][Foo]]":
Org-roam now has this customising variable org-roam-auto-replace-fuzzy-links; the default is t. I believe if you change its value to nil, you should be able to turn off this feature.

I am back, and slowly started looking at the Org-roam code that has been updated.
I'd need to ask you and everyone for patience while I implement changes for Md-roam to catch up to the upstream.
I don't think it will be one-weekend thing given I'm still half-vacation mode.

Thank you!

II-H commented

@nobiot pardon me for the late response, Thank you for all of your help! I'll try your work around out. Thanks again for this very convenient package.

Best

Thank you for your kind words 😄