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

Two questions #379

Open
ruanxiang opened this issue Apr 20, 2022 · 6 comments
Open

Two questions #379

ruanxiang opened this issue Apr 20, 2022 · 6 comments
Labels

Comments

@ruanxiang
Copy link

Thank you for the great software!

While, I got two questions
1, When I use "r" to open resource, org-brain default uses "xdg-open" (in my debian box) to open file, but I wonder if I can open the file within Emacs. For example, if resource is a pdf file, I want org-brain opens it with pdf-tools
2, After adding a file link to resource, I don't konw how to edit its description as normal org mode does in org-brain-visualize mode. Should I have to open org file to add it manually?
3, I tried a lot but my emacs still can not find org-brain-polymode, I added configs as your README suggest and installed polymode, but no luck. :-(

@Kungsgeten
Copy link
Owner

Hi! Glad you like it!

  1. The resource is opened using org-open-link-from-string, which then uses org-link-open. That function has optional arguments to open files in emacs. Perhaps I could make it so C-u r opens the resource in Emacs...
  2. If I remember correctly there is no way of editing existing resources from org-brain-visualize. It would be nice, but I believe I looked into it and it was rather complicated to implement.
  3. A lot of users have had problems with polymode, I'm not sure why. It is working for me, but I'm not using org-brain from MELPA but instead use my local development file. If you have a look at the open issues there are discussions about polymode, perhaps those could help you?

@ruanxiang
Copy link
Author

Hi,

Thank you so much for the quick response.

  1. Do you think the config like
    (add-hook 'org-mode-hook
    '(lambda ()
    (add-to-list 'org-file-apps '("\.pdf\'" . "xdg-open %s"))
    may make a solution?
    However I don't know how to specify open program with pdf-tools, currently as you can see I use xdg-open, basically let system determines. However, in dired or other mode, I can directly open PDF with pdf-tools
  2. I got it. As I have played around org-brain last night, I got a lot of fun and found that open org file to edit it directly is also effective. :-)
  3. Okay, thank you! I may try original github version later. :-)

Actually I got additional questions,

  1. What does NICKNAME for? I tried to add nickname, but I don't know what is the use case for it.
  2. When I use "t" to change a node's title, it seems it just add a entry with new title ID in node's org file. I also tried to add #+TITLE: in org file, but nothing changed in visualized mode. I just wonder if I can do something like
    • add a node(child or something) with name "a", that means there will generate a file named a.org
    • then I changed its nickname or title whatever, then the name shown in visualized mode of that node will be the property I set. However such action may not add any entry or list in the a.org, just a real nickname.

@Kungsgeten
Copy link
Owner

I didn't know about org-file-apps. After reading the documetation, this works for me:

(add-to-list 'org-file-apps '("pdf" . emacs))

You don't need to add it in a hook.

Regarding your new questions:

  1. Nicknames can be used to give multiple names to the same entry when searching for it. If you have en entry with the title "Woods" you could also give it a nickname "Forest". Then if you use M-x org-brain-visualize or other commands both "Woods" and "Forest" will lead to the same entry.
  2. Pressing t should not add a new entry. If it is a file entry it should add/change the #+TITLE and if it is a headline entry it should change the headline itself. If you create an entry "a.org" and then visualize it and press t Hello RET the entry name being visualized should be "Hello".

@ruanxiang
Copy link
Author

(add-to-list 'org-file-apps '("pdf" . emacs)) works! Thank you so much!

  1. Do you mean, if I give entry a nickname, when I use M-x org-brain-visualize to open entry, I don't need to input a long name like a/b::c but short nickname instead? I tried it. If a entry a/b::c has nickname d, I still need input entry a/b::d. If it is what is, Yes, I confirmed it. :-)
  2. When I use MELPA version, t does not change anything, now I use github version, t changes entry's name, but leave #+TITLE no touched. :-(

Best regards,

@Kungsgeten
Copy link
Owner

  1. May I suggest you use a completion package in Emacs which allows fuzzy matching? There are lots of them, I myself currently use selectrum but ivy and vertico (and perhaps also the builtin ido, I can't remember) are good alternatives. Then you could write the title of the entry and it will match, not only at the beginning of the string.
  2. It sounds very strange. Not sure why this is the case.

@ruanxiang
Copy link
Author

Thank you so much for your patient reply.

I am still learning org-brain, and getting used to using it in my everyday work. Great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants