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

[feature request] support for org-roam-mode #88

Open
benthamite opened this issue Nov 12, 2023 · 0 comments
Open

[feature request] support for org-roam-mode #88

benthamite opened this issue Nov 12, 2023 · 0 comments

Comments

@benthamite
Copy link

Would it be possible to support org-roam-mode? I noticed that ace-link-org correctly detects links in an org-roam-mode buffer (the buffer that is created when one runs e.g. org-roam-buffer-toggle). But because ace-link-org tries to open the link with org-open-at-point, it fails with the error

org-element-at-point: ‘org-element-at-point’ cannot be used in non-Org buffer #<buffer *org-roam*> (org-roam-mode)

The function needed to open links in an org-roam-mode buffer is org-roam-preview-visit.

Something like this would work:

(defun ace-link-org-roam ()
  "Open a visible link in an `org-roam-mode' buffer."
  (interactive)
  (require 'org-roam)
  (let ((pt (avy-with ace-link-org
               (avy-process
                (mapcar #'cdr (ace-link--org-collect))
                (avy--style-fn avy-style)))))
    (ace-link--org-roam-action pt)))
	
(defun ace-link--org-roam-action (pt)
  (when (numberp pt)
    (goto-char pt)
    (call-interactively #'org-roam-preview-visit)))
@benthamite benthamite changed the title support for org-roam-mode [feature request] support for org-roam-mode Nov 12, 2023
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

No branches or pull requests

1 participant