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

[Question] Possible to use ebdb outside MUA? #83

Open
poulpoulsen opened this issue Nov 4, 2019 · 10 comments
Open

[Question] Possible to use ebdb outside MUA? #83

poulpoulsen opened this issue Nov 4, 2019 · 10 comments

Comments

@poulpoulsen
Copy link

Hello,
after some time i successfully managed it to run ebdb inside gnus.
Now i thought about using ebdb inside normal text in Org-mode, e.g. to insert adresses, names or similar.
Is it possible?

Second question is:
Is it possible to insert new fields in the database, e.g. to provide other information. My idea is to create a database with plants. Therefore i want to save some information inside fields about my plants.
Any suggestions?

Regards
Poul

@girzel
Copy link
Owner

girzel commented Nov 4, 2019

Hi there. Yes, one of the design goals of EBDB is that it should be usable with a wide variety of other software packages -- for historical reasons the code refers to "MUA"s, but really it should be possible to integrate it with anything, and Org is definitely an important target.

Right now there's an option to have an EBDB buffer pop up when you do a tag-type Agenda search: that will display any contacts you've tagged with that tag. You can insert a link to a record using the normal link insertion routine. There's also the command ebdb-cite-records, which will prompt for a record and insert a mailto: link to it.

I'm happy to provide further integration -- what sort of stuff would you be interested in seeing?

It's possible to create new fields for the database, the manual has some basic instructions under "Hacking EBDB -> Field Classes". You might take a look at that, and feel free to ask me if you have questions or need help implementing things.

Also, if integration with Gnus was particularly difficult or confusing, is there any way it could be improved, do you think?

@poulpoulsen
Copy link
Author

Hello, OK i See.
Then i will explain my ideas and wishes:

  1. I do not have real problems with the configuration of ebdb inside
    Gnus. Because i use icicles for completion, i have to use
    ebdb-complete-enable inside Gnus Hooks. Otherwise completion does not
    work. Both use the tab-key ...
    One question: how could i change the window dimensions, from ebdb-buffer after completion with tab-key? It is always maximized .

  2. My idea for a database is born out of gardening. I will save all my plants with their different properties, e.g. dimensions, color.

  3. Because I often write stories with org-mode, I want to save my persons, ideas and other different things with all the properties I need.

  4. I want to insert the details from a saved person dataset into my text.

  5. I want to link the name inside the text with the ebdb dataset (like org-store-link).

  6. I want to select a person / plant dataset via autocomplete inside my text in org-mode.

All these ideas are heavyweighted, i think...
I'm not a developer, but right now, i can do these things inside my wordprocessor (called Papyrus or Scrivener). My dream is to switch to Emacs Org-mode :-)

Do I explain my ideas a little clearer?

Regards
Poul

@girzel
Copy link
Owner

girzel commented Nov 6, 2019

For your first question: Do you mean that, after you complete a mail record with TAB in message-mode, and the EBDB buffer pops up, it takes over the entire frame, so you can't even see your message composition buffer anymore? It certainly shouldn't do that!

For the rest... Something tells me that EBDB won't be the right fit for keeping a plant database. You could probably make it work, but that's not what it's designed for, and I doubt it would ever feel "right". Perhaps you could just start using Org headings with properties? That is simple, but doesn't scale well. Otherwise, maybe using a proper database in SQLite?

Using Org instead of Papyrus/Scrivener is very interesting! I am aware of both of those programs, and have also thought a bit about how to use Org to replace them (I am a translator of fiction and also use Org to translate entire novels). To be honest, it never occurred to me that EBDB could be used to keep track of fictional characters, but that's a great idea.

I think that Org could replace Scrivener, but I think it would take quite a bit of work -- and probably require a minor-mode defined on top of Org. I don't have time to do that right now, unfortunately.

In the meantime, EBDB can do some of this: you can already insert links to EBDB records, either by storing a link in an EBDB buffer, or using org-insert-link in an Org buffer and then typing ebdb: <TAB> to get completion. Then if you hit "<RET>" on a record link, it will pop up an EBDB buffer showing that record. It's also possible to create Org links that search and display multiple records.

Completing text on record names is doable, but would require a bit more coding, and as I said, maybe a minor mode.

@poulpoulsen
Copy link
Author

For your first question: Do you mean that, after you complete a mail record with TAB in message-mode, and the EBDB buffer pops up, it takes over the entire frame, so you can't even see your message composition buffer anymore? It certainly shouldn't do that!

Yes exactly.
I create a mail with key m
put cursor in field to:
some letters and or TAB pops up the ebdb buffer maximized. if i select an adress and push RET, i 'm back in message buffer.

For the rest... Something tells me that EBDB won't be the right fit for keeping a plant database. You could probably make it work, but that's not what it's designed for, and I doubt it would ever feel "right". Perhaps you could just start using Org headings with properties? That is simple, but doesn't scale well. Otherwise, maybe using a proper database in SQLite?

But is there any implemantation for Org-mode and SQL?

In the meantime, EBDB can do some of this: you can already insert links to EBDB records, either by storing a link in an EBDB buffer, or using org-insert-link in an Org buffer and then typing ebdb: to get completion. Then if you hit "" on a record link, it will pop up an EBDB buffer showing that record. It's also possible to create Org links that search and display multiple records.
I will check that.

Completing text on record names is doable, but would require a bit more coding, and as I said, maybe a minor mode.

OK, i will see, what icicle could do.

Regards
Poul

@girzel
Copy link
Owner

girzel commented Dec 19, 2019

For your first question: Do you mean that, after you complete a mail record with TAB in message-mode, and the EBDB buffer pops up, it takes over the entire frame, so you can't even see your message composition buffer anymore? It certainly shouldn't do that!

Yes exactly.
I create a mail with key m
put cursor in field to:
some letters and or TAB pops up the ebdb buffer maximized. if i select an adress and push RET, i 'm back in message buffer.

Can you tell me if you've loaded 'ebdb-complete, and/or 'ebdb-message? Have you run the function ebdb-complete-enable? That might cause this kind of behavior.

For the rest... Something tells me that EBDB won't be the right fit for keeping a plant database. You could probably make it work, but that's not what it's designed for, and I doubt it would ever feel "right". Perhaps you could just start using Org headings with properties? That is simple, but doesn't scale well. Otherwise, maybe using a proper database in SQLite?

But is there any implemantation for Org-mode and SQL?

There is! Check out https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-sqlite.html for some information on how to interface with SQLite.

@poulpoulsen
Copy link
Author

Can you tell me if you've loaded 'ebdb-complete, and/or 'ebdb-message? Have you run the function ebdb-complete-enable? That might cause this kind of behavior.

Hello,
yes i load ebdb-complete and i run ebdb-complete-enable with gnus-message-setup-hook.
should i reconfigure anything?

And thanks for the link. i will check this.

Regards
Poul

@girzel
Copy link
Owner

girzel commented Dec 20, 2019

ebdb-complete-enable is a sort of non-standard completion approach, which is meant to pop up a whole EBDB buffer to allow you to choose a contact. If you've loaded "ebdb-message", the pop up command should know to split the message-mode buffer rather than taking it over completely. Can you make sure you've required the 'ebdb-message library?

@poulpoulsen
Copy link
Author

poulpoulsen commented Dec 20, 2019 via email

@girzel
Copy link
Owner

girzel commented Dec 20, 2019

Okay, that ought to work, let me experiment with this. (Btw, it shouldn't be necessary to load 'ebdb-migrate once you've migrated the first time -- the relevant functions are also autoloaded.)

As usual, the hardest part of writing an Emacs package is the window management!

@poulpoulsen
Copy link
Author

poulpoulsen commented Dec 21, 2019 via email

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

2 participants