* contact management in emacs
@ 2021-02-27 11:08 Alan Schmitt
2021-02-27 11:31 ` Martin Steffen
` (4 more replies)
0 siblings, 5 replies; 33+ messages in thread
From: Alan Schmitt @ 2021-02-27 11:08 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 1337 bytes --]
Hello,
This may be slightly off-topic for the list, but as I’m considering
org-contacts for my question, I hope it will be of interest here.
I would like to migrate my contact management to emacs, as I’m already
using it for email. My requirements are the following ones:
- address completion in emacs email clients (I currently use notmuch)
- support for multiple email addresses and custom fields
- creation of org links to contacts
- export to vcard format for synchronization to my mobile phone (using
vdirsyncer)
- keep the data under version control
I have looked at two tools, which almost seem fit for the job.
- ebdb does most of this, with the exception of vcard export (it seems
to be worked on, https://github.com/girzel/ebdb/issues/60), and I’m not
sure using version control on an sqlite file is a good idea.
- org-contacts also seem to have all the required features, including
vcard export (and if not sufficient there is
https://github.com/novoid/org-contacts2vcard). I was worried it was
unmaintained when looking at the copyright line, but I see in
https://code.orgmode.org/bzg/org-mode/commits/master/contrib/lisp/org-contacts.el
that there are recent commits to the file.
Do you manage your contacts in emacs? And if so, what tools or workflow
do you recommend?
Best,
Alan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 528 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: contact management in emacs
2021-02-27 11:08 contact management in emacs Alan Schmitt
@ 2021-02-27 11:31 ` Martin Steffen
2021-02-27 13:20 ` andrés ramírez
2021-02-27 17:00 ` Dr. Arne Babenhauserheide
2021-02-27 16:53 ` Bob Newell
` (3 subsequent siblings)
4 siblings, 2 replies; 33+ messages in thread
From: Martin Steffen @ 2021-02-27 11:31 UTC (permalink / raw)
To: Alan Schmitt; +Cc: emacs-orgmode
I use bbdb (big-brother data base). I use it since a looong time
already, and amassed 15000 or so contracts. It does what I want, it's
text-based, so versioning is not a problem.
I think it can do vcard export (though when I used vcards is a long
time ago, I can't remember if that was smooth, I think it was with one
of my first smart phone, and I wanted to quick fill up the phone book
there with my ``emacs-managed'' contact data base.).
One can add used defined fields (where one can ``match'' all contacts
for some criterion, and send then ``bulk'' email.
Org is also bbdb-aware, insofar one can do those links: instead of
[[file:xxxx][yyy]] one can use [[bbdb:somecriterion]].
I don't know if it matches your needs, but I can't say bad things about
that bbdb-thing.
Martin
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: contact management in emacs
2021-02-27 11:31 ` Martin Steffen
@ 2021-02-27 13:20 ` andrés ramírez
2021-02-27 14:40 ` Eric S Fraga
2021-02-27 17:00 ` Dr. Arne Babenhauserheide
1 sibling, 1 reply; 33+ messages in thread
From: andrés ramírez @ 2021-02-27 13:20 UTC (permalink / raw)
To: Martin Steffen; +Cc: Alan Schmitt, emacs-orgmode
Hi. Martin and Alan.
>>>>> "Martin" == Martin Steffen <msteffen@ifi.uio.no> writes:
[...]
Martin> Org is also bbdb-aware, insofar one can do those links: instead of [[file:xxxx][yyy]]
Martin> one can use [[bbdb:somecriterion]].
bbdb anniversaries could also appear on agenda:
--8<---------------cut here---------------start------------->8---
10 days-agenda (W08-W09):
Wednesday 24 February 2021
Thursday 25 February 2021
Friday 26 February 2021
Saturday 27 February 2021
Sunday 28 February 2021
Monday 1 March 2021 W09
Tuesday 2 March 2021
Wednesday 3 March 2021
bbdb: [[bbdb:Pedro ][Pedro 61st custom anniversary]]
Thursday 4 March 2021
Friday 5 March 2021
--8<---------------cut here---------------end--------------->8---
Andrés Ramírez
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: contact management in emacs
2021-02-27 13:20 ` andrés ramírez
@ 2021-02-27 14:40 ` Eric S Fraga
2021-02-27 15:12 ` andrés ramírez
2021-02-27 15:14 ` Martin Steffen
0 siblings, 2 replies; 33+ messages in thread
From: Eric S Fraga @ 2021-02-27 14:40 UTC (permalink / raw)
To: andrés ramírez; +Cc: emacs-orgmode
On Saturday, 27 Feb 2021 at 13:20, andrés ramírez wrote:
> bbdb anniversaries could also appear on agenda:
How do you get these to appear? Or is the "could" a wish?
thank you, eric
--
: Eric S Fraga via Emacs 28.0.50, Org release_9.4.4-231-gf46925
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: contact management in emacs
2021-02-27 14:40 ` Eric S Fraga
@ 2021-02-27 15:12 ` andrés ramírez
2021-02-28 10:21 ` Eric S Fraga
2021-02-27 15:14 ` Martin Steffen
1 sibling, 1 reply; 33+ messages in thread
From: andrés ramírez @ 2021-02-27 15:12 UTC (permalink / raw)
To: andrés ramírez, emacs-orgmode
Hi. Eric.
>>>>> "Eric" == Eric S Fraga <e.fraga@ucl.ac.uk> writes:
[...]
Eric> How do you get these to appear? Or is the "could" a wish?
This is my setup:
--8<---------------cut here---------------start------------->8---
(setq org-agenda-files (directory-files "~/docs/org/deft/" t ".*agenda\.org$"))
--8<---------------cut here---------------end--------------->8---
~/docs/org/deft/bbdb-anniversary-trick.agenda.org:
--8<---------------cut here---------------start------------->8---
* anniversary [isodate]
:PROPERTIES:
:CATEGORY: bbdb
:END:
%%(when (fboundp 'my/org-bbdb-anniversaries) (my/org-bbdb-anniversaries))
--8<---------------cut here---------------end--------------->8---
--8<---------------cut here---------------start------------->8---
(defun my/org-bbdb-anniversaries ()
"It does not work on emacs-23"
(when (/= 23 emacs-major-version)
(org-bbdb-anniversaries)
)
)
--8<---------------cut here---------------end--------------->8---
the bbdb record should have the field anniversary:
--8<---------------cut here---------------start------------->8---
anniversary: 1960-03-03 custom
--8<---------------cut here---------------end--------------->8---
Best Regards
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: contact management in emacs
2021-02-27 14:40 ` Eric S Fraga
2021-02-27 15:12 ` andrés ramírez
@ 2021-02-27 15:14 ` Martin Steffen
1 sibling, 0 replies; 33+ messages in thread
From: Martin Steffen @ 2021-02-27 15:14 UTC (permalink / raw)
To: andrés ramírez; +Cc: emacs-orgmode
>>>>> "Eric" == Eric S Fraga <e.fraga@ucl.ac.uk> writes:
Eric> How do you get these to appear? Or is the "could" a wish?
It's ``automatic''. The entry of the person needs a field "anniversary",
if that's filled with a date in yyyy-mm-dd format, it's included
(perhaps one has to set a variable like ``show-bbdb-anniversaries''
and/or load a corresponding elisp-addition.)
Martin
Eric> thank you, eric -- : Eric S Fraga via Emacs 28.0.50, Org
Eric> release_9.4.4-231-gf46925
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: contact management in emacs
2021-02-27 11:08 contact management in emacs Alan Schmitt
2021-02-27 11:31 ` Martin Steffen
@ 2021-02-27 16:53 ` Bob Newell
2021-02-28 9:06 ` Russell Adams
` (2 subsequent siblings)
4 siblings, 0 replies; 33+ messages in thread
From: Bob Newell @ 2021-02-27 16:53 UTC (permalink / raw)
To: emacs-orgmode
I've used BBDB for years, and have tried org-contact, but it
didn't seem to scale to the now rather large size of my BBDB
database.
I've looked at migrating to EBDB but as I have many custom
functions I haven't yet made the move.
BBDB can do amazing things. I've mentioned some of them
before. Of course org links are supported, and in conjunction
with the 'gnorb' package, Gnus email can be associated with
BBDB entries in interesting ways.
I use BBDB to easily maintain a slew of mailing lists. I also
have custom functions to set the input language mode for those
with whom I correspond in non-English languages. I even use
BBDB to initiate phone calls when I'm on my desktop computer.
I hadn't thought to put BBDB under version control but that
would be very easy.
However you don't need to get fancy right away. All the basics
are there. Like many things Emacs, it does take time to get
things set up the way you wish, but that time is well repaid
down the road a little.
--
Bob Newell
Honolulu, Hawai`i
- Via GNU/Linux/Emacs/Gnus/BBDB
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: contact management in emacs
2021-02-27 11:31 ` Martin Steffen
2021-02-27 13:20 ` andrés ramírez
@ 2021-02-27 17:00 ` Dr. Arne Babenhauserheide
1 sibling, 0 replies; 33+ messages in thread
From: Dr. Arne Babenhauserheide @ 2021-02-27 17:00 UTC (permalink / raw)
To: Martin Steffen; +Cc: Alan Schmitt, emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 429 bytes --]
Martin Steffen <msteffen@ifi.uio.no> writes:
> I use bbdb (big-brother data base). I use it since a looong time
> already, and amassed 15000 or so contracts. It does what I want, it's
> text-based, so versioning is not a problem.
And it is fast; lookup feels instantaneous — different from many other
address-manager solutions.
Best wishes,
Arne
--
Unpolitisch sein
heißt politisch sein
ohne es zu merken
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1125 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: contact management in emacs
[not found] <mailman.47.1614445226.20994.emacs-orgmode@gnu.org>
@ 2021-02-27 20:52 ` dalanicolai
2021-03-07 22:51 ` Jean Louis
0 siblings, 1 reply; 33+ messages in thread
From: dalanicolai @ 2021-02-27 20:52 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 43245 bytes --]
I think all packages fulfill your requirements. So I would say it depends
on how many contacts you are managing. I have some experience with
org-contacts, and I find it very convenient and straightforward. It is also
very convenient to just use org-mode, i.e. a plain text file, for your
contacts. Every contact is a headline and you can add any kind of property
or tag etc. you want. Also anniversaries get added to the Agenda. You can
very easily jump to the right contact, using imenu or swoop/swiper (I use
`SPC j i ` in Spacemacs. So if you have less than say 300 contacts (I have
really no clue about the number of contacts that will still work smoothly),
then depending on how die-hard you are, I would recommend to start with
org-contacs. You can use org-vcard to import contacts, and org-vcard claims
to support exports too but I did not test that yet.
Anyway, I think you won't loose much time with setting up org-contacts and
from then you can slowly check out and study the other options.
I do not use Emacs for email yet, but org-contacts claims to support most
of Emacs its mail-readers.
If you enjoy tweaking your setup and study a little more then maybe
directly use BBDB or EBDB. EBDB's goal is to be a modern BBDB and I guess
the main developer does a very nice job. I have no experience with these
databases, because I think they are overkill (currently) for my usecase.
Daniel Nicolai
On Sat, 27 Feb 2021 at 18:03, <emacs-orgmode-request@gnu.org> wrote:
> Send Emacs-orgmode mailing list submissions to
> emacs-orgmode@gnu.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.gnu.org/mailman/listinfo/emacs-orgmode
> or, via email, send a message with subject or body 'help' to
> emacs-orgmode-request@gnu.org
>
> You can reach the person managing the list at
> emacs-orgmode-owner@gnu.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Emacs-orgmode digest..."
>
>
> Today's Topics:
>
> 1. Re: Turning off all indentation in 9.4.4 (TRS-80)
> 2. Re: Tips on maintaining history in Org Mode (TRS-80)
> 3. Re: Set archive location relative to property (TRS-80)
> 4. [PATCH] ~org-font-lock-add-priority-faces~: ensure priority
> cookies are in a headline (Sébastien Miquel)
> 5. Re: Tips on maintaining history in Org Mode (Samuel Wales)
> 6. Re: Tips on maintaining history in Org Mode (David Masterson)
> 7. Re: Tips on maintaining history in Org Mode (David Masterson)
> 8. Re: Tips on maintaining history in Org Mode (David Masterson)
> 9. Re: Tips on maintaining history in Org Mode (Tim Cross)
> 10. [bug] org-yank in stars corrupts outline (Samuel Wales)
> 11. Re: [bug] org-yank in stars corrupts outline (Samuel Wales)
> 12. Re: Tips on maintaining history in Org Mode (David Masterson)
> 13. Re: Tips on maintaining history in Org Mode (Samuel Wales)
> 14. Re: Tips on maintaining history in Org Mode (Ihor Radchenko)
> 15. Re: Tips on maintaining history in Org Mode (Ihor Radchenko)
> 16. Re: Tips on maintaining history in Org Mode (Ihor Radchenko)
> 17. contact management in emacs (Alan Schmitt)
> 18. Simple org-publish configuration example in manual does not
> work (dalanicolai)
> 19. Re: contact management in emacs (Martin Steffen)
> 20. Re: [bug] org-yank in stars corrupts outline (Maxim Nikulin)
> 21. Re: [PATCH] org-mac-link: Disable Evernote capture by default
> (Aaron Jensen)
> 22. Re: Babel: Programmatically evaluate a heading and subtrees?
> (ian martins)
> 23. Re: contact management in emacs (andrés ramírez)
> 24. ob-reticulate: R+Python interface from Babel (Jack Kamm)
> 25. Re: contact management in emacs (Eric S Fraga)
> 26. Re: contact management in emacs (andrés ramírez)
> 27. Re: contact management in emacs (Martin Steffen)
> 28. Re: contact management in emacs (Bob Newell)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 26 Feb 2021 14:12:09 -0500
> From: TRS-80 <lists.trs-80@isnotmyreal.name>
> To: emacs-orgmode@gnu.org
> Subject: Re: Turning off all indentation in 9.4.4
> Message-ID: <83f49a373d71c4b786bda1ad6323ca87@isnotmyreal.name>
> Content-Type: text/plain; charset=US-ASCII; format=flowed
>
> On 2021-02-26 01:20, Kyle Meyer wrote:
> > TRS-80 writes:
> >
> >> On 2021-02-24 15:58, TRS-80 wrote:
> >>> On 2021-02-16 23:30, Kyle Meyer wrote:
> > [...]
> >>>> So, if I'm reading your preferences correctly, it sounds like you
> >>>> want
> >>>> just the first suggestion in the above snippet, leaving
> >>>> org-adapt-indentation at its default value:
> >>>>
> >>>> (add-hook 'org-mode-hook (lambda () (electric-indent-local-mode
> >>>> -1)))
> >>>
> >>> OK, I just did eval-expression (M-:) with (electric-indent-local-mode
> >>> -1) in an Orgmode buffer. After very brief testing, it does indeed
> >>> seem to return the desired behavior. So thanks a lot for that tip!
> > [...]
> >> OK, so after that yesterday, I went ahead and added
> >> (electric-indent-local-mode -1) to my org-mode hook. Then today upon
> >> re-starting Emacs, I am back to not working.
> >>
> >> By not working I mean: Pressing enter goes to column 0 as it should,
> >> however then pressing <TAB> does nothing. Where previously it would
> >> jump to same level as indented above.
> >>
> >> My settings are:
> >>
> >> - electric-indent-local-mode nil (local in each Orgmode buffer, set
> >> via
> >> hook)
> >>
> >> - org-adapt-indentation 'headline-data
> >
> > I'm just repeating my suggestion from above, but perhaps you want to
> > leave org-adapt-indentation at its default value of t?
>
> Apologies, I had skipped right over that bit!
>
> Doing as you say appears (after very brief test just now) to have given
> me back all the expected behavior:
>
> - RET goes to column zero
>
> - TAB goes to indentation level
>
> - Logbook entries are indented as they should be
>
> However in the course of doing this, it reminded me of what I was trying
> to do in the first place, which I thought I could accomplish with some
> of the new functionality (headline-data in particular).
>
> In my mind at least, the headline data belongs "with" the headline. So
> all drawers like LOGBOOK and PROPERTIES (and their respective entries,
> of course) should all be indented to same level as headline.
>
> Now, I used to think the same way about the body text, but I changed my
> mind a year or two (maybe more) ago, as I realized that was just wasting
> too mych space.
>
> So, my reading of this new(?) headline-data setting, was that it seemed
> to be exactly what I had been looking for! But perhaps I misunderstood?
>
> Cheers,
> TRS-80
>
>
>
> ------------------------------
>
> Message: 2
> Date: Fri, 26 Feb 2021 14:24:14 -0500
> From: TRS-80 <lists.trs-80@isnotmyreal.name>
> To: emacs-orgmode@gnu.org
> Subject: Re: Tips on maintaining history in Org Mode
> Message-ID: <45e4dc6434becb1552adc7df544db01a@isnotmyreal.name>
> Content-Type: text/plain; charset=US-ASCII; format=flowed
>
> On 2021-02-26 01:22, David Masterson wrote:
> > There are many ways of maintaining history in a group of Org files:
> > 1. Archive within a file
> > 2. Archive to a separate (archive) file
> > 3. Special TODO types for history
> > 4. Special TAG types for history
> > 5. etc.
> >
> > My question is, if you have meetings/phone calls as TODOs, what is the
> > preferred way to handle when they move into history so that, *much*
> > later, you can easily produce a list of all of the meetings/phone calls
> > with dates and times of them? The issue (I think) is, when you mark
> > the
> > TODO as DONE, you lose the info of what the TODO was originally.
> >
> > Suggestions
>
> I agree with what others already said about logging state changes with
> timestamps. I do the same and find this an extremely handy place to
> put "metadata about the task, or reason that it changed" and keep it
> separate/hidden from the main body of the task (which in my mind
> should only contain info about the subject of the headline / task
> itself).
>
> However when you say "history" I suspect you mean "archive" and this
> is something I have been thinking about a long time as well. Because
> I think the current way that Orgmode handles this is a bit naive /
> simplistic. Well, at least there is the option to create your own
> archival function, which I suspect I will do at some point. In fact I
> have been thinking about the best way to do that for some time
> already.
>
> Cheers,
> TRS-80
>
>
>
> ------------------------------
>
> Message: 3
> Date: Fri, 26 Feb 2021 14:30:56 -0500
> From: TRS-80 <lists.trs-80@isnotmyreal.name>
> To: emacs-orgmode@gnu.org
> Subject: Re: Set archive location relative to property
> Message-ID: <565b3cb59087b33087676d8059a7e39d@isnotmyreal.name>
> Content-Type: text/plain; charset=UTF-8; format=flowed
>
> On 2021-02-25 15:49, Florian Lindner wrote:
> > Am 25.02.21 um 21:22 schrieb Florian Lindner:
> >> is this possible with org-mode? Given a tree:
> >>
> >> * Name
> >> :PROPERTIES:
> >> :ARCHIVE: ???
> >> :END:
> >> ** Archive :ARCHIVE:
> >> ** Some node
> >>
> >> Upon archiving "Some node" (or any direct or indirect sub-node of
> >> Projectname) I want to end it up under "** Archive". The archive
> >> location should always be relative to the node where the property
> >> ARCHIVE is set.
> >>
> >> The documentation org-archive-location does not suggest that is
> >> possible.
> >
> > An alternative idea would be a setting for the ARCHIVE property that
> > searches the tree upward until it finds a node with an :ARCHIVE: tag
> > and use that as archive location. Maybe indicated by a setting of
> > "::%a".
> >
> > What do you think?
>
> I could be wrong, but my feeling (in either case) is something like
> that would probably require writing a custom archive function.
> Luckily, Orgmode allows you to do that.
>
> Cheers,
> TRS-80
>
>
>
> ------------------------------
>
> Message: 4
> Date: Fri, 26 Feb 2021 20:58:35 +0100
> From: Sébastien Miquel <sebastien.miquel@posteo.eu>
> To: emacs-orgmode@gnu.org
> Cc: Ihor Radchenko <yantar92@gmail.com>
> Subject: [PATCH] ~org-font-lock-add-priority-faces~: ensure priority
> cookies are in a headline
> Message-ID: <a9f0fc01-2f32-8831-ac8b-0f0fe9e00a4d@posteo.eu>
> Content-Type: text/plain; charset="utf-8"; Format="flowed"
>
> Priority cookies are always in a headline.
>
> The attached patch speeds up fontification of a 1k lines buffer by 0.1
> second.
>
> Note that the variable org-priority-regexp can't be modified since
> it is used in the agenda and in org-get-priority.
>
> Regards,
>
> --
> Sébastien Miquel
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: 0001-org.el-org-font-lock-add-priority-faces-Speed-up-reg.patch
> Type: text/x-patch
> Size: 967 bytes
> Desc: not available
> URL: <
> https://lists.gnu.org/archive/html/emacs-orgmode/attachments/20210226/9ca34244/attachment.bin
> >
>
> ------------------------------
>
> Message: 5
> Date: Fri, 26 Feb 2021 14:34:43 -0700
> From: Samuel Wales <samologist@gmail.com>
> To: David Masterson <dsmasterson92630@outlook.com>
> Cc: emacs-orgmode@gnu.org
> Subject: Re: Tips on maintaining history in Org Mode
> Message-ID:
> <
> CAJcAo8uAc04c2v4xMhm8PWbp5v3wk3Jz13bDJDkdLFDnVs5kUw@mail.gmail.com>
> Content-Type: text/plain; charset="UTF-8"
>
> org does indeed have a lot of related features, maybe too many even.
> here is some of what i do.
>
> - if i doneify, it means i will likely not need to search for it.
> archived to a file.
> [currently the archiver is so slow i can't use it]
> CLOSED: [2012-11-08 Thu 19:40]
> - state logging for repeaters in logbook
> - your question: notes to keep around like this
> ***** LOG [2021-02-26 Fri 14:18] talked to bill gates; he uses linux now
> these get sorted at bottom by timestamp using user-defined
> this is the main thing
> - bare inactive free form as needed
>
> --
> The Kafka Pandemic
>
> Please learn what misopathy is.
>
> https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html
>
>
>
> ------------------------------
>
> Message: 6
> Date: Fri, 26 Feb 2021 14:51:30 -0800
> From: David Masterson <dsmasterson92630@outlook.com>
> To: Ihor Radchenko <yantar92@gmail.com>
> Cc: emacs-orgmode@gnu.org
> Subject: Re: Tips on maintaining history in Org Mode
> Message-ID:
> <
> SJ0PR03MB5455FD17CD8FA3853983D5509B9D9@SJ0PR03MB5455.namprd03.prod.outlook.com
> >
>
> Content-Type: text/plain
>
> Ihor Radchenko <yantar92@gmail.com> writes:
>
> > David Masterson <dsmasterson92630@outlook.com> writes:
> >> My question is, if you have meetings/phone calls as TODOs, what is the
> >> preferred way to handle when they move into history so that, *much*
> >> later, you can easily produce a list of all of the meetings/phone calls
> >> with dates and times of them? The issue (I think) is, when you mark the
> >> TODO as DONE, you lose the info of what the TODO was originally.
> >
> > See Org manual :: 5.3 Progress Logging
>
> Interesting, but then how do you get the list? I mean is there an
> agenda to use?
> --
> David Masterson
>
>
>
> ------------------------------
>
> Message: 7
> Date: Fri, 26 Feb 2021 14:55:16 -0800
> From: David Masterson <dsmasterson92630@outlook.com>
> To: Tim Cross <theophilusx@gmail.com>
> Cc: emacs-orgmode@gnu.org
> Subject: Re: Tips on maintaining history in Org Mode
> Message-ID:
> <
> SJ0PR03MB5455A0B7779A6D32EDB6EC099B9D9@SJ0PR03MB5455.namprd03.prod.outlook.com
> >
>
> Content-Type: text/plain
>
> Tim Cross <theophilusx@gmail.com> writes:
>
> > David Masterson <dsmasterson92630@outlook.com> writes:
> >
> >> There are many ways of maintaining history in a group of Org files:
> >> 1. Archive within a file
> >> 2. Archive to a separate (archive) file
> >> 3. Special TODO types for history
> >> 4. Special TAG types for history
> >> 5. etc.
> >>
> >> My question is, if you have meetings/phone calls as TODOs, what is the
> >> preferred way to handle when they move into history so that, *much*
> >> later, you can easily produce a list of all of the meetings/phone calls
> >> with dates and times of them? The issue (I think) is, when you mark the
> >> TODO as DONE, you lose the info of what the TODO was originally.
> >
> > A lot will depend on your requirements.
> >
> > For me, my TODOs are setup so that they record a date stamp for when
> > they were added and whenever they change state e.g. started, done,
> > delegated etc.
>
> So, you use progress logging.
>
> > For non-TODO items, I will often put an inactive timestamp in the
> > heading title.
>
> Do your headings become busy?
>
> What would you use to then make a list of all meetings you had last year?
>
> --
> David Masterson
>
>
>
> ------------------------------
>
> Message: 8
> Date: Fri, 26 Feb 2021 15:00:02 -0800
> From: David Masterson <dsmasterson92630@outlook.com>
> To: emacs-orgmode@gnu.org
> Subject: Re: Tips on maintaining history in Org Mode
> Message-ID:
> <
> SJ0PR03MB54554F09F1784A4DE894233D9B9D9@SJ0PR03MB5455.namprd03.prod.outlook.com
> >
>
> Content-Type: text/plain
>
> Eric S Fraga <e.fraga@ucl.ac.uk> writes:
>
> > My approach is simple. For TODO items, I archive to separate file when
> > done. That file is easily searchable, e.g. using C-c /.
>
> Ah! org-occur! That's something forgot about and looks useful.
>
> > I keep both the original file and the archive file under revision
> > control, just in case.
>
> I do that, too.
>
> >> The issue (I think) is, when you mark the TODO as DONE, you lose the
> >> info of what the TODO was originally.
> >
> > What info is lost? In fact, if you log state changes, all the
> > information is there.
>
> I see how that workss now with org-occur.
>
> > By the way, if you have recurring items, one package that you might find
> > useful is org-recur which is on ELPA.
>
> Thanks
>
> --
> David Masterson
>
>
>
> ------------------------------
>
> Message: 9
> Date: Sat, 27 Feb 2021 09:59:50 +1100
> From: Tim Cross <theophilusx@gmail.com>
> To: David Masterson <dsmasterson92630@outlook.com>
> Cc: emacs-orgmode@gnu.org
> Subject: Re: Tips on maintaining history in Org Mode
> Message-ID: <87wnuu9zrf.fsf@gmail.com>
> Content-Type: text/plain
>
>
> David Masterson <dsmasterson92630@outlook.com> writes:
>
> > Tim Cross <theophilusx@gmail.com> writes:
> >
> >> David Masterson <dsmasterson92630@outlook.com> writes:
> >>
> >> For me, my TODOs are setup so that they record a date stamp for when
> >> they were added and whenever they change state e.g. started, done,
> >> delegated etc.
> >
> > So, you use progress logging.
>
> Yes.
>
> >
> >> For non-TODO items, I will often put an inactive timestamp in the
> >> heading title.
> >
> > Do your headings become busy?
> >
>
> Some would feel they are 'busy'. I always put the timestamp at the
> beginning of the heading, so there is a regular pattern (not much
> different from the leading heading stars) and I've just got use to it,
> so I don't really see it now.
>
> > What would you use to then make a list of all meetings you had last year?
>
> For me, archiving is about data I'm unlikely to need again, but just in
> case I do, it is in the archive. I rarely look at my archives. However,
> when I do archive, I will usually archive into a 'year' file. So, to
> find all the meetings held in 2015, I would open that archive file and
> search for entries with the tag MEETING (I also have a tag for PHONE).
>
> --
> Tim Cross
>
>
>
> ------------------------------
>
> Message: 10
> Date: Fri, 26 Feb 2021 17:52:37 -0700
> From: Samuel Wales <samologist@gmail.com>
> To: emacs-orgmode@gnu.org
> Subject: [bug] org-yank in stars corrupts outline
> Message-ID:
> <CAJcAo8uF=
> JrtYWfe2HCPpgXcbD5kbGT78wtn67zXB8V_-SGWpg@mail.gmail.com>
> Content-Type: text/plain; charset="UTF-8"
>
> it is neither raw yank behavior nor org syntax
>
> in recent maint
>
> i have org-yank-adjusted-subtrees t
>
> * org-yank is funny
> *** kill this line (with newline) then try yanking at ^ places (remove
> the ^ first)
> the fault lies in the stars
> insertion above and arbitrary demotion
> *** x
> asdfnaksdj fnkadsn fkjans df
> ^a^sdkfjnaksdfn kajsndfk ajdnsf
> askdjfkasjdn fkajfdns
> *^*^* y
> *** [[https://go^ogle.com]]
>
>
>
> ------------------------------
>
> Message: 11
> Date: Fri, 26 Feb 2021 17:54:36 -0700
> From: Samuel Wales <samologist@gmail.com>
> To: emacs-orgmode@gnu.org
> Subject: Re: [bug] org-yank in stars corrupts outline
> Message-ID:
> <CAJcAo8vKRwzP_TAOwxCttC6o82O0g2OwOg_V+ep2E4=
> E3BxFxA@mail.gmail.com>
> Content-Type: text/plain; charset="UTF-8"
>
> *** kill any header (with newline) then try yanking in various places
> in the stars of any indented header that has things above it. you
> should get multiple demotions that do not conform to outline.
>
> On 2/26/21, Samuel Wales <samologist@gmail.com> wrote:
> > it is neither raw yank behavior nor org syntax
> >
> > in recent maint
> >
> > i have org-yank-adjusted-subtrees t
> >
> > * org-yank is funny
> > *** kill this line (with newline) then try yanking at ^ places (remove
> > the ^ first)
> > the fault lies in the stars
> > insertion above and arbitrary demotion
> > *** x
> > asdfnaksdj fnkadsn fkjans df
> > ^a^sdkfjnaksdfn kajsndfk ajdnsf
> > askdjfkasjdn fkajfdns
> > *^*^* y
> > *** [[https://go^ogle.com]]
> >
>
>
> --
> The Kafka Pandemic
>
> Please learn what misopathy is.
>
> https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html
>
>
>
> ------------------------------
>
> Message: 12
> Date: Fri, 26 Feb 2021 19:17:34 -0800
> From: David Masterson <dsmasterson92630@outlook.com>
> To: Tim Cross <theophilusx@gmail.com>
> Cc: emacs-orgmode@gnu.org
> Subject: Re: Tips on maintaining history in Org Mode
> Message-ID:
> <
> SJ0PR03MB5455951AD10B7FDB57BD87E39B9C9@SJ0PR03MB5455.namprd03.prod.outlook.com
> >
>
> Content-Type: text/plain
>
> Tim Cross <theophilusx@gmail.com> writes:
>
> > David Masterson <dsmasterson92630@outlook.com> writes:
> >
> >> What would you use to then make a list of all meetings you had last
> year?
> >
> > For me, archiving is about data I'm unlikely to need again, but just in
> > case I do, it is in the archive. I rarely look at my archives. However,
> > when I do archive, I will usually archive into a 'year' file. So, to
> > find all the meetings held in 2015, I would open that archive file and
> > search for entries with the tag MEETING (I also have a tag for PHONE).
>
> Got it. Thanks.
> --
> David Masterson
>
>
>
> ------------------------------
>
> Message: 13
> Date: Fri, 26 Feb 2021 21:21:54 -0700
> From: Samuel Wales <samologist@gmail.com>
> To: David Masterson <dsmasterson92630@outlook.com>
> Cc: Tim Cross <theophilusx@gmail.com>, emacs-orgmode@gnu.org
> Subject: Re: Tips on maintaining history in Org Mode
> Message-ID:
> <CAJcAo8tK7QiKLeBWe9+duQmntr2EER3pGXOJJy_Cx7vDu=
> djpg@mail.gmail.com>
> Content-Type: text/plain; charset="UTF-8"
>
> note that there is an issue when you try to name your archive files
> using years like computer-2000.org_archive. it can take seconds to
> find-file big files so it is understandable to want to name files like
> that.
>
> however, if you change the name of an archive file, it will not be
> found by org when you tell it to do certain things with archive files.
> some code in org derives the basename to search from the basename of
> the original file like computer,org.
>
> in principle, maybe org could allow year suffixes/prefixes or it could
> search all archive files in dirs that have org files.
>
> perhaps also changing org-archive-file-header-format to allow a format
> thingie for a timestamp would allow you to take parts of an archive
> file and move them into one per year without having to put the date in
> each archived entry.
>
>
> On 2/26/21, David Masterson <dsmasterson92630@outlook.com> wrote:
> > Tim Cross <theophilusx@gmail.com> writes:
> >
> >> David Masterson <dsmasterson92630@outlook.com> writes:
> >>
> >>> What would you use to then make a list of all meetings you had last
> >>> year?
> >>
> >> For me, archiving is about data I'm unlikely to need again, but just in
> >> case I do, it is in the archive. I rarely look at my archives. However,
> >> when I do archive, I will usually archive into a 'year' file. So, to
> >> find all the meetings held in 2015, I would open that archive file and
> >> search for entries with the tag MEETING (I also have a tag for PHONE).
> >
> > Got it. Thanks.
> > --
> > David Masterson
> >
> >
>
>
> --
> The Kafka Pandemic
>
> Please learn what misopathy is.
>
> https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html
>
>
>
> ------------------------------
>
> Message: 14
> Date: Sat, 27 Feb 2021 14:28:13 +0800
> From: Ihor Radchenko <yantar92@gmail.com>
> To: David Masterson <dsmasterson92630@outlook.com>
> Cc: emacs-orgmode@gnu.org
> Subject: Re: Tips on maintaining history in Org Mode
> Message-ID: <87czwmc9du.fsf@localhost>
> Content-Type: text/plain
>
> David Masterson <dsmasterson92630@outlook.com> writes:
>
> > Interesting, but then how do you get the list? I mean is there an
> > agenda to use?
>
> Generally yes, you can use agenda. Or you can use sparse tree (more
> manual).
> For agenda, if you customise org-log-done, you can use
> org-agenda-log-mode ("v l" or "v L" in an agenda buffer). You can add
> archived items as well with "v a" or/and "v A".
>
> Just org-agenda-log-mode will show everything, not just calls. Narrowing
> to calls only will depend on how you define a todo, which is a call.
>
> If you use something like PHONE or CALL todo keywords, it might be
> slightly tricky. You will need to customise org-todo-keywords, so that
> your CALL->DONE changes are recorded (see the org-todo-keywords
> docstring). You will also need to filter displayed items in agenda by
> regexp involving the keyword you use to define the call.
>
> An easier way could be marking your calls with a tag. Then, you can
> filter your org-agenda-log by that tag to show only calls.
>
> Hope it helps.
>
> Best,
> Ihor
>
>
>
>
> ------------------------------
>
> Message: 15
> Date: Sat, 27 Feb 2021 14:38:47 +0800
> From: Ihor Radchenko <yantar92@gmail.com>
> To: Samuel Wales <samologist@gmail.com>, David Masterson
> <dsmasterson92630@outlook.com>
> Cc: Tim Cross <theophilusx@gmail.com>, emacs-orgmode@gnu.org
> Subject: Re: Tips on maintaining history in Org Mode
> Message-ID: <87a6rqc8w8.fsf@localhost>
> Content-Type: text/plain
>
> Samuel Wales <samologist@gmail.com> writes:
>
> > perhaps also changing org-archive-file-header-format to allow a format
> > thingie for a timestamp would allow you to take parts of an archive
> > file and move them into one per year without having to put the date in
> > each archived entry.
>
> FYI: I have implemented automatic per-year archiving, which is correctly
> handled by other org commands in my personal config:
> https://github.com/yantar92/emacs-config/blob/master/config.org#archiving
>
> Best,
> Ihor
>
>
>
>
> ------------------------------
>
> Message: 16
> Date: Sat, 27 Feb 2021 14:42:03 +0800
> From: Ihor Radchenko <yantar92@gmail.com>
> To: Samuel Wales <samologist@gmail.com>, David Masterson
> <dsmasterson92630@outlook.com>
> Cc: emacs-orgmode@gnu.org
> Subject: Re: Tips on maintaining history in Org Mode
> Message-ID: <877dmuc8qs.fsf@localhost>
> Content-Type: text/plain
>
> Samuel Wales <samologist@gmail.com> writes:
> > [currently the archiver is so slow i can't use it]
>
> Are your existing archives very big (few Mbs)? If so, you may try to
> speed up the archiving using feature/org-fold branch [1]. If that is not
> enough, I recommend splitting archives on yearly basis [2] or disabling
> font-lock in archive files.
>
> Best,
> Ihor
>
> [1] https://github.com/yantar92/org
> [2]
> https://github.com/yantar92/emacs-config/blob/master/config.org#archiving
>
>
>
>
> ------------------------------
>
> Message: 17
> Date: Sat, 27 Feb 2021 12:08:04 +0100
> From: Alan Schmitt <alan.schmitt@polytechnique.org>
> To: "emacs-orgmode" <emacs-orgmode@gnu.org>
> Subject: contact management in emacs
> Message-ID: <87lfb9bwff.fsf@m4x.org>
> Content-Type: text/plain; charset="utf-8"
>
> Hello,
>
> This may be slightly off-topic for the list, but as I’m considering
> org-contacts for my question, I hope it will be of interest here.
>
> I would like to migrate my contact management to emacs, as I’m already
> using it for email. My requirements are the following ones:
> - address completion in emacs email clients (I currently use notmuch)
> - support for multiple email addresses and custom fields
> - creation of org links to contacts
> - export to vcard format for synchronization to my mobile phone (using
> vdirsyncer)
> - keep the data under version control
>
> I have looked at two tools, which almost seem fit for the job.
> - ebdb does most of this, with the exception of vcard export (it seems
> to be worked on, https://github.com/girzel/ebdb/issues/60), and I’m not
> sure using version control on an sqlite file is a good idea.
> - org-contacts also seem to have all the required features, including
> vcard export (and if not sufficient there is
> https://github.com/novoid/org-contacts2vcard). I was worried it was
> unmaintained when looking at the copyright line, but I see in
>
> https://code.orgmode.org/bzg/org-mode/commits/master/contrib/lisp/org-contacts.el
> that there are recent commits to the file.
>
> Do you manage your contacts in emacs? And if so, what tools or workflow
> do you recommend?
>
> Best,
>
> Alan
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: signature.asc
> Type: application/pgp-signature
> Size: 528 bytes
> Desc: not available
> URL: <
> https://lists.gnu.org/archive/html/emacs-orgmode/attachments/20210227/1b6fa02c/attachment.sig
> >
>
> ------------------------------
>
> Message: 18
> Date: Sat, 27 Feb 2021 12:08:38 +0100
> From: dalanicolai <dalanicolai@gmail.com>
> To: emacs-orgmode@gnu.org
> Subject: Simple org-publish configuration example in manual does not
> work
> Message-ID:
> <CACJP=3k2jL1z0d-uALFGoutffFF2o=
> 7-L39zUns6si0KAhZ-_g@mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hello, sorry for sending this email directly, but currently sending mail
> from Emacs does not work correctly.
>
>
> I was trying out the org-publishing functionality, but I found that
> the first example in the documentation given at
> https://orgmode.org/manual/Simple-example.html#Simple-example
> does not work. When I try to publish the project it errors with the
> following message
>
> org-publish-file: No publishing function chosen
>
> So I figured that I should add a :publishing-function and I remembered
> reading earlier in the documnetation,
> i.e. at
> https://orgmode.org/manual/Publishing-action.html#Publishing-action
> org-html-publish-to-html
> <https://orgmode.org/manual/Publishing-action.html#Publishing-actionorg-html-publish-to-html>
> that org uses the default publishing-function
>
> org-publish-org-to-html
>
> But when trying to publish using that function then Emacs errors with
> the message
>
> org-publish-file: Symbol’s function definition is void:
> org-publish-org-to-html
>
> I have found the following error report from 17 Mar 2013, reporting
> exactly the same error (and a reply with the solution)
> https://lists.gnu.org/archive/html/emacs-orgmode/2013-03/msg01221.html
>
> It would be great if these two small point in the manual, which is
> otherwise great, could
> get updated.
>
> 1. add the required :publishing-function keyword to the documentation (with
> the correct function value)
> 2. change the name of the default function from org-publish-org-to-html ->
> *org-html-publish-to-html*
>
> Thank you!
>
> Best regards,
> Daniel Nicolai
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> https://lists.gnu.org/archive/html/emacs-orgmode/attachments/20210227/02a12cbf/attachment.html
> >
>
> ------------------------------
>
> Message: 19
> Date: Sat, 27 Feb 2021 12:31:05 +0100
> From: Martin Steffen <msteffen@ifi.uio.no>
> To: Alan Schmitt <alan.schmitt@polytechnique.org>
> Cc: emacs-orgmode <emacs-orgmode@gnu.org>
> Subject: Re: contact management in emacs
> Message-ID: <867dmteohy.fsf@login.ifi.uio.no>
> Content-Type: text/plain
>
>
>
>
> I use bbdb (big-brother data base). I use it since a looong time
> already, and amassed 15000 or so contracts. It does what I want, it's
> text-based, so versioning is not a problem.
>
> I think it can do vcard export (though when I used vcards is a long
> time ago, I can't remember if that was smooth, I think it was with one
> of my first smart phone, and I wanted to quick fill up the phone book
> there with my ``emacs-managed'' contact data base.).
>
> One can add used defined fields (where one can ``match'' all contacts
> for some criterion, and send then ``bulk'' email.
>
> Org is also bbdb-aware, insofar one can do those links: instead of
> [[file:xxxx][yyy]] one can use [[bbdb:somecriterion]].
>
> I don't know if it matches your needs, but I can't say bad things about
> that bbdb-thing.
>
> Martin
>
>
>
>
>
> ------------------------------
>
> Message: 20
> Date: Sat, 27 Feb 2021 18:55:54 +0700
> From: Maxim Nikulin <manikulin@gmail.com>
> To: emacs-orgmode@gnu.org
> Subject: Re: [bug] org-yank in stars corrupts outline
> Message-ID: <s1dc0b$udf$1@ciao.gmane.io>
> Content-Type: text/plain; charset=utf-8; format=flowed
>
> On 27/02/2021 07:52, Samuel Wales wrote:
> >
> > i have org-yank-adjusted-subtrees t
> >
> > * org-yank is funny
> > *** kill this line (with newline) then try yanking at ^ places (remove
> > the ^ first)
> > the fault lies in the stars
> > insertion above and arbitrary demotion
> > *** x
> > asdfnaksdj fnkadsn fkjans df
> > ^a^sdkfjnaksdfn kajsndfk ajdnsf
> > askdjfkasjdn fkajfdns
> > *^*^* y
> > *** [[https://go^ogle.com]]
>
> from [[help:org-yank]]
>
> > If it passes the test, and if the
> > cursor is at the beginning of a line or after the stars of a currently
> > empty headline, then the yank is handled specially. How exactly depends
> > on the value of the following variables.
>
> In my opinion, your "^" marks do not satisfy the specified criteria.
>
> Personally I use [[help:org-paste-subtree]] C-c C-x C-y directly. It has
> a minor issue however. First time after emacs start it refuses to yank
> subtree from X clipboard (prepared externally). Regular paste with undo
> C-y C-/ is enough to convince the function that there is a subtree in
> the clipboard. Next time it works without such dance.
>
>
>
>
>
> ------------------------------
>
> Message: 21
> Date: Sat, 27 Feb 2021 07:14:52 -0600
> From: Aaron Jensen <aaronjensen@gmail.com>
> To: emacs-orgmode@gnu.org
> Subject: Re: [PATCH] org-mac-link: Disable Evernote capture by default
> Message-ID:
> <CAHyO48x1rFo_CA_Ha3nZLNeWozurB=+
> 7pS1xOdc3p45nyF-y3Q@mail.gmail.com>
> Content-Type: text/plain; charset="UTF-8"
>
> On Wed, Feb 17, 2021 at 9:55 AM Aaron Jensen <aaronjensen@gmail.com>
> wrote:
> >
> > The two `shell-command-to-string` invocations during eval are
> > extremely slow. Users of Evernote should `org-mac-grab-Evernote-app-p`
> > and `org-mac-evernote-path` explicitly.
>
> Hi all,
>
> Any chance of getting this merged in? It's a pretty nasty one for mac
> users.
>
> Thanks,
>
> Aaron
>
>
>
> ------------------------------
>
> Message: 22
> Date: Sat, 27 Feb 2021 08:18:45 -0500
> From: ian martins <ianxm@jhu.edu>
> To: Nathan Neff <nathan.neff@gmail.com>
> Cc: emacs-orgmode <emacs-orgmode@gnu.org>
> Subject: Re: Babel: Programmatically evaluate a heading and subtrees?
> Message-ID:
> <CAC=rjb4iJPkXjOVAi83jjBrc=
> 4TjEZhr_KrEnYvF_K0GSapHOw@mail.gmail.com>
> Content-Type: text/plain; charset="UTF-8"
>
> Can you use noweb? In the example below, if you run the top code block
> babel will run the two that follow.
>
> A drawback is that you have to redefine variables, but it might be a
> benefit, since the individual blocks could be set with test data and
> the "main driver" could point to real data.
> -------
>
> #+begin_src elisp :results output :noweb yes :var data=data1
> <<fun1>>
> <<fun2>>
> #+end_src
>
> #+RESULTS:
> : called fun1: some data
> : called fun2
>
> #+name: data1
> some data
>
> #+name: fun1
> #+begin_src elisp :var data=data1
> (princ (format "called fun1: %s" data))
> #+end_src
>
> #+name: fun2
> #+begin_src elisp
> (princ "called fun2")
> #+end_src
>
> On Sat, Feb 20, 2021 at 2:11 PM Nathan Neff <nathan.neff@gmail.com> wrote:
> >
> > Hello all,
> >
> > I have some code like this:
> >
> > * Heading 1
> >
> > # code block name:FOO
> >
> > ** Subheading 1
> >
> > # code block
> >
> > ** Subheading 2
> >
> > # code block
> >
> > I find that I often want to evaluate the code in Heading 1 and its
> subheadings.
> >
> > Currently, I navigate to Heading 1 and then use org-babel-execute-subtree
> >
> > I see that there's a function called org-babel-goto-named-src-block, so
> I think
> > I could write a small function to jump to FOO in Heading 1 and then run
> execute subtree
> > and then jump back to my previous location in Emacs.
> >
> > Is there a more programmatic or built-in way? For example:
> > org-babel-execute-block-and-subheadings FOO
> >
> > Thanks,
> > --Nate
>
>
>
> ------------------------------
>
> Message: 23
> Date: Sat, 27 Feb 2021 13:20:23 +0000
> From: andrés ramírez <rrandresf@gmail.com>
> To: Martin Steffen <msteffen@ifi.uio.no>
> Cc: Alan Schmitt <alan.schmitt@polytechnique.org>, emacs-orgmode
> <emacs-orgmode@gnu.org>
> Subject: Re: contact management in emacs
> Message-ID: <868s79hcko.fsf@gmail.com>
> Content-Type: text/plain; charset=utf-8
>
> Hi. Martin and Alan.
>
> >>>>> "Martin" == Martin Steffen <msteffen@ifi.uio.no> writes:
>
>
> [...]
>
>
> Martin> Org is also bbdb-aware, insofar one can do those links:
> instead of [[file:xxxx][yyy]]
> Martin> one can use [[bbdb:somecriterion]].
>
> bbdb anniversaries could also appear on agenda:
> --8<---------------cut here---------------start------------->8---
> 10 days-agenda (W08-W09):
> Wednesday 24 February 2021
> Thursday 25 February 2021
> Friday 26 February 2021
> Saturday 27 February 2021
> Sunday 28 February 2021
> Monday 1 March 2021 W09
> Tuesday 2 March 2021
> Wednesday 3 March 2021
> bbdb: [[bbdb:Pedro ][Pedro 61st custom anniversary]]
> Thursday 4 March 2021
> Friday 5 March 2021
> --8<---------------cut here---------------end--------------->8---
>
> Andrés Ramírez
>
>
>
> ------------------------------
>
> Message: 24
> Date: Sat, 27 Feb 2021 06:15:29 -0800
> From: Jack Kamm <jackkamm@gmail.com>
> To: emacs-orgmode@gnu.org
> Subject: ob-reticulate: R+Python interface from Babel
> Message-ID: <87y2f94mwu.fsf@gmail.com>
> Content-Type: text/plain
>
> Hi all,
>
> ob-reticulate is now available on MELPA.
>
> You can find more information here:
> https://github.com/jackkamm/ob-reticulate
>
> Cheers,
> Jack
>
>
>
> ------------------------------
>
> Message: 25
> Date: Sat, 27 Feb 2021 14:40:32 +0000
> From: Eric S Fraga <e.fraga@ucl.ac.uk>
> To: andrés ramírez <rrandresf@gmail.com>
> Cc: emacs-orgmode <emacs-orgmode@gnu.org>
> Subject: Re: contact management in emacs
> Message-ID: <87lfb9y3of.fsf@ucl.ac.uk>
> Content-Type: text/plain; charset=utf-8
>
> On Saturday, 27 Feb 2021 at 13:20, andrés ramírez wrote:
> > bbdb anniversaries could also appear on agenda:
>
> How do you get these to appear? Or is the "could" a wish?
> thank you, eric
> --
> : Eric S Fraga via Emacs 28.0.50, Org release_9.4.4-231-gf46925
>
>
>
> ------------------------------
>
> Message: 26
> Date: Sat, 27 Feb 2021 15:12:00 +0000
> From: andrés ramírez <rrandresf@gmail.com>
> To: andrés ramírez <rrandresf@gmail.com>, emacs-orgmode
> <emacs-orgmode@gnu.org>
> Subject: Re: contact management in emacs
> Message-ID: <868s79zgsf.fsf@gmail.com>
> Content-Type: text/plain
>
> Hi. Eric.
>
> >>>>> "Eric" == Eric S Fraga <e.fraga@ucl.ac.uk> writes:
>
>
> [...]
>
>
> Eric> How do you get these to appear? Or is the "could" a wish?
>
> This is my setup:
> --8<---------------cut here---------------start------------->8---
> (setq org-agenda-files (directory-files "~/docs/org/deft/" t
> ".*agenda\.org$"))
> --8<---------------cut here---------------end--------------->8---
>
> ~/docs/org/deft/bbdb-anniversary-trick.agenda.org:
> --8<---------------cut here---------------start------------->8---
> * anniversary [isodate]
> :PROPERTIES:
> :CATEGORY: bbdb
> :END:
> %%(when (fboundp 'my/org-bbdb-anniversaries) (my/org-bbdb-anniversaries))
> --8<---------------cut here---------------end--------------->8---
>
> --8<---------------cut here---------------start------------->8---
> (defun my/org-bbdb-anniversaries ()
> "It does not work on emacs-23"
> (when (/= 23 emacs-major-version)
> (org-bbdb-anniversaries)
> )
> )
> --8<---------------cut here---------------end--------------->8---
>
> the bbdb record should have the field anniversary:
> --8<---------------cut here---------------start------------->8---
> anniversary: 1960-03-03 custom
> --8<---------------cut here---------------end--------------->8---
>
> Best Regards
>
>
>
> ------------------------------
>
> Message: 27
> Date: Sat, 27 Feb 2021 16:14:19 +0100
> From: Martin Steffen <msteffen@ifi.uio.no>
> To: andrés ramírez <rrandresf@gmail.com>
> Cc: emacs-orgmode <emacs-orgmode@gnu.org>
> Subject: Re: contact management in emacs
> Message-ID: <8635xhee5w.fsf@login.ifi.uio.no>
> Content-Type: text/plain
>
> >>>>> "Eric" == Eric S Fraga <e.fraga@ucl.ac.uk> writes:
>
> Eric> How do you get these to appear? Or is the "could" a wish?
>
> It's ``automatic''. The entry of the person needs a field "anniversary",
> if that's filled with a date in yyyy-mm-dd format, it's included
> (perhaps one has to set a variable like ``show-bbdb-anniversaries''
> and/or load a corresponding elisp-addition.)
>
>
> Martin
>
>
>
>
> Eric> thank you, eric -- : Eric S Fraga via Emacs 28.0.50, Org
> Eric> release_9.4.4-231-gf46925
>
>
>
>
> ------------------------------
>
> Message: 28
> Date: Sat, 27 Feb 2021 06:53:57 -1000
> From: Bob Newell <bobnewell@bobnewell.net>
> To: "emacs-orgmode" <emacs-orgmode@gnu.org>
> Subject: Re: contact management in emacs
> Message-ID: <s6jv9ad1mfu.fsf@emailmessageidheader.nil>
> Content-Type: text/plain
>
> I've used BBDB for years, and have tried org-contact, but it
> didn't seem to scale to the now rather large size of my BBDB
> database.
>
> I've looked at migrating to EBDB but as I have many custom
> functions I haven't yet made the move.
>
> BBDB can do amazing things. I've mentioned some of them
> before. Of course org links are supported, and in conjunction
> with the 'gnorb' package, Gnus email can be associated with
> BBDB entries in interesting ways.
>
> I use BBDB to easily maintain a slew of mailing lists. I also
> have custom functions to set the input language mode for those
> with whom I correspond in non-English languages. I even use
> BBDB to initiate phone calls when I'm on my desktop computer.
>
> I hadn't thought to put BBDB under version control but that
> would be very easy.
>
> However you don't need to get fancy right away. All the basics
> are there. Like many things Emacs, it does take time to get
> things set up the way you wish, but that time is well repaid
> down the road a little.
>
> --
> Bob Newell
> Honolulu, Hawai`i
>
> - Via GNU/Linux/Emacs/Gnus/BBDB
>
>
>
> End of Emacs-orgmode Digest, Vol 180, Issue 30
> **********************************************
>
[-- Attachment #2: Type: text/html, Size: 59355 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: contact management in emacs
2021-02-27 11:08 contact management in emacs Alan Schmitt
2021-02-27 11:31 ` Martin Steffen
2021-02-27 16:53 ` Bob Newell
@ 2021-02-28 9:06 ` Russell Adams
2021-02-28 11:09 ` Alan Schmitt
` (2 more replies)
2021-03-07 22:13 ` Jean Louis
2022-09-09 16:11 ` Sébastien Rey-Coyrehourcq
4 siblings, 3 replies; 33+ messages in thread
From: Russell Adams @ 2021-02-28 9:06 UTC (permalink / raw)
To: emacs-orgmode
On Sat, Feb 27, 2021 at 12:08:04PM +0100, Alan Schmitt wrote:
> Hello,
>
> This may be slightly off-topic for the list, but as I’m considering
> org-contacts for my question, I hope it will be of interest here.
>
> I would like to migrate my contact management to emacs, as I’m already
> using it for email. My requirements are the following ones:
> - address completion in emacs email clients (I currently use notmuch)
> - support for multiple email addresses and custom fields
> - creation of org links to contacts
> - export to vcard format for synchronization to my mobile phone (using
> vdirsyncer)
> - keep the data under version control
>
> I have looked at two tools, which almost seem fit for the job.
> - ebdb does most of this, with the exception of vcard export (it seems
> to be worked on, https://github.com/girzel/ebdb/issues/60), and I’m not
> sure using version control on an sqlite file is a good idea.
> - org-contacts also seem to have all the required features, including
> vcard export (and if not sufficient there is
> https://github.com/novoid/org-contacts2vcard). I was worried it was
> unmaintained when looking at the copyright line, but I see in
> https://code.orgmode.org/bzg/org-mode/commits/master/contrib/lisp/org-contacts.el
> that there are recent commits to the file.
>
> Do you manage your contacts in emacs? And if so, what tools or workflow
> do you recommend?
The only reason I don't use BBDB is I want to use Org to allow me to
maintain notes about contacts (ie: CRM). Yes, I get that I could have
a CRM file and link in BBDB contacts, but that feels like adding
layers.
The stumbling point for me has been exporting to my mobile phone. I'm
fine with a one way sync from my BBDB/Org solution to the phone, but
I feel like I never found a good option.
Please share what you find works for you.
------------------------------------------------------------------
Russell Adams RLAdams@AdamsInfoServ.com
PGP Key ID: 0x1160DCB3 http://www.adamsinfoserv.com/
Fingerprint: 1723 D8CA 4280 1EC9 557F 66E8 1154 E018 1160 DCB3
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: contact management in emacs
2021-02-27 15:12 ` andrés ramírez
@ 2021-02-28 10:21 ` Eric S Fraga
0 siblings, 0 replies; 33+ messages in thread
From: Eric S Fraga @ 2021-02-28 10:21 UTC (permalink / raw)
To: andrés ramírez; +Cc: emacs-orgmode
On Saturday, 27 Feb 2021 at 15:12, andrés ramírez wrote:
> This is my setup:
Thank you for this. Works perfectly!
--
: Eric S Fraga via Emacs 28.0.50, Org release_9.4.4-231-gf46925
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: contact management in emacs
2021-02-28 9:06 ` Russell Adams
@ 2021-02-28 11:09 ` Alan Schmitt
2021-03-03 14:40 ` TRS-80
2021-03-07 22:57 ` Jean Louis
2 siblings, 0 replies; 33+ messages in thread
From: Alan Schmitt @ 2021-02-28 11:09 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 155 bytes --]
Hello,
Thanks a lot for all the replies. I migrated from bbdb to ebdb a long
time ago, and I may go back following your suggestions.
Thanks again,
Alan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 528 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: contact management in emacs
2021-02-28 9:06 ` Russell Adams
2021-02-28 11:09 ` Alan Schmitt
@ 2021-03-03 14:40 ` TRS-80
2021-03-07 22:57 ` Jean Louis
2 siblings, 0 replies; 33+ messages in thread
From: TRS-80 @ 2021-03-03 14:40 UTC (permalink / raw)
To: emacs-orgmode
On 2021-02-28 04:06, Russell Adams wrote:
> The stumbling point for me has been exporting to my mobile
> phone. I'm fine with a one way sync from my BBDB/Org solution to the
> phone, but I feel like I never found a good option.
>
> Please share what you find works for you.
I never got further than reading about it, but I have done quite a lot
of that. And it always seems like this is the stumbling block.
Especially two way sync (as I probably most often add new contacts
into my phone, when I am out and about).
OTOH, my PinePhone has just recently shipped, so perhaps having an
actual GNU/Linux phone (instead of Android) may suddenly obviate the
need for all these complicated workarounds... I suppose I will be
interested in what sort of format the Contacts "app" will be storing
them on the PinePhone. In fact, I think I will search for (or make) a
thread about that at Pine64 forums...
Cheers,
TRS-80
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: contact management in emacs
2021-02-27 11:08 contact management in emacs Alan Schmitt
` (2 preceding siblings ...)
2021-02-28 9:06 ` Russell Adams
@ 2021-03-07 22:13 ` Jean Louis
2021-03-08 7:49 ` Alan Schmitt
2022-09-09 16:11 ` Sébastien Rey-Coyrehourcq
4 siblings, 1 reply; 33+ messages in thread
From: Jean Louis @ 2021-03-07 22:13 UTC (permalink / raw)
To: Alan Schmitt; +Cc: emacs-orgmode
* Alan Schmitt <alan.schmitt@polytechnique.org> [2021-02-27 14:09]:
> Hello,
>
> This may be slightly off-topic for the list, but as I’m considering
> org-contacts for my question, I hope it will be of interest here.
>
> I would like to migrate my contact management to emacs, as I’m already
> using it for email. My requirements are the following ones:
> - address completion in emacs email clients (I currently use
> notmuch)
Your question I consider very important.
I am using heavily contact management with Emacs and PostgreSQL
database. Connection between Emacs and the database is provided by the
module `emacs-libpq`: https://github.com/anse1/emacs-libpq Currently I
manage over 220,000 contacts and more than 10,000 groups that I have
named "accounts" in the database, following the long term CRM
conventions.
Address completion is simple, I press the key and query for contacts,
insert name with email address nicely formatted.
> - support for multiple email addresses and custom fields
I have made for myself such a system that I may designate Cc: Bcc:
fields or tell that all email addresses of certain person will be
used. That header format is automatically created on the fly when
composing emails. Some email attachments are sent by using external
program `mutt` on the command line. And I am using multiple
identities. Contact may have single identity or may be under account
that has assigned identity or under multiple accounts with assigned
identities.
> - creation of org links to contacts
As there is display of a contact or profile, and I keep also Org
profiles of a contact, thus I can also create simple link to the
contact. Link creation is also easy, query for contact, insert link.
> - export to vcard format for synchronization to my mobile phone (using
> vdirsyncer)
I have made my own exporter to vcards, so all contacts are managed by
using PostgreSQL database through Emacs. By pressing `A` I am entering
the contact into the address book. Program is meant to have multiple
address books, for example private address book could be for device
nr. 1 and business address book for device nr. 2. This way all my
devices are synchronized from my central computer. No need for remote
insecure cloud databases.
> - keep the data under version control
Any editing may be under the database backed version control. For
example in this function here below:
(defun hlink-change-type ()
(interactive)
(let ((id (tabulated-list-get-id)))
(when id
(let ((new-type (hlink-types)))
(when new-type
;; version control begins here
(hyperscope-vc "hlinks" "hlinks_hlinktypes" id)
(rcd-db-update-entry "hlinks" "hlinks_hlinktypes" "integer" id new-type *hs*)
(hyperscope-refresh id))))))
Simple function `hyperscope-vc` keeps care of the version control.
(defun hyperscope-vc (table column id &optional description)
"Simple version system."
(let* ((value (rcd-db-get-entry table column id *hs*))
(value (format "%s" value))
(value (sql-escape-string value))
(description (if description (sql-escape-string description) "NULL"))
(sql (format "INSERT into vc (vc_table,
vc_column,
vc_tableid,
vc_value,
vc_description) values ('%s', '%s', %s, %s, %s)
RETURNING vc_id"
table column id value description))
(id (rcd-sql sql *hs*)))
(if id id nil)))
Version control is thus not automatic, it has to be chosen by myself
which databases or which editing would be under version control. The
above function first obtains all values from the database and then
inserts them into the table `vc` in the database. I could then browse
the table and return back the values if I wish so. Once in the
function, I do not think about it any more.
> Do you manage your contacts in emacs? And if so, what tools or workflow
> do you recommend?
I am recommending that you start using PostgreSQL database. I can
guide you. My software is not so finished for public, but I can guide
you personally and you will get stable system that lasts for years.
First thing would be to setup the PostgreSQL module for Emacs from
sources. If you are able to do that, I can guide you to get the rest
of functionality.
Jean
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: contact management in emacs
2021-02-27 20:52 ` dalanicolai
@ 2021-03-07 22:51 ` Jean Louis
0 siblings, 0 replies; 33+ messages in thread
From: Jean Louis @ 2021-03-07 22:51 UTC (permalink / raw)
To: dalanicolai; +Cc: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 2684 bytes --]
* dalanicolai <dalanicolai@gmail.com> [2021-02-27 23:53]:
> I think all packages fulfill your requirements. So I would say it depends
> on how many contacts you are managing. I have some experience with
> org-contacts, and I find it very convenient and straightforward. It is also
> very convenient to just use org-mode, i.e. a plain text file, for your
> contacts.
That may be convenient for friends or family, but is not a good idea
if such a contact database is to enlarge due to marketing actions.
People who collect leads and manage relations with many other people
must have straight way to manage contacts, and similar to well known
CRM systems such as SugarCRM or others. In fact contact management
could be managed by external program and database accessed through
Emacs. Though I do both with Emacs. And I like to access database from
shell as I do not use only Emacs as editor. As the database is
liberated from editor it allows access through any software or
programming language.
> Every contact is a headline and you can add any kind of property
> or tag etc. you want. Also anniversaries get added to the Agenda. You can
> very easily jump to the right contact, using imenu or swoop/swiper (I use
> `SPC j i ` in Spacemacs. So if you have less than say 300 contacts (I have
> really no clue about the number of contacts that will still work smoothly),
> then depending on how die-hard you are, I would recommend to start with
> org-contacs.
More important is how fast are contacts coming into the database. If
there are just 100 per year, then that will work well.
But marketing action of 23 hours have provided me like 1700 contacts,
so there would be no way that I ever keep up with text or hand
work. That requires automated insertion of contacts into the database,
and I use local database. Online lead capture is sent PGP encrypted by
email and emails are automatically processed and leads entered into
the local database. Placing contacts online is insecure IMHO, no
matter what is advertised about it.
> You can use org-vcard to import contacts, and org-vcard claims to
> support exports too but I did not test that yet. Anyway, I think
> you won't loose much time with setting up org-contacts and from then
> you can slowly check out and study the other options.
I am attaching `rcd-vcard.el` that uses PostgreSQL database and my
schemas to export vCards that work nicely with
Android/LineageOS/Replicant devices. Package alone will not
work. Functions may be useful for some people to modify them as they
wish. If somebody wish to really install my system, I will be helpful
in private chat or email and guide person until it becomes functional.
Jean
[-- Attachment #2: rcd-vcard.el --]
[-- Type: text/plain, Size: 9384 bytes --]
;;; rcd-vcard.el --- RCD vCard functions -*- lexical-binding: t; -*-
;; Copyright (C) 2016-2021 by Jean Louis
;; Author: Jean Louis <bugs@gnu.support>
;; Version: 0.1
;; Package-Requires: (rcd-utilities rcd-db-init rcd-db rcd-cf)
;; Keywords:
;; URL: https://gnu.support/gnu-emacs/packages/rcd-vcard.html
;; This file is not part of GNU Emacs.
;; This program is free software: you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation, either version 3 of the
;; License, or (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;; These are the RCD vCard functions
;;
;; RCD is acronym for Reach, Connect, Deliver, my personal
;; principle and formula for Wealth.
;;; Change Log:
;;; Code:
(require 'rcd-utilities)
(require 'rcd-db-init)
(require 'rcd-db)
(require 'rcd-cf)
(defvar *rcd-vcard-version* "2.1")
(defvar *rcd-vcard-output* "~/tmp/rcd-vcards/")
(defun rcd-vcard-jabber (xmpp)
(if (rcd-string-not-empty-p xmpp)
(format "X-JABBER:%s\nX-JABBER;WORK:%s\n" xmpp xmpp)
""))
(defun rcd-vcard-tel (tel &optional type)
(if (rcd-string-not-empty-p tel)
(let* ((type (or type "CELL"))
(type (upcase type)))
(format "TEL;%s:%s\n" type tel))
""))
(defun rcd-vcard-address (address1 city1 zip1 state1 country1 address2 city2 zip2 state2 country2)
(with-output-to-string
(princ "ADR;DOM;HOME;:")
(princ city1)
(princ ";")
(princ country1)
(princ "\n"))) ;; TODO
(defun rcd-vcard-phones (office mobile home other fax &optional other-2 other-3 other-4)
(with-output-to-string
(when office
(princ (rcd-vcard-tel office "WORK")))
(when mobile
(princ (rcd-vcard-tel mobile "CELL")))
(when home
(princ (rcd-vcard-tel home "HOME")))
(when other
(princ (rcd-vcard-tel other "OTHER")))
(when fax
(princ (rcd-vcard-tel fax "FAX")))
(when other-2
(princ (rcd-vcard-tel other-2 "OTHER")))
(when other-3
(princ (rcd-vcard-tel other-3 "OTHER")))
(when other-3
(princ (rcd-vcard-tel other-3 "OTHER")))))
(defun rcd-vcard-title (title)
(if (rcd-string-not-empty-p title)
(format "TITLE:%s\n" title)
""))
(defun rcd-vcard-organization (org &optional unit)
(if (rcd-string-not-empty-p org)
(let ((unit (or unit "")))
(format "ORG:%s;%s\n" org unit))
""))
;; (defun rcd-vcard-note (note)
;; (if (rcd-string-not-empty-p note)
;; (format "NOTE:ENCODING=BASE64;:%s\n" (base64-encode-string note))
;; ""))
(defun rcd-vcard-note (id note)
(with-output-to-string
;; (princ (format "NOTE;ENCODING=BIT8;:Contact ID %s; " id))
(princ (format "NOTE:Contact ID %s" id))
(if (rcd-string-not-empty-p note)
(princ (format "%s\n" "")) ;; place note instead of ""
"")))
(defun rcd-vcard-begin ()
(format "BEGIN:VCARD\nVERSION:%s\n" *rcd-vcard-version*))
(defun rcd-vcard-end ()
(format "END:VCARD\n"))
(defun rcd-vcard-email (email &optional type)
(if (rcd-string-not-empty-p email)
(let* ((type (or type "HOME"))
(type (upcase type)))
(format "EMAIL;%s:%s\n" type email))
""))
(defun rcd-vcard-url (url)
(if (rcd-string-not-empty-p url)
(format "URL:%s\n" url)
""))
(defun rcd-vcard-birthday (bday)
(if (rcd-string-not-empty-p bday)
(format "BDAY:%s\n" bday)
""))
(defun rcd-vcard-formatted-name (fn)
(if (rcd-string-not-empty-p fn)
(format "FN:%s\n" fn)
""))
(defun rcd-vcard-name (last &optional first middle prefix suffix)
(if (rcd-string-not-empty-p last)
(let ((first (or first ""))
(middle (or middle ""))
(prefix (or prefix ""))
(suffix (or suffix "")))
(format "N;CHARSET=UTF-8:%s;%s;%s;%s;%s;\n" last first middle prefix suffix))
""))
(defun cf-contact-geo-location (id)
(let* ((sql (format "SELECT locations_latitude, locations_longitude FROM locations WHERE locations_contacts = %s" id))
(geo (car (rcd-sql-list sql *cf*)))
(latitude (car geo))
(longitude (cadr geo)))
(if geo
(format "geo:%s,%s" latitude longitude)
nil)))
(defun rcd-cf-contact-vcard-list (id)
(let* ((hash (rcd-db-table-id-hash-values "people" id *cf*))
(prefix (gethash 'people_prefix hash))
(first (gethash 'people_firstname hash))
(middle (gethash 'people_middlenames hash))
(last (gethash 'people_lastname hash))
(suffix (gethash 'people_suffix hash))
(account (gethash 'people_account1 hash))
(company (gethash 'people_account2 hash))
(member (gethash 'people_account3 hash))
(title (gethash 'people_title hash))
(department (gethash 'people_department hash))
(birthday (gethash 'people_birthdate hash))
(office (gethash 'people_officephone hash))
(mobile (gethash 'people_mobilephone hash))
(home (gethash 'people_homephone hash))
(other (gethash 'people_otherphone hash))
(fax (gethash 'people_fax hash))
(email1 (gethash 'people_email1 hash))
(email2 (gethash 'people_email2 hash))
(email3 (gethash 'people_email3 hash))
(website (gethash 'people_website1 hash))
(blog (gethash 'people_website2 hash))
(address1 (gethash 'people_address1 hash))
(city1 (gethash 'people_city1 hash))
(zip1 (gethash 'people_zip1 hash))
(state1 (gethash 'people_state1 hash))
(country1 (gethash 'people_country1 hash))
(address2 (gethash 'people_address2 hash))
(city2 (gethash 'people_city2 hash))
(zip2 (gethash 'people_zip2 hash))
(state2 (gethash 'people_state2 hash))
(country2 (gethash 'people_country2 hash))
(note (gethash 'people_description hash))
(geo (cf-contact-geo-location id))
(geo (if geo (upcase geo) ""))
(contact (list prefix first middle last suffix account company member title department birthday office mobile home other fax email1 email2 email3 website blog address1 city1 zip1 state1 country1 address2 city2 zip2 state2 country2 note geo)))
(mapcar 'string-blank-nil contact)))
(defun rcd-cf-contact-vcard (id)
(let* ((contact (rcd-cf-contact-vcard-list id))
(full-name (cf-get-full-name id))
(vcard (rcd-vcard-begin))
(prefix (elt contact 0))
(first (elt contact 1))
(middle (elt contact 2))
(last (elt contact 3))
(suffix (elt contact 4))
(n (rcd-vcard-name last first middle prefix suffix))
(vcard (concat vcard n))
(fn (concat prefix " " first " " middle " " last " " suffix))
(fn (replace-regexp-in-string " +" " " fn))
(fn (rcd-vcard-formatted-name fn))
(vcard (concat vcard fn))
(account (elt contact 5))
(company (elt contact 6))
(member (elt contact 7))
(title (elt contact 8))
(department (elt contact 9))
(org (rcd-vcard-organization company department))
(vcard (concat vcard org))
(account-org (rcd-vcard-organization account "Account"))
(vcard (concat vcard account-org))
(member-org (rcd-vcard-organization member "Member"))
(vcard (concat vcard member-org))
(vcard (concat vcard (rcd-vcard-title title)))
(birthday (elt contact 10))
(vcard (concat vcard (rcd-vcard-birthday birthday)))
(office (elt contact 11))
(mobile (elt contact 12))
(home (elt contact 13))
(other (elt contact 14))
(fax (elt contact 15))
(phones (rcd-vcard-phones office mobile home other fax))
(vcard (concat vcard phones))
(email1 (elt contact 16))
(email2 (elt contact 17))
(email3 (elt contact 18))
(vcard (concat vcard (rcd-vcard-email email1)))
(vcard (concat vcard (rcd-vcard-email email2)))
(vcard (concat vcard (rcd-vcard-email email3)))
(website (elt contact 19))
(vcard (concat vcard (rcd-vcard-url website)))
(blog (elt contact 20))
(vcard (concat vcard (rcd-vcard-url blog)))
(address1 (elt contact 21))
(city1 (elt contact 22))
(zip1 (elt contact 23))
(state1 (elt contact 24))
(country1 (elt contact 25))
(address2 (elt contact 26))
(city2 (elt contact 27))
(zip2 (elt contact 28))
(state2 (elt contact 29))
(country2 (elt contact 30))
(address (rcd-vcard-address address1 city1 zip1 state1 country1 address2 city2 zip2 state2 country2))
(vcard (concat vcard address))
(note (elt contact 31))
(note (rcd-vcard-note id note))
(vcard (concat vcard note))
(geo (elt contact 32))
(geo (if geo (concat geo "\n") ""))
(vcard (concat vcard geo))
;;(vcard (concat vcard note))
(vcard (concat vcard (rcd-vcard-end))))
vcard))
(defun rcd-vcard-mobile-1 ()
"Exports all vCards for mobile phone #1"
(interactive)
(make-directory *rcd-vcard-output* t)
(let* ((ids (rcd-sql "SELECT addressbookentries_people FROM addressbookentries" *cf*)))
(string-to-file-force
(with-output-to-string
(dolist (id ids)
(princ (rcd-cf-contact-vcard id))))
(concat *rcd-vcard-output* "rcd-people.vcf"))))
(defun cf-contact-vcard-export (id)
"Export vCard for contact ID"
(let ((vcard (rcd-cf-contact-vcard id))
(file (format "%s%08d.vcf" *rcd-vcard-output* id)))
(string-to-file-force vcard file)
(message (concat "vCard exported to: " file))))
(provide 'rcd-vcard)
;;; rcd-vcard.el ends here
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: contact management in emacs
2021-02-28 9:06 ` Russell Adams
2021-02-28 11:09 ` Alan Schmitt
2021-03-03 14:40 ` TRS-80
@ 2021-03-07 22:57 ` Jean Louis
2021-03-08 20:06 ` John Kitchin
2 siblings, 1 reply; 33+ messages in thread
From: Jean Louis @ 2021-03-07 22:57 UTC (permalink / raw)
To: emacs-orgmode
* Russell Adams <RLAdams@AdamsInfoServ.Com> [2021-02-28 12:07]:
> The only reason I don't use BBDB is I want to use Org to allow me to
> maintain notes about contacts (ie: CRM). Yes, I get that I could have
> a CRM file and link in BBDB contacts, but that feels like adding
> layers.
I have replaced using Org file as the central system with the `people`
database as the central system. This may sound confusing. Instead of
using exclusively Org file, I am using the database and addint notes
to people in the database. A note can have any major or minor mode,
thus it could be text or Org file or markdown file, enriched mode or
restructured text, asciidoc, or similar.
My workflow is to find the person first, then press N to see notes, or
M-n to create a new note. Concepts I am explaining may serve some
people to create their own workflows.
Using database for that allows easily collaboration in real time with
other team members and inclusion or insertion of new contacts during
marketing activities without interruption. Org files are not suitable
for such collaborative updates.
> The stumbling point for me has been exporting to my mobile phone. I'm
> fine with a one way sync from my BBDB/Org solution to the phone, but
> I feel like I never found a good option.
bbdb-vcard package is here:
https://melpa.org/packages/bbdb-vcard-20201016.1902.tar
Jean
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: contact management in emacs
2021-03-07 22:13 ` Jean Louis
@ 2021-03-08 7:49 ` Alan Schmitt
2021-03-08 8:12 ` Jose E. Marchesi
0 siblings, 1 reply; 33+ messages in thread
From: Alan Schmitt @ 2021-03-08 7:49 UTC (permalink / raw)
To: Jean Louis; +Cc: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 394 bytes --]
Hello,
On 2021-03-08 01:13, Jean Louis <bugs@gnu.support> writes:
> I am recommending that you start using PostgreSQL database. I can
> guide you. My software is not so finished for public, but I can guide
> you personally and you will get stable system that lasts for years.
Thank you for the suggestion, but for the moment I think I will
experiment with text-based solutions.
Best,
Alan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 528 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: contact management in emacs
2021-03-08 7:49 ` Alan Schmitt
@ 2021-03-08 8:12 ` Jose E. Marchesi
2021-03-10 8:32 ` Jean Louis
0 siblings, 1 reply; 33+ messages in thread
From: Jose E. Marchesi @ 2021-03-08 8:12 UTC (permalink / raw)
To: Alan Schmitt; +Cc: emacs-orgmode, Jean Louis
>> I am recommending that you start using PostgreSQL database. I can
>> guide you. My software is not so finished for public, but I can guide
>> you personally and you will get stable system that lasts for years.
>
> Thank you for the suggestion, but for the moment I think I will
> experiment with text-based solutions.
I use a recfile [1] to manage contacts.
[1] http://www.gnu.org/s/recutils
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: contact management in emacs
2021-03-07 22:57 ` Jean Louis
@ 2021-03-08 20:06 ` John Kitchin
2021-03-10 8:32 ` Jean Louis
0 siblings, 1 reply; 33+ messages in thread
From: John Kitchin @ 2021-03-08 20:06 UTC (permalink / raw)
To: Jean Louis; +Cc: emacs-orgmode
This question is going to go a little off the original topic. I wonder
how far you can push your model of replacing the org-file with a
database. It looks like it would be easy to extend to something like a
shared bibliography.
How far could you push it for something like a shared set of documents,
e.g. a shared notebook on a project? How feasible would it be to access
tables or src blocks in these if they were in a database? or to build an
agenda from entries in the database?
Jean Louis <bugs@gnu.support> writes:
> * Russell Adams <RLAdams@AdamsInfoServ.Com> [2021-02-28 12:07]:
>> The only reason I don't use BBDB is I want to use Org to allow me to
>> maintain notes about contacts (ie: CRM). Yes, I get that I could have
>> a CRM file and link in BBDB contacts, but that feels like adding
>> layers.
>
> I have replaced using Org file as the central system with the `people`
> database as the central system. This may sound confusing. Instead of
> using exclusively Org file, I am using the database and addint notes
> to people in the database. A note can have any major or minor mode,
> thus it could be text or Org file or markdown file, enriched mode or
> restructured text, asciidoc, or similar.
>
> My workflow is to find the person first, then press N to see notes, or
> M-n to create a new note. Concepts I am explaining may serve some
> people to create their own workflows.
>
> Using database for that allows easily collaboration in real time with
> other team members and inclusion or insertion of new contacts during
> marketing activities without interruption. Org files are not suitable
> for such collaborative updates.
>
>> The stumbling point for me has been exporting to my mobile phone. I'm
>> fine with a one way sync from my BBDB/Org solution to the phone, but
>> I feel like I never found a good option.
>
> bbdb-vcard package is here:
> https://melpa.org/packages/bbdb-vcard-20201016.1902.tar
>
> Jean
--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: contact management in emacs
2021-03-08 20:06 ` John Kitchin
@ 2021-03-10 8:32 ` Jean Louis
0 siblings, 0 replies; 33+ messages in thread
From: Jean Louis @ 2021-03-10 8:32 UTC (permalink / raw)
To: John Kitchin; +Cc: emacs-orgmode
* John Kitchin <jkitchin@andrew.cmu.edu> [2021-03-08 23:06]:
> This question is going to go a little off the original topic. I wonder
> how far you can push your model of replacing the org-file with a
> database.
Those functions which I use most often I can fully replace with the
database work. The visual stuff is handled by tabulated-list-mode, so
I cannot currently see the contents of a simple heading unless I press
a key. But I am sure that database based Org style editing is possible
in general.
What I mean is that one could have an Org file displayed but
internally all of its structures could be translated on the fly into
the database. This would allow collaboration with many users and
finely based version control of each elements of the structure.
I think that automatic update and version control of each contents of
a heading could be saved to database, or it could be saved to database
by using key or by switching from one heading to other heading.
If user switches to other heading, would that other heading be edited
by other user in the same time, that other heading could be
automatically updated.
I was making simple functions to move Org headings into the database,
and functions to move database entries into Org files on the fly.
IMHO, what Org does is either intentionally or not intentionally, or
mixed-wise related to Doug Engelbart's work.
TECHNOLOGY TEMPLATE PROJECT OHS Framework
https://www.dougengelbart.org/content/view/110/460/
> This question is going to go a little off the original topic. I wonder
> how far you can push your model of replacing the org-file with a
> database.
After that introduction, and I hope you understand what I wrote (as I
am not sure if I have expressed myself well enough), then I can answer
how far it may be pushed. I have defined in my software Hyperscope
that each node can have different type. All nodes have its ID
numbers. So now I could say that nodes have various finely grained
types such as:
- Subtree (This could be considered either heading or title in Org
editing), it contains other nodes.
- headings or subtrees within subtree are similar to sub-headings in
Org editing
- I can define Org Babel-like nodes, for example now I have SQL
output, I can enter SQL SELECT and get the report. That type of node
definition is alternative to Org Babel. I did not work much on it,
but it is not hard to define. As soon as the node type is defined,
inside of the node type there could be defined, even inside of the
database, on how to run or execute that code block. Right now I am
hardcoding that.
- then I can go finely grained, I could say: this node is
paragraph. But I need not do that.
- then I could go more finely grained, I could say this node is a list
of items, but I could also say this node is one item within a list.
- I could say this is one line as node, or this is one sentence as
node.
- I could say this is one word within a sentence.
That means I can defined "Elementary objects" as defined here:
https://www.dougengelbart.org/content/view/110/460/#2a1a
Objects are basic content packets of an arbitrary, user and developer
extensible nature. Types of elementary objects could contain text,
graphics, equations, tables, spreadsheets, canned-images, video,
sound, code elements, etc.
Now you can imagine that those paragraphs could be reused in various
Org files, reusing such paragraphs becomes trivial. There is no copy
and paste any more, just one time definition where some paragraph
shall be inserted:
- edit subtree of nodes
- decide where to insert some other existing node
- insert it and forget about it
This then allows editing of the subtree (Org equivalent) node A or
node B, and each time that paragraph is edited it is also changed in
the other subtree. Copying subtrees so that they do not synchronize is
naturally possible.
Finely grained definition of nodes allows for finely grained
referencing to those nodes what is currently not possible with Org
mode. I have researched that option.
Review this page: https://www.dougengelbart.org/content/view/110/460/
and you will see how each paragraph is finely referenced on that
page. Specific referencing enhances educational capabilities in
specialization on specific subject. It saves times, efforts, also a
lot of money.
Imagine group of 20 miners and their 3 administrators who are supposed
to work on a lead mine, they did finish their general education, but
now they are faced with specialized subject of "lead mining". Having a
very precise set of references to lead mining saves money, as
education of miners and administrators is paid in their salaries, if
they are reading irrelevant instructions or if they are offered whole
books to read and find references themselves, that would spend 20
times plus 3 times more money for their time to gain that special
knowledge. Having a finely grained set of references that has to be
read by those specific people specializes those people to the specific
subject of knowledge quickly and efficiently, they can get only
information that relates to galena as mineral, melting, refining,
collecting of galena and processing of it.
Fine referencing thus helps in research and education and other
subjects.
To index bodies of knowledge is not so hard with computerized
information. Once index is made, such index contains the subject, for
example "galena". By using larger index, one can then form and curate
a subtree or heading of nodes and use that heading for education to
specialize miners in a specific subject.
Indexing and converting to Org file is possible, then if one does not
work with database, one can still select those headings that relate to
specific subject with Emacs functions and then copy and paste those
specific headings into a new file.
But what if any node is changed either in the new file or the main
index? They are not automatically synchronized. Database backed
editing allows automatic synchronization. Or nodes may be made
separate by duplicating them.
It also allows instead of creating a new subtree, to create just a
result based on query and exclude/include some other lines and create
new Org file with those entries for later research. Org file can be
converted to PDF and distributed to people.
> It looks like it would be easy to extend to something like a shared
> bibliography.
I wish I could understand better what you mean with shared
bibliography. Explain me better.
As side notes to bibliography subject, in the table of nodes I have
included some basic bibliographic entries, but not all, I have not
been thinking enough of that. I do use it for finely grained personal
bibliographic collection of hyperlinks and hyperdocuments and now I
have more than 20000 items, mostly PDF files with references to
articles inside of PDF file, their titles and similar. It is like
index of indexes. Subtrees or all system can be converted to Org files
on the fly and saved if necessary, but there is much work to make it
more detailed and nice, well hyperlinked.
Table `hlinks' should be maybe called hyperdocuments, but I chose this
name for now, has the following structure:
hlinks_id
hlinks_datecreated
hlinks_datemodified
hlinks_usercreated
hlinks_usermodified
hlinks_hlinkstatuses
hlinks_date
hlinks_expiration
hlinks_curator
hlinks_hlinktypes
hlinks_mimetypes
hlinks_name
hlinks_link
hlinks_arguments
hlinks_description
hlinks_text
hlinks_tags
hlinks_parent
hlinks_author
hlinks_hlinkpermissions
hlinks_revision
hlinks_numberofpages
hlinks_language
hlinks_filesize
hlinks_timelength
hlinks_width
hlinks_height
hlinks_hash
hlinks_signature p
hlinks_pages
hlinks_accounts
hlinks_people
hlinks_businesses
hlinks_opportunities
hlinks_priorities
hlinks_authorname
hlinks_properties
hlinks_elisphash
hlinks_publisher
hlinks_groups
hlinks_groupassigned
hlinks_assignedperson
hlinks_rank
hlinks_active
hlinks_actionstatuses
hlinks_globalpriority
hlinks_relatedfile
The nature of the database is collaborative. Adding new users and
allowing users finely grained access is possible. Users could edit
either all tables and fields, or just some tables and fields. Those
features are handled by the database and configuration, not by users'
run program (as otherwise user could circumvent it).
Users could access the database from any distant location and edit
nodes. Output could be Org file or any other output, but using Org
file as output is beneficial as Org itself has many various other
export formats.
This type of work is not well suitable for collaborative real time
online editing. However, it is suitable for concurrent non-real time
editing of any items.
For example, user A could designate new scheduled time, but user B
could change the scheduled time to something else. All changes can be
inside of the database backed version control to see who changed what
at which time. It is suitable for collaborative business or
organization work. Marketing, sales, communications, notes, anything
is possible when collaboration takes place.
Example workflow could be:
- manager views Org file of customer Joe
- assign customer Joe to salesman Jane
- salesman Jane calls customer and makes notes on customer Joe
- manager is notified of note visualized in Org file, it seem like
customer Joe was handled in past better by salesman Juan
- manager schedules call to customer Joe by Juan at Tuesday 10 o'clock
- Juan calls customer at 10:30 Tuesday and closes the sale, invoice is
generated
- all parties, manager, salesmen Jane and Juan can view what has taken
place, visualization can take place as Org file
By using the package `crdt' from
https://code.librehq.com/qhong/crdt.el.git one can involve online
real-time collaboration of a single item. This works right now with
Org mode.
Each node of the database system could be edited with `crdt-mode'
enabled if one requires real time online collaboration.
> How far could you push it for something like a shared set of documents,
> e.g. a shared notebook on a project?
Each node is considered elementary object. There are no files. But
each node can be exported into a file.
As it is database backed, it is already shared notebook. Each subtree
can be considered Org file or Mixed-Object documents as defined by
Engelbart institute.
> How feasible would it be to access tables or src blocks in these if
> they were in a database?
Just as easy:
- concurrent updates, additions and deletions are possible with the
automated database backed version control (no thinking).
- real time online collaborative editing is possible with `crdt'
package for single entries
- editing any entry, any node in the database can be done by any
mode, not just Org mode. If I define the type of the node to be Org
type, then editing switches to Org mode and I can edit the tables by
using Org mode. When saved, table is saved in the database, but can
be if user wish and want, be also each time saved into the file as
full Org or single node.
- src blocks I mostly constuct from SQL select statements, so they
contain SQL, and I have implemented node with SQL, so I just put SQL
statement there, it provides the report just as Org babel. It is not
hard to implement any language and get literate programming
functions.
Similar node based editing is provided by Leo editor, also inspired by
Org and other similar systems.
Leo programmable editor
http://leoeditor.com/
> or to build an agenda from entries in the database?
It is simple to provide agenda from entries in the database then from
entries in multiple Org files.
- each elementary object can have assigned "ACTION" at my side. Each
assignement of ACTION is recorded with date/time/username, each
COMPLETED designation is also recorded, each removal of designation
is also recorded. One can know in future which items were actionable
in past and which items were completed in past or maybe completed
and then again assigned as actionable. This is currently not a
feature in Org file. One could know that by editing Org file with
file system version control. Single user without file system version
control cannot know if some headings had TODO in past and now they
do not have it.
- each item may be or may be not assigned to specific person. All
people are in the database. So choice of people comes from the
database itself. Assignment to specific person is recorded with
date/time/username and deletion of assignment is recorded,
modification is recorded automatically. This way it is possible to
see which task was assigned to whom.
- agenda thus may be managed centralized for many people, or by people
decentralized. Tasks may sent to assigned person with keys like "s
a", either one task, or all tasks at once. Reminders can be
programmed with various communication lines, including automated
phone calls, SMS, emails, faxes, letters or visual reminders on
computer, or printouts for dispatch.
- that allows collaborative based agenda, it is possible to list items
assigned to person Joe, or person Jane, Joe may insert his own
items, Jane may insert her own items, both Joe and Jane could see
each other items, or finely grained permissions could be defined
(database backed). Manager who is neither Joe or Jane could see all
the items, regardless where users are located in the world. Access
to the database could be through Org extensions, or through software
I am making, or through other software from various
devices. Software is independent of the database entries.
Special table collects information such as SCHEDULED, DEADLINE,
CLOCK-IN, CLOCK-OUT, ACTION, COMPLETED, ACTION-REMOVED. This table
may add different other timestamps by their types. So each node can
receive any of those timestamps.
It is then trivial to add new timestamp or find the difference between
CLOCK-IN, CLOCK-OUT, to list items by SCHEDULED or DEADLINES, or past
DEADLINES.
Your questions gave me to thinking that I should make some basic
functions:
- when editing Org mode, to easily insert database entry from
Hyperscope system so that the entry can be edited in a file itself,
and automatically updated in the database when file is saved, or
special command invoked, or user switched to other heading
- inserting of such item from database entry would make Org
properties, such as HOSTNAME, DATABASE used, (username, passwords
could be externally saved), TABLE, COLUMN in the table and TABLE
ID.
- then an extension function to Org would need to check if there is
some database entry like that, so that saving of the file or
invocation of that function finds the entry and updates it to the
remote database. Database could be local or remote.
- if another user on other part of the world wish to insert or edit
that Org entry, that user would get the updated version
With above extensions, user would still be editing file, it could be
saved file, file on the disk, but the database entries would be
updated either from the database or to the database in the
background and without interruptions to user.
Multiple users could then edit the Org files, which would get updated
on each new opening of a file or the invocation of a function.
This then limits entries to Org mode, while my entries are now in any
mode. I have enriched mode notes or Org type notes in the database, or
markdown nodes, or anything. When markdown note is viewed,
markdown-mode is invoked, when Org type node is viewed in Emacs, then
Org mode is invoked in read only mode.
The list of defined nodes that I have now available are:
Possible completions are:
1 File 10 Directory 11 Launch Program
12 Media 13 Info Node 14 PDF
15 HyperScope ID 16 PDF Query 17 Org Heading
18 Org 19 PDF by Page Nr. 2 WWW
20 DJVU 21 Video 22 Message-ID
23 WRS Page Annotation 24 Directory Action ➜ 25 Shell Command
26 Self 27 Action
29 FOLLOW-UP 3 MPV play video at exact time 30 aMule
31 Task 32 Password 33 PostgreSQL
34 Markdown 35 Paraset 36 Enriched
37 txt2tags 38 EPUB 4 Local File
5 Set ➜ 6 YouTube Video at exact time 7 YouTube Video
8 Emacs Lisp 9 Note
There are no limits to what a node can look like. Each node can be a
note in itself, even if it is a file, there can be note for the file,
number 28. I have deleted not to confuse people. Password is maybe
encrypted in the database, directory action has similar meaning like
in Hyperbole package where file ~/tmp/.hyperscope may contain this:
(hyperscope-directory-action 35243)
and the node ID 35243 decides which directory actions relate to
directory ~/tmp and then window splits with options from the database
such as maybe to read some notes related to directory, or remove all
docview directories or to remove all GIF files in ~/tmp - the idea
comes from Hyperbole package that has similar feature.
People in the database may be assigned specific subtrees or Org files
or nodes, so by finding person one can find the notes, tasks,
assignments, related to people.
At export to Org file, those nodes that are not compatible to Org file
such as Markdown, txt2tags, video, would be exported as separate file
and such file would be hyperlinked from the main Org file similar to
what is defined here:
https://www.dougengelbart.org/content/view/110/460/#2a1b
Complete exported package could then be dispatched onto DVD rom, USB
stick, sent by email or uploaded. Org file can be used in similar
fashion as MIME to define on higher level collection of various
documents.
As my goal is not to provide all features to users, but to use
Hyperscope, that is why my development goes slow and is not yet
available to public. I would need to verify many functions before it
becomes public software. But for individuals interested, I am willing
to help one on one to create the database and provide systems I am
using.
Jean
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: contact management in emacs
2021-03-08 8:12 ` Jose E. Marchesi
@ 2021-03-10 8:32 ` Jean Louis
0 siblings, 0 replies; 33+ messages in thread
From: Jean Louis @ 2021-03-10 8:32 UTC (permalink / raw)
To: Jose E. Marchesi; +Cc: Alan Schmitt, emacs-orgmode
* Jose E. Marchesi <jemarch@gnu.org> [2021-03-08 11:12]:
>
> >> I am recommending that you start using PostgreSQL database. I can
> >> guide you. My software is not so finished for public, but I can guide
> >> you personally and you will get stable system that lasts for years.
> >
> > Thank you for the suggestion, but for the moment I think I will
> > experiment with text-based solutions.
>
> I use a recfile [1] to manage contacts.
Please send some samples of how it looks like.
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: contact management in emacs
2021-02-27 11:08 contact management in emacs Alan Schmitt
` (3 preceding siblings ...)
2021-03-07 22:13 ` Jean Louis
@ 2022-09-09 16:11 ` Sébastien Rey-Coyrehourcq
2022-09-10 5:46 ` Ihor Radchenko
2022-10-09 10:40 ` SQLite for contacts and relations to Org - " Jean Louis
4 siblings, 2 replies; 33+ messages in thread
From: Sébastien Rey-Coyrehourcq @ 2022-09-09 16:11 UTC (permalink / raw)
To: Alan Schmitt, emacs-orgmode
Hi,
After some search today on the web, like Alan i try to compare all
possibility to manage my contact + mail using emacs, mu4e, and org.
Since Alan Schmitt message, i think many people jump into the great
*org-roam* wagon to manage notes, bibliography, links, everything...
I'm into this *crazy* wagon, trying now to manage contact, with this
workflow :
- one file/node by contact,
- stored into the org-roam specific folder "/myorgroamfolder/contact/
with this encrypted org pattern to protect files "*.org.gpg"
- using into mu4e
There are some post exploring part of this use case on the web, but i
first focus to *org-contacts*, because it's well integrated with mu4e
auto-completion :
Moving from org-contrib to https://repo.or.cz/org-contacts.git ,
accessible with melpa, the documentation is mostly into the source-code
actually, i found few example on the web .
What property field are correct :MOBILE:, :PHONE:, :BIRTHDAY: , and ?
I found some information about configuration in Terencio Agozzino
dotfiles (https://github.com/rememberYou/.emacs.d) but when i try to
adapt to this use case,
that don't work, probably because i misunderstand something, about
properties name, or localization into the .org.gpg files.
I config like that (org-contacts-file (file-expand-wildcards
"~/my-org-roam-folder/contact/*.org.gpg))
It's slow because everything need to be unencrypted before (this is
another problem ...) but something i don't understand is how matching
work :
calling "M-x org-contacts", i try multiple patterns, so i'm interested
by a working org/org-roam contact example.
I found some alternatives to test next week :
- org-vcard (on github) compatible with org-contacts, focusing on
import/export of vcard files
- mu4e-contacts (on gitlab) using helm / mu4e, inspired by org-contacts
- org-ql query ?
Best,
Sebastien R.C
Le 27/02/2021 à 12:08, Alan Schmitt a écrit :
> Hello,
>
> This may be slightly off-topic for the list, but as I’m considering
> org-contacts for my question, I hope it will be of interest here.
>
> I would like to migrate my contact management to emacs, as I’m already
> using it for email. My requirements are the following ones:
> - address completion in emacs email clients (I currently use notmuch)
> - support for multiple email addresses and custom fields
> - creation of org links to contacts
> - export to vcard format for synchronization to my mobile phone (using
> vdirsyncer)
> - keep the data under version control
>
> I have looked at two tools, which almost seem fit for the job.
> - ebdb does most of this, with the exception of vcard export (it seems
> to be worked on, https://github.com/girzel/ebdb/issues/60), and I’m not
> sure using version control on an sqlite file is a good idea.
> - org-contacts also seem to have all the required features, including
> vcard export (and if not sufficient there is
> https://github.com/novoid/org-contacts2vcard). I was worried it was
> unmaintained when looking at the copyright line, but I see in
> https://code.orgmode.org/bzg/org-mode/commits/master/contrib/lisp/org-contacts.el
> that there are recent commits to the file.
>
> Do you manage your contacts in emacs? And if so, what tools or workflow
> do you recommend?
>
> Best,
>
> Alan
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: contact management in emacs
2022-09-09 16:11 ` Sébastien Rey-Coyrehourcq
@ 2022-09-10 5:46 ` Ihor Radchenko
2022-10-09 10:40 ` SQLite for contacts and relations to Org - " Jean Louis
1 sibling, 0 replies; 33+ messages in thread
From: Ihor Radchenko @ 2022-09-10 5:46 UTC (permalink / raw)
To: sebastien.rey-coyrehourcq; +Cc: Alan Schmitt, emacs-orgmode
Sébastien Rey-Coyrehourcq <sebastien.rey-coyrehourcq@univ-rouen.fr>
writes:
> Moving from org-contrib to https://repo.or.cz/org-contacts.git ,
> accessible with melpa, the documentation is mostly into the source-code
> actually, i found few example on the web .
>
> What property field are correct :MOBILE:, :PHONE:, :BIRTHDAY: , and ?
First, remember that org-contacts is built on top of generic Org
search.
org-contacts.el considers Org headline to be a contact record when it
contains any of
org-contacts-email-property
org-contacts-alias-property
org-contacts-tel-property
org-contacts-address-property
org-contacts-birthday-property
properties.
All the variables can be changed to your preference.
> I config like that (org-contacts-file (file-expand-wildcards
> "~/my-org-roam-folder/contact/*.org.gpg))
>
> It's slow because everything need to be unencrypted before (this is
> another problem ...) but something i don't understand is how matching
> work :
> calling "M-x org-contacts", i try multiple patterns, so i'm interested
> by a working org/org-roam contact example.
M-x org-contacts does a simple regexp matching across contacts.
If you want integration with org-roam, you may probably want a custom
org-roam matches equivalent to org-contacts-matcher.
There is also M-x org-contacts-completing-read
For the slowness of opening the contacts, you may consider doing
M-x profiler-start .. M-x profiler-report to see what exactly is being
slow.
> I found some alternatives to test next week :
>
> - org-vcard (on github) compatible with org-contacts, focusing on
> import/export of vcard files
> - mu4e-contacts (on gitlab) using helm / mu4e, inspired by org-contacts
> - org-ql query ?
org-ql may be an option though it works best for a single large Org
file. You may have better luck using org-roam built-in search. I think
that the most straightforward way to integrate with org-roam would be
adding a "contact" tag to your contact records and then using the
standard org-roam search.
Hope it helps.
--
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92
^ permalink raw reply [flat|nested] 33+ messages in thread
* SQLite for contacts and relations to Org - Re: contact management in emacs
2022-09-09 16:11 ` Sébastien Rey-Coyrehourcq
2022-09-10 5:46 ` Ihor Radchenko
@ 2022-10-09 10:40 ` Jean Louis
2022-10-09 15:21 ` Quiliro Ordóñez
2022-10-11 5:54 ` Sébastien Rey-Coyrehourcq
1 sibling, 2 replies; 33+ messages in thread
From: Jean Louis @ 2022-10-09 10:40 UTC (permalink / raw)
To: Sébastien Rey-Coyrehourcq; +Cc: Alan Schmitt, emacs-orgmode
* Sébastien Rey-Coyrehourcq <sebastien.rey-coyrehourcq@univ-rouen.fr> [2022-09-09 19:12]:
> Hi,
>
> After some search today on the web, like Alan i try to compare all
> possibility to manage my contact + mail using emacs, mu4e, and org.
I will describe you how to manage contacts with Emacs in the reverse
example reverse of what org-contacts tries to do for you.
Org contacts try to keep people in Org file. Emacs 29 has a built-in
SQLite database which allows every Emacs user to keep information in
ordered, structured manner in the relational database.
For people who do not use latest development Emacs version, there are
SQLite Emacs packages that allow immediate usage of file based
single-user access database, see https://www.sqlite.org
In Emacs 29, here is how I create the SQLite database, or open the existing one:
(setq my-db (sqlite-open "~/my-people"))
This is database handle:
my-db ⇒ #<sqlite db=0x55987eb7d4a0 name=/home/data1/protected/my-org-properties>
This is how to create a table of `people' in the database. The
structure of the table `people' is thus pretty much individual,
one can record any kind of entries and be sure if the the entry
is there or not. It does not allow vague guessing with text files
like in Org or Hyrolo in Hyperbole.
This is example table, one can build upon it. This one contains emails only.
(sqlite-execute my-db "CREATE TABLE people1 (people_id INTEGER PRIMARY KEY,
people_firstname TEXT,
people_middlenames TEXT,
people_name TEXT NOT NULL DEFAULT '>>>UNKNOWN<<<',
people_email TEXT,
people_description TEXT)")
This is how to get all queries from the table:
(sqlite-select my-db "SELECT * FROM people") ⇒ nil
This is how to insert new entry programmatically:
(sqlite-execute my-db "INSERT INTO people (people_firstname, people_name, people_email)
VALUES (?, ?, ?)
RETURNING people_id"
'("Robert" "Weiner" "rsw@gnu.org"))
Get information back from database, programmatically. Do with information what you wish.
(sqlite-select my-db "SELECT * FROM people") ⇒ ((1 "Robert" nil "Weiner" "rsw@gnu.org" nil) (2 "Robert" nil "Weiner" "rsw@gnu.org" nil))
Delete everything in the database.
(sqlite-execute my-db "DELETE FROM people") ⇒ 0
;; Backup?
Backup database by simple copy of the file "~/my-people"
(sqlite-select my-db "SELECT * FROM people") ⇒ nil
Make nicer function to add new people:
(defun my-people-add ()
(interactive)
(let* ((first-name (read-string "First name: "))
(middle-names (read-string "Middles names: "))
(name-or-last-name (let ((result))
(while (not result)
(setq result (apply 'read-string '("Last name: "))))
result))
(email (read-string "Email: "))
(description (read-string "Description: ")))
(sqlite-execute my-db "INSERT INTO people (people_firstname, people_middlenames, people_name, people_email, people_description)
VALUES (?, ?, ?, ?, ?) RETURNING people_id"
(list first-name middle-names name-or-last-name description))))
Run the function by using (my-people-add) or M-x my-people-add
Verify that person was added:
(sqlite-select my-db "SELECT * FROM people") ⇒ ((1 "Joe" "" "Doe" nil nil))
Entries are returned as list, get the first list entry:
(caar (sqlite-select my-db "SELECT people_id FROM people WHERE people_id = 1")) ⇒ 1
My database structure is ALWAYS as so that for TABLE I always
have primary key named TABLE_id. That principle allows to
simplify things.
Then I can make generic function to fetch from database DB, from
TABLE and COLUMN by using ID:
(defun sqlite-db-get-entry (table column id db)
"Return value for the TABLE, COLUMN, ID from the database PG."
(let* ((sql (format "SELECT %s FROM %s WHERE %s_id = %s" column table table id))
(value (caar (sqlite-select db sql))))
value))
(sqlite-db-get-entry "people" "people_id" 1 my-db) ⇒ 1
(sqlite-db-get-entry "people" "people_name" 1 my-db) ⇒ "Doe"
(sqlite-db-get-entry "people" "people_email" 1 my-db) ⇒ "joe@example.com"
Make it exportable to Org:
(defun my-people-to-org-single (id)
(let* ((first-name (sqlite-db-get-entry "people" "people_firstname" id my-db))
(middle-names (sqlite-db-get-entry "people" "people_middlenames" id my-db))
(last-name (sqlite-db-get-entry "people" "people_lastname" id my-db))
(email (sqlite-db-get-entry "people" "people_email" id my-db))
(description (sqlite-db-get-entry "people" "people_description" id my-db))
(heading (list first-name middle-names last-name))
(heading (mapcar (lambda (e) (cond ((seq-empty-p e) nil)
(t e)))
heading))
(heading (delq nil heading))
(heading (concat "* " (string-join heading " ") "\n\n"))
(text (with-temp-buffer
(when (and email (> (length email) 0))
(insert (concat "E-mail: " email "\n\n")))
(when (and description (> (length description) 0))
(insert description))
(buffer-string))))
(concat heading text "\n\n")))
(my-people-to-org-single 1) ⇒ "* Joseph Joe
E-mail: joe@example.com
This is just a sample description
"
What if we have multiple people like "Joe Doe"? Then each will
have its unique ID by which we have to be able to choose them.
One approach is to add on the name a bracketed ID number, like:
"Joe Doe [1]"
"Joe Doe [2]"
Another approach is to add various other attributes to make the
entry distinguishable in completions:
"Joe Doe, Ukraine [1]"
"Joe Doe, Russia [2]"
"Joe Doe, USA [3]"
"Joe Doe, Emacs Users [4]"
To cut the ID from the bracket on the end, following function does it:
(defun rcd-get-bracketed-id-end (s)
"Return the ID number in string S from within first brackets on its
end. For example it would return 123 from `Some string [123]'"
(let* ((match (string-match "\\[\\([[:digit:]]*\\)\\][[:space:]]*$" s)))
(when match
(string-to-number
(substring-no-properties s (match-beginning 1) (match-end 1))))))
Let us make generic function that expects bracketed ID and
completes by SQL. This function could be better of course, this
is example:
(defun my-completing-id-by-sql-end (prompt sql db)
"Return the ID as by finding [ID:123] on the end.
Argument PROMPT will be displayed to user.
Argument SQL is supplied query.
Argument PG is database handle."
(let* ((selection (sqlite-select db sql))
(choice (completing-read prompt selection)))
(rcd-get-bracketed-id-end choice)))
Let us now use that generic function to get a completion list:
(defun my-people-completion-list ()
(let ((sql "SELECT coalesce(CASE WHEN people_firstname IS NOT NULL
AND length(people_firstname) > 0
THEN people_firstname || ', '
END, '') ||
coalesce(CASE WHEN people_middlenames IS NOT NULL
AND length(people_middlenames) > 0
THEN people_middlenames || ', '
END, '') ||
people_name || ' [' || people_id || ']' FROM people"))
(sqlite-select my-db sql)))
And here is how completion list looks like:
(my-people-completion-list) ⇒ (("Joe, Doe [1]"))
Here is the function to choose person among people and return it's ID:
(defun my-people-complete ()
"Return person's ID."
(let ((my-people (my-people-completion-list)))
(cond (my-people (rcd-get-bracketed-id-end (completing-read "Choose person: " my-people)))
(t (error "No people in database")))))
(my-people-complete) ⇒ 1
Let us get list of all columns in SQLite table:
(defun my-sqlite-table-column-list (table)
"From: https://stackoverflow.com/questions/604939/how-can-i-get-the-list-of-a-columns-in-a-table-for-a-sqlite-database"
;; (sqlite-select my-db "SELECT name FROM PRAGMA_TABLE_INFO(?)" (list table)))
(mapcar 'cadr
(sqlite-select my-db "
SELECT
m.name as tableName,
p.name as columnName
FROM
sqlite_master m
LEFT OUTER JOIN pragma_table_info((m.name)) p ON m.name <> p.name
WHERE
m.type IN ('table', 'view')
AND m.name NOT LIKE 'sqlite_%'
AND m.name = ?
ORDER BY
tableName,
columnName" (list table))))
(my-sqlite-table-column-list "people") ⇒ ("people_description" "people_email" "people_firstname" "people_id" "people_middlenames" "people_name")
Let us make function to get full person's name.
- people_firstname can be empty, what if it is empty, it should not be displaed
- people_middlename should be in the middle, but could be empty
- people_name represents either last name or company name or
group name, business name, list of people, etc. It must be
there.
(defun my-people-name (id)
(caar (sqlite-select my-db "SELECT coalesce(CASE WHEN people_firstname IS NOT NULL
AND length(people_firstname) > 0
THEN people_firstname || ' '
END, '') ||
coalesce(CASE WHEN people_middlenames IS NOT NULL
AND length(people_middlenames) > 0
THEN people_middlenames || ' '
END, '') ||
people_name
FROM people
WHERE people_id = ?"
(list id))))
(my-people-name 1) ⇒ "Joseph Joe Doe"
Now function to edit people by their ID programmatically or
interactively by choice:
(defun my-people-edit (&optional id)
(interactive)
(let ((id (or id (my-people-complete)))
(columns (my-sqlite-table-column-list "people")))
(cond (id (let ((column-to-edit (completing-read "Which column to edit? " columns nil t)))
(cond ((member column-to-edit columns) (let* ((initial-input (sqlite-db-get-entry "people" column-to-edit id my-db))
(edited-entry (read-string (format "Edit `%s': " column-to-edit) initial-input nil initial-input)))
(unless (string= initial-input edited-entry)
(sqlite-execute my-db (format "UPDATE people SET %s = ? WHERE people_id = ?" column-to-edit)
(list edited-entry id)))
(my-people-edit id)))
(t (message "No column choosen")))))
(t (message "No person selected for editing")))))
(sqlite-select my-db "SELECT * FROM people") ⇒ ((1 "Joseph" "Joe" "Doe Junior" "joe@example.com" "This is just a sample description"))
;; Delete entry
Now let us make possibility to delete single entries:
(defun my-people-delete (&optional id)
(interactive)
(let* ((id (or id (my-people-complete)))
(name (my-people-name id)))
(when (y-or-n-p (format "Do you wish to delete entry `%s'? " name))
(sqlite-execute my-db "DELETE FROM people WHERE people_id = ?" (list id))
(message "Deleted entry `%s'" name))))
(sqlite-select my-db "SELECT * FROM people") ⇒ nil
Add again:
(my-people-add)
Select from database again:
(sqlite-select my-db "SELECT * FROM people") ⇒ ((1 "Joseph" "joe" "Doe" nil nil))
Edit the entry
(my-people-edit) or M-x my-people-edit
(sqlite-select my-db "SELECT * FROM people") ⇒ ((1 "Joseph" "Joe" "Doe" "joe@example.com" "This is just a sample description"))
now we come to export single person to Org entry:
(my-people-to-org 1) ⇒ "* Joseph Joe
E-mail: joe@example.com
This is just a sample description"
Now we can make full export to Org of all people in the database:
(defun my-people-to-org ()
(let ((people (flatten-list (sqlite-select my-db "SELECT people_id FROM people"))))
(with-temp-buffer
(while people
(insert (my-people-to-org-single (pop people))))
(buffer-string))))
(my-people-to-org) ⇒ "* Joseph Joe
E-mail: joe@example.com
This is just a sample description
* Jane
"
Then we can export everything to Org file:
(defun my-people-export-to-org-file ()
(interactive)
(let ((file (read-file-name "Export people to which Org file? ")))
(with-temp-file file
(insert (my-people-to-org)))))
M-x my-people-export-to-org-file
now when one is aware that people may be managed very easy in the
SQLite database, one shall examine the modes of SQLite:
.mode MODE ?TABLE? Set output mode where MODE is one of:
csv Comma-separated values
column Left-aligned columns. (See .width)
html HTML <table> code
insert SQL insert statements for TABLE
line One value per line
list Values delimited by .separator string
tabs Tab-separated values
tcl TCL list elements
It also means that importing CSV files into SQLite is easy.
Exporting from SQLite to Org file is also easy.
Exporting SQL is easy:
.mode insert
sqlite> select * from people;
INSERT INTO "table" VALUES(1,'Joseph','Joe','Doe','joe@example.com','This is just a sample description');
INSERT INTO "table" VALUES(2,'Jane','','Dine','',NULL);
INSERT INTO "table" VALUES(3,'Robert',NULL,'Weiner','rsw@gnu.org',NULL);
Or one value per line:
.mode line
select * from people;
people_id = 1
people_firstname = Joseph
people_middlenames = Joe
people_name = Doe
people_email = joe@example.com
people_description = This is just a sample description
people_id = 2
people_firstname = Jane
people_middlenames =
people_name = Dine
people_email =
people_description =
people_id = 3
people_firstname = Robert
people_middlenames =
people_name = Weiner
people_email = rsw@gnu.org
people_description =
Now we come to relation of Org to people ID.
How about this:
* My heading
:PROPERTIES:
:PEOPLE-ID-RELATED: 1
:END:
Now you know that ID is in the file my-people.sqlite and that ID
is 1. That is to stay so, immutable.
Let us make the report for person:
(define-derived-mode my-people-view-mode org-mode "My People View Mode"
"This is read only view mode for people")
(defun my-people-org-report (id)
(let* ((name (my-people-name id))
(buffer (get-buffer-create name))
(org (my-people-to-org-single id)))
(pop-to-buffer (get-buffer-create "My people report"))
(read-only-mode 0)
(erase-buffer)
(insert org)
(goto-char (point-min))
(my-people-view-mode)
(keymap-set my-people-view-mode-map "q" #'quit-window)
(keymap-set my-people-view-mode-map "e" `(lambda () (interactive) (my-people-edit ,id)))
(read-only-mode 1)))
The above allows to open the new Org buffer where entry from database is shown:
(my-people-org-report 1)
Then I can see this:
* Joseph Joe
E-mail: joe@example.com
This is just a sample description
now back to heading in your real Org file:
* My heading
:PROPERTIES:
:PEOPLE-ID-RELATED: 1
:END:
If person ID 1 is related to this heading, then I can make
function to quickly see the entry of the person:
(defun my-people-org-set-people-id-name (id)
(let ((name (my-people-name id)))
(org-set-property "PEOPLE-ID-NAME" name)))
(defun my-people-org-related-view ()
(interactive)
(let ((people-id-related (cdr (assoc "PEOPLE-ID-RELATED" (org-entry-properties)))))
(cond (people-id-related (progn (my-people-org-set-people-id-name people-id-related)
(my-people-org-report people-id-related)))
(t (message "No related contact found in this Org heading")))))
When there is related contact one jumps into generated Org file by C-c r
and then with "e" one can already edit the contact in general way by using Emacs minibuffer.
And what if we jump to related contact, maybe we still need contact
name in properties, so it is generated automatically and directly from
the database.
* My heading
:PROPERTIES:
:PEOPLE-ID-RELATED: 1
:PEOPLE-ID-NAME: Joseph Joe Doe
:PEOPLE-ID-EMAIL: joe@example.com
:END:
What if we need email in properties?
(defun my-people-org-set-people-id-email (id)
(let ((email (sqlite-db-get-entry "people" "people_email" id my-db)))
(org-set-property "PEOPLE-ID-EMAIL" email)))
then
(defun my-people-org-related-view ()
(interactive)
(let ((people-id-related (cdr (assoc "PEOPLE-ID-RELATED" (org-entry-properties)))))
(cond (people-id-related (progn (my-people-org-set-people-id-email people-id-related)
(my-people-org-set-people-id-name people-id-related)
(my-people-org-report people-id-related)))
(t (message "No related contact found in this Org heading")))))
And how to add related person straight from database?
(defun my-people-org-related-person (&optional id)
(interactive)
(let ((id (or id (my-people-complete))))
(when id
(org-set-property "PEOPLE-ID-RELATED" (format "%s" id)))))
This all assumes that it is just one person related to heading.
We could make any number of people related to heading, but let
us keep it to this example.
At this moment maybe you are writing Org headline that is related
to SCHOOL ABC:
Here is the flow:
1. Add new entry in people table by using M-x my-people-add
2. Make new headline in Org:
** Cleaning project
3. Run function M-x my-people-org-related-person
** Cleaning project
:PROPERTIES:
:PEOPLE-ID-RELATED: 4
:PEOPLE-ID-EMAIL: myschool@example.com
:PEOPLE-ID-NAME: SCHOOL ABC
:END:
At this point you may examine the entry for the ABC SCHOOL by clicking
C-c r and it will update Org properties.
By using this principle it could update anything in Org but also in
any other type of file.
By using SQLite or PostgreSQL you can use plethora of OTHER PROGRAMS
to manage entries in your database.
For example in sqlitebrowser:
https://gnu.support/images/sqlite/2022/2022-10-09/2022-10-09-13:34:30.png
Now your contacts are separated from Org. Only by using SQLite browser
you may freely enter new contacts in the database and edit them by
your wish. There are many various tools to manage databases.
I am editing contacts by using tabulated list mode in Emacs:
ID 6
Date created "2021-06-25 15:50:35.1712+03"
Date modified "2022-10-06 12:37:31.877754+03"
Prefix nil
First name "Joe"
Middle names nil
Last name (People List Name) "Doe"
Suffix nil
Hyperdocument Set #1 nil
Profile Image nil
ID Document nil
Lead source "thispersondoesnotexist.com/"
Title nil
Department nil
Date of birth or Begin Date nil
End date nil
Don't contact nil
Description nil
Modified by username "maddox"
Created by username "maddox"
Introduced by "Vicente Ramirez"
Other names nil
Tokens "'data':2 'enter':1 'lastnam':5 'people.people':4"
Rank 0
Assigned to nil
People type "Individual Person"
Reports to nil
Communication Language nil
SIC Code nil
Industry nil
Tag #1 nil
Tag #2 nil
Tag #3 nil
Active "Active"
FROM Identity nil
Internal information nil
But I can as well edit my contacts by using external tools and
exchange information with other software.
Do you wish to share your contacts? That is easy, one can simple send
the full file to somebody.
By followed the thought patterns described one shall understand that
contacts may be separated from single mode (Org) and separated from
single software (Emacs) and that it will not minimize or limit you but
rather widen the capacities and usefulness for human.
--
Jean
Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns
In support of Richard M. Stallman
https://stallmansupport.org/
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: SQLite for contacts and relations to Org - Re: contact management in emacs
2022-10-09 10:40 ` SQLite for contacts and relations to Org - " Jean Louis
@ 2022-10-09 15:21 ` Quiliro Ordóñez
2022-10-09 16:59 ` Jean Louis
2022-10-11 5:54 ` Sébastien Rey-Coyrehourcq
1 sibling, 1 reply; 33+ messages in thread
From: Quiliro Ordóñez @ 2022-10-09 15:21 UTC (permalink / raw)
To: Sébastien Rey-Coyrehourcq, Alan Schmitt, emacs-orgmode
El 2022-10-09 05:40, Jean Louis escribió:
> But I can as well edit my contacts by using external tools and
> exchange information with other software.
>
> Do you wish to share your contacts? That is easy, one can simple send
> the full file to somebody.
>
> By followed the thought patterns described one shall understand that
> contacts may be separated from single mode (Org) and separated from
> single software (Emacs) and that it will not minimize or limit you but
> rather widen the capacities and usefulness for human.
This is a great summary about the use of database to hold information.
But it requires experience configuring databases for end-users. It
could work if the database was set up by someone else or if the fields
were easy to define by the end-user by some kind of interface.
On the other hand, there is a movement to use plain text for everything.
I know you disagree. But here is some information about accounting
this way: https://plaintextaccounting.org
I learned a lot of elisp by reading your long explanation about how to
construct a contact database directly on Emacs 29 without adding
anything else. Thank you very much!
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: SQLite for contacts and relations to Org - Re: contact management in emacs
2022-10-09 15:21 ` Quiliro Ordóñez
@ 2022-10-09 16:59 ` Jean Louis
2022-10-09 19:09 ` Quiliro Ordóñez
0 siblings, 1 reply; 33+ messages in thread
From: Jean Louis @ 2022-10-09 16:59 UTC (permalink / raw)
To: Quiliro Ordóñez
Cc: Sébastien Rey-Coyrehourcq, Alan Schmitt, emacs-orgmode
* Quiliro Ordóñez <quiliro@riseup.net> [2022-10-09 18:22]:
> El 2022-10-09 05:40, Jean Louis escribió:
>
> > But I can as well edit my contacts by using external tools and
> > exchange information with other software.
> >
> > Do you wish to share your contacts? That is easy, one can simple send
> > the full file to somebody.
> >
> > By followed the thought patterns described one shall understand that
> > contacts may be separated from single mode (Org) and separated from
> > single software (Emacs) and that it will not minimize or limit you but
> > rather widen the capacities and usefulness for human.
>
> This is a great summary about the use of database to hold information.
> But it requires experience configuring databases for end-users.
We speak of what? User experience? We are in Emacs environment, that
means you run your application either by using mouse click or by M-x
or key binding.
In the provided example you as user need nothing else but
that. Hypothetically basic actions are just add, modify, delete,
search for contacts. You do that by key binding in Emacs, or by mouse,
or by M-x
In the example provided user need do nothing but that. Even the file
can be automatically stored like in ~/.emacs.d/people.sqlite or
otherwise configured to be somewhere else.
How many options does Org have? The example I have provided may be
option free.
There is nothing to do but to add, modify, delete, search for
contacts, export, and so on; all by using M-x, key binding or mouse.
> It could work if the database was set up by someone else or if the
> fields were easy to define by the end-user by some kind of
> interface.
I have actually shown to you how it works, so you have to imagine that
all that may be part of the package. Especially with SQLite databases
there is nothing to configure.
This is what defines where the database is:
(defcustom rcd-people-sqlite-file (concat (expand-file-name user-emacs-directory) "rcd-people.sqlite")
"SQLite database file location."
:type 'file
:group 'rcd)
We evaluate it:
rcd-people-sqlite-file ⇒ "/home/data1/protected/.emacs.d/rcd-people.sqlite"
The above variable is part of the package. There is nothing for
user to think about it. There is nothing to configure but user
is free to customize it.
Fields or columns in preset database tables are designed by
programmer.
It is not hard to have options to add column, delete column or
rename column. That is exactly what I am doing on the fly during
Emacs sessions.
> On the other hand, there is a movement to use plain text for everything.
> I know you disagree.
There are movements for each and everything. Why should I
disagree with movements, I let them be.
What I do not agree is to claim strongly that it is useful to
keep plain text or clay tables with Cuneiform for every type of
information.
> But here is some information about accounting
> this way: https://plaintextaccounting.org
The huge amount of work necessary to create plain text accounting
can't be compared to database work and efforts. I guess I have
implemented accounting with database about 4 times in my life
and I use it in various contexts. Standard accounting is simple.
Accounting types (pasted straight from Emacs view of database
list):
1 Asset
2 Liability
3 Equity
4 Income
5 Expenses
Sample account defined:
ID 1
Date created "2022-02-27 18:36:28.690616"
Date modified "2022-02-27 18:36:39.372512"
User created "maddox"
User modified "maddox"
Hyperdocument "2022-02-27 Transactions for Joe Doe"
Account Type "Asset"
Person "Jean Louis"
Currency "UGX - Ugandan shilling"
Name "Jean Louis"
Description nil
Code nil
It belongs to Hyperdocument which has type of accounting. There
may be multiple companies, multiple accounting sets or parents
to which accounts belong. No need to open a "new file" for each
new company.
And then there is journal entry:
-[ RECORD 1 ]----------+-------------------------------------------------------------------
journal_id | 4
journal_datecreated | 2019-06-12 00:08:04.409559
journal_datemodified |
journal_usercreated | maddox
journal_usermodified | maddox
journal_cashentrytypes | 1
journal_code |
journal_description | food
journal_debit | 5
journal_credit | 7
journal_amount | 4000
journal_signature |
journal_date | 2019-06-10
The entry debits account ID 5, credits account ID 7.
> I learned a lot of elisp by reading your long explanation about how to
> construct a contact database directly on Emacs 29 without adding
> anything else. Thank you very much!
Well that is really good, thank you.
--
Jean
Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns
In support of Richard M. Stallman
https://stallmansupport.org/
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: SQLite for contacts and relations to Org - Re: contact management in emacs
2022-10-09 16:59 ` Jean Louis
@ 2022-10-09 19:09 ` Quiliro Ordóñez
2022-10-10 6:12 ` Jean Louis
0 siblings, 1 reply; 33+ messages in thread
From: Quiliro Ordóñez @ 2022-10-09 19:09 UTC (permalink / raw)
To: Quiliro Ordóñez; +Cc: emacs-orgmode
El 2022-10-09 11:59, Jean Louis escribió:
> * Quiliro Ordóñez <quiliro@riseup.net> [2022-10-09 18:22]:
>> El 2022-10-09 05:40, Jean Louis escribió:
>>
>> > But I can as well edit my contacts by using external tools and
>> > exchange information with other software.
>> >
>> > Do you wish to share your contacts? That is easy, one can simple send
>> > the full file to somebody.
>> >
>> > By followed the thought patterns described one shall understand that
>> > contacts may be separated from single mode (Org) and separated from
>> > single software (Emacs) and that it will not minimize or limit you but
>> > rather widen the capacities and usefulness for human.
>>
>> This is a great summary about the use of database to hold information.
>> But it requires experience configuring databases for end-users.
>
> We speak of what? User experience? We are in Emacs environment, that
> means you run your application either by using mouse click or by M-x
> or key binding.
>
> In the provided example you as user need nothing else but
> that. Hypothetically basic actions are just add, modify, delete,
> search for contacts. You do that by key binding in Emacs, or by mouse,
> or by M-x
>
> In the example provided user need do nothing but that. Even the file
> can be automatically stored like in ~/.emacs.d/people.sqlite or
> otherwise configured to be somewhere else.
I agree. But the end-user did not construct this program. It was you.
I coould learn how to install it. Then, I should teach the end-user to
use it. But the program was not made or installed by the end-user. I
might be able to teach the end-user to modify it. But I doubt it.
What I mean is that end-users must have an easy entry point. Of course
that ease must not hide innner workings because that would disempower
the end-user. How do you propose it could be implemented? (if you agree
it should be done this way, of course)
> I have actually shown to you how it works, so you have to imagine that
> all that may be part of the package. Especially with SQLite databases
> there is nothing to configure.
Not much to do. Just installing SQLite and then the program you
propose.
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: SQLite for contacts and relations to Org - Re: contact management in emacs
2022-10-09 19:09 ` Quiliro Ordóñez
@ 2022-10-10 6:12 ` Jean Louis
2022-10-10 22:29 ` Robert Weiner
0 siblings, 1 reply; 33+ messages in thread
From: Jean Louis @ 2022-10-10 6:12 UTC (permalink / raw)
To: Quiliro Ordóñez; +Cc: emacs-orgmode
* Quiliro Ordóñez <quiliro@riseup.net> [2022-10-09 22:10]:
> I agree. But the end-user did not construct this program. It was you.
> I coould learn how to install it. Then, I should teach the end-user to
> use it. But the program was not made or installed by the end-user. I
> might be able to teach the end-user to modify it. But I doubt it.
I will make a package so that you just install it and can start
managing people.
> What I mean is that end-users must have an easy entry point. Of course
> that ease must not hide innner workings because that would disempower
> the end-user. How do you propose it could be implemented? (if you agree
> it should be done this way, of course)
Inner workings are pretty much hidden unless user is programmer. Emacs
is difficult, then there is underlying Emacs Lisp, then C language,
then operating system, and stuff.
Maybe you mean somthing else with inner workings?
> > I have actually shown to you how it works, so you have to imagine that
> > all that may be part of the package. Especially with SQLite databases
> > there is nothing to configure.
>
> Not much to do. Just installing SQLite and then the program you
> propose.
I did not try any SQLite package, just used the built-in functions in
Emacs development version. Which packag did you install?
--
Jean
Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns
In support of Richard M. Stallman
https://stallmansupport.org/
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: SQLite for contacts and relations to Org - Re: contact management in emacs
2022-10-10 6:12 ` Jean Louis
@ 2022-10-10 22:29 ` Robert Weiner
2022-10-10 23:32 ` Jean Louis
0 siblings, 1 reply; 33+ messages in thread
From: Robert Weiner @ 2022-10-10 22:29 UTC (permalink / raw)
To: Quiliro Ordóñez, emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 3032 bytes --]
Hi Jean:
A few thoughts.
1. Although I understand you do a great many things with your
database-backed Hyperscope system and I work with RDBMSes every day, I
don't really see great value in what you have shown in the context of
contact management when compared to the already existing HyRolo or
org-contacts. We can easily add, delete, import and export contacts, we
just follow very simple conventions in creating our contacts. We can
easily email contact files and have people apply text processing tools to
them, so it would help if you just showed examples of something that Emacs
really lacks before suggesting wrapping everything into a database system,
as I know you are a very smart guy.
2. Years ago as part of my stab at an Emacs-based IDE, InfoDock (find it on
Sourceforge), I also wrote an in-memory, file-based but fully relational
database. The main point of which was to demonstrate direct manipulation
querying of relational tables via simple mouse clicks/key presses on
screen. For simple queries, I found this very powerful and dirt simple for
people to do. If that were of interest, someone could take the existing
code under infodock/id-lisp/rdb and interface it to SQLite pretty easily I
would expect and then you would have an interesting Emacs interface without
having to master SQL for basic table analysis.
-- rsw
On Mon, Oct 10, 2022 at 6:12 AM Jean Louis <bugs@gnu.support> wrote:
> * Quiliro Ordóñez <quiliro@riseup.net> [2022-10-09 22:10]:
> > I agree. But the end-user did not construct this program. It was you.
> > I coould learn how to install it. Then, I should teach the end-user to
> > use it. But the program was not made or installed by the end-user. I
> > might be able to teach the end-user to modify it. But I doubt it.
>
> I will make a package so that you just install it and can start
> managing people.
>
> > What I mean is that end-users must have an easy entry point. Of course
> > that ease must not hide innner workings because that would disempower
> > the end-user. How do you propose it could be implemented? (if you agree
> > it should be done this way, of course)
>
> Inner workings are pretty much hidden unless user is programmer. Emacs
> is difficult, then there is underlying Emacs Lisp, then C language,
> then operating system, and stuff.
>
> Maybe you mean somthing else with inner workings?
>
> > > I have actually shown to you how it works, so you have to imagine that
> > > all that may be part of the package. Especially with SQLite databases
> > > there is nothing to configure.
> >
> > Not much to do. Just installing SQLite and then the program you
> > propose.
>
> I did not try any SQLite package, just used the built-in functions in
> Emacs development version. Which packag did you install?
>
> --
> Jean
>
> Take action in Free Software Foundation campaigns:
> https://www.fsf.org/campaigns
>
> In support of Richard M. Stallman
> https://stallmansupport.org/
>
>
[-- Attachment #2: Type: text/html, Size: 4430 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: SQLite for contacts and relations to Org - Re: contact management in emacs
2022-10-10 22:29 ` Robert Weiner
@ 2022-10-10 23:32 ` Jean Louis
2022-10-11 3:20 ` Robert Weiner
0 siblings, 1 reply; 33+ messages in thread
From: Jean Louis @ 2022-10-10 23:32 UTC (permalink / raw)
To: rswgnu; +Cc: Quiliro Ordóñez, emacs-orgmode
* Robert Weiner <rsw@gnu.org> [2022-10-11 01:31]:
> 1. Although I understand you do a great many things with your
> database-backed Hyperscope system and I work with RDBMSes every day, I
> don't really see great value in what you have shown in the context of
> contact management when compared to the already existing HyRolo or
> org-contacts. We can easily add, delete, import and export contacts, we
> just follow very simple conventions in creating our contacts. We can
> easily email contact files and have people apply text processing tools to
> them, so it would help if you just showed examples of something that Emacs
> really lacks before suggesting wrapping everything into a database system,
> as I know you are a very smart guy.
For org-contacts, I have nothing to say, as that is as limited as it
can be.
When anyway structured information such as people names, properties,
their communication lines, addresses are in the separate database like
SQLite, that fact liberates information from single software like
HyRolo, and allows users to access, process information freely with
any programming languages and plethora of variety of tools for
inspection, analysis, exports, and sharing of such information.
For HyRolo, that is text. One cannot build upon it.
I am constantly sending SMS from Emacs and importing SMS from mobile
phones to contacts. When I send SMS I want to see which SMS was sent
and received by which contact at what time, by which phone number. It
is something not imaginable with text files. Similar is with
information sent to people, how am I supposed to know what information
I have sent, what not. There is no automated tracking in text files
like HyRolo. It is one example among way too many.
Adding properties to people, objects, it is much easier by using
selection that one can click onto, or use arrows, or just C-p for
previous one. Rather that, then writing with hand each time, error
prone, some skills of people in order to find people by skills.
Skill like "C programmer" I would need to add too many times and then
use find by regexp.
All good and find, but not scalable. Of course that I have use text
files long ago to store contacts, but that was 28 years ago. I have
now 240106 entries of people and their groups.
Unspoken of marketing campaign, imagine when I paid $73 and got in 23
hours 1200+ leads for recruitment in specific sector. How would I
enter them in HyRolo? Automate some web server program to add them in
similar fashion like Org heading. It could work. But then how could I
send to those people in ordered fashion series of 3-10 training emails
that automates the process of recruitment and selection? Would HyRolo
help me track who received what at what time? There is no foundation
for such features in text files.
> 2. Years ago as part of my stab at an Emacs-based IDE, InfoDock (find it on
> Sourceforge),
Is it this one?
https://sourceforge.net/projects/infodock/
I cannot see how to start anything with it. Do you have screenshots?
> I also wrote an in-memory, file-based but fully relational database.
> The main point of which was to demonstrate direct manipulation
> querying of relational tables via simple mouse clicks/key presses on
> screen. For simple queries, I found this very powerful and dirt
> simple for people to do. If that were of interest, someone could
> take the existing code under infodock/id-lisp/rdb and interface it
> to SQLite pretty easily I would expect and then you would have an
> interesting Emacs interface without having to master SQL for basic
> table analysis.
Is it this one?
lib/infodock-4.0.8/i486-pc-sysv5/
lib/infodock-4.0.8/i486-pc-sysv5/make-path
lib/infodock-4.0.8/i486-pc-sysv5/wakeup
lib/infodock-4.0.8/i486-pc-sysv5/profile
lib/infodock-4.0.8/i486-pc-sysv5/make-docfile
lib/infodock-4.0.8/i486-pc-sysv5/digest-doc
lib/infodock-4.0.8/i486-pc-sysv5/sorted-doc
lib/infodock-4.0.8/i486-pc-sysv5/movemail
lib/infodock-4.0.8/i486-pc-sysv5/cvtmail
lib/infodock-4.0.8/i486-pc-sysv5/fakemail
lib/infodock-4.0.8/i486-pc-sysv5/yow
lib/infodock-4.0.8/i486-pc-sysv5/hexl
lib/infodock-4.0.8/i486-pc-sysv5/gnuserv
lib/infodock-4.0.8/i486-pc-sysv5/mmencode
lib/infodock-4.0.8/i486-pc-sysv5/rcs2log
lib/infodock-4.0.8/i486-pc-sysv5/vcdiff
lib/infodock-4.0.8/i486-pc-sysv5/gzip-el.sh
lib/infodock-4.0.8/i486-pc-sysv5/add-big-package.sh
lib/infodock-4.0.8/i486-pc-sysv5/config.values
lib/infodock-4.0.8/i486-pc-sysv5/DOC
bin/i386-intel-sco7/
bin/i386-intel-sco7/etags
bin/i386-intel-sco7/ctags
bin/i386-intel-sco7/b2m
bin/i386-intel-sco7/gnuclient
bin/i386-intel-sco7/ootags
bin/i386-intel-sco7/rcs-checkin
bin/i386-intel-sco7/pstogif
bin/i386-intel-sco7/gnudoit
bin/i386-intel-sco7/gnuattach
bin/i386-intel-sco7/infodock-4.0.8
bin/i386-intel-sco7/infodock --> infodock-4.0.8
--
Jean
Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns
In support of Richard M. Stallman
https://stallmansupport.org/
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: SQLite for contacts and relations to Org - Re: contact management in emacs
2022-10-10 23:32 ` Jean Louis
@ 2022-10-11 3:20 ` Robert Weiner
0 siblings, 0 replies; 33+ messages in thread
From: Robert Weiner @ 2022-10-11 3:20 UTC (permalink / raw)
To: Jean Louis; +Cc: Quiliro Ordóñez, emacs-orgmode
You want a CRM system which to me is a very different creature and much more complex than a contact manager, meant to lookup fairly static information about people. HyRolo was built to allow freeform contact management and to specifically avoid the typical, limiting field-based techniques in common use.
It would be a small extensio to allow you to apply operations to a set of filtered contacts you have found.
-- Bob
> On Oct 10, 2022, at 7:39 PM, Jean Louis <bugs@gnu.support> wrote:
>
>
>
> When anyway structured information such as people names, properties,
> their communication lines
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: SQLite for contacts and relations to Org - Re: contact management in emacs
2022-10-09 10:40 ` SQLite for contacts and relations to Org - " Jean Louis
2022-10-09 15:21 ` Quiliro Ordóñez
@ 2022-10-11 5:54 ` Sébastien Rey-Coyrehourcq
2022-10-11 19:59 ` Jean Louis
1 sibling, 1 reply; 33+ messages in thread
From: Sébastien Rey-Coyrehourcq @ 2022-10-11 5:54 UTC (permalink / raw)
To: Jean Louis; +Cc: Alan Schmitt, emacs-orgmode
[-- Attachment #1.1.1: Type: text/plain, Size: 23540 bytes --]
Hi Jean Louis,
First i want to thank you for this very detailled explanation, this is very valuable for someone that start in elisp like me.
Secondly, i found the idea of using sqlite for contacts very interesting, and i think a lot on this solution on my side the last weeks. With the new emacs interface to sql, it was easy i suppose to create a “both-way” syncing tool between org-contact (to easily maintain info, linking to notes, agenda, etc.) and a database that anyone could reuse, move, send also using mobile phone.
I use org-roam that use both of the two world, database and org, in the light of recent discussion, why we cannot do the same things for org-contact ? Linking / syncing properties with unique hash/id also stored in a database. If you have 150000 contact, with 150000 unique ID, and if you want to create an org-contact file/propertie into an org document, that’s probably easy to inject and maintain some sort of syncing (like org-roam do) between the info in database and the info into some properties block no ?
Best regards,
SR
Jean Louis <bugs@gnu.support> writes:
> * Sébastien Rey-Coyrehourcq <sebastien.rey-coyrehourcq@univ-rouen.fr> [2022-09-09 ven. 19:12]:
>> Hi,
>>
>> After some search today on the web, like Alan i try to compare all
>> possibility to manage my contact + mail using emacs, mu4e, and org.
>
> I will describe you how to manage contacts with Emacs in the reverse
> example reverse of what org-contacts tries to do for you.
>
> Org contacts try to keep people in Org file. Emacs 29 has a built-in
> SQLite database which allows every Emacs user to keep information in
> ordered, structured manner in the relational database.
>
> For people who do not use latest development Emacs version, there are
> SQLite Emacs packages that allow immediate usage of file based
> single-user access database, see <https://www.sqlite.org>
>
> In Emacs 29, here is how I create the SQLite database, or open the existing one:
>
> (setq my-db (sqlite-open “~/my-people”))
>
> This is database handle:
>
> my-db ⇒ #<sqlite db=0x55987eb7d4a0 name=/home/data1/protected/my-org-properties>
>
> This is how to create a table of `people’ in the database. The
> structure of the table `people’ is thus pretty much individual,
> one can record any kind of entries and be sure if the the entry
> is there or not. It does not allow vague guessing with text files
> like in Org or Hyrolo in Hyperbole.
>
> This is example table, one can build upon it. This one contains emails only.
>
> (sqlite-execute my-db “CREATE TABLE people1 (people_id INTEGER PRIMARY KEY,
> people_firstname TEXT,
> people_middlenames TEXT,
> people_name TEXT NOT NULL DEFAULT ’>>>UNKNOWN<<<‘,
> people_email TEXT,
> people_description TEXT)”)
>
> This is how to get all queries from the table:
>
> (sqlite-select my-db “SELECT * FROM people”) ⇒ nil
>
> This is how to insert new entry programmatically:
>
> (sqlite-execute my-db “INSERT INTO people (people_firstname, people_name, people_email)
> VALUES (?, ?, ?)
> RETURNING people_id”
> ’(“Robert” “Weiner” “rsw@gnu.org”))
>
> Get information back from database, programmatically. Do with information what you wish.
>
> (sqlite-select my-db “SELECT * FROM people”) ⇒ ((1 “Robert” nil “Weiner” “rsw@gnu.org” nil) (2 “Robert” nil “Weiner” “rsw@gnu.org” nil))
>
> Delete everything in the database.
>
> (sqlite-execute my-db “DELETE FROM people”) ⇒ 0
>
> ;; Backup?
>
> Backup database by simple copy of the file “~/my-people”
>
> (sqlite-select my-db “SELECT * FROM people”) ⇒ nil
>
> Make nicer function to add new people:
>
> (defun my-people-add ()
> (interactive)
> (let* ((first-name (read-string “First name: ”))
> (middle-names (read-string “Middles names: ”))
> (name-or-last-name (let ((result))
> (while (not result)
> (setq result (apply ’read-string ’(“Last name: ”))))
> result))
> (email (read-string “Email: ”))
> (description (read-string “Description: ”)))
> (sqlite-execute my-db “INSERT INTO people (people_firstname, people_middlenames, people_name, people_email, people_description)
> VALUES (?, ?, ?, ?, ?) RETURNING people_id”
> (list first-name middle-names name-or-last-name description))))
>
> Run the function by using (my-people-add) or M-x my-people-add
>
> Verify that person was added:
>
> (sqlite-select my-db “SELECT * FROM people”) ⇒ ((1 “Joe” “” “Doe” nil nil))
>
> Entries are returned as list, get the first list entry:
>
> (caar (sqlite-select my-db “SELECT people_id FROM people WHERE people_id = 1”)) ⇒ 1
>
> My database structure is ALWAYS as so that for TABLE I always
> have primary key named TABLE_id. That principle allows to
> simplify things.
>
> Then I can make generic function to fetch from database DB, from
> TABLE and COLUMN by using ID:
>
> (defun sqlite-db-get-entry (table column id db)
> “Return value for the TABLE, COLUMN, ID from the database PG.”
> (let* ((sql (format “SELECT %s FROM %s WHERE %s_id = %s” column table table id))
> (value (caar (sqlite-select db sql))))
> value))
>
> (sqlite-db-get-entry “people” “people_id” 1 my-db) ⇒ 1
>
> (sqlite-db-get-entry “people” “people_name” 1 my-db) ⇒ “Doe”
>
> (sqlite-db-get-entry “people” “people_email” 1 my-db) ⇒ “joe@example.com”
>
> Make it exportable to Org:
>
> (defun my-people-to-org-single (id)
> (let* ((first-name (sqlite-db-get-entry “people” “people_firstname” id my-db))
> (middle-names (sqlite-db-get-entry “people” “people_middlenames” id my-db))
> (last-name (sqlite-db-get-entry “people” “people_lastname” id my-db))
> (email (sqlite-db-get-entry “people” “people_email” id my-db))
> (description (sqlite-db-get-entry “people” “people_description” id my-db))
> (heading (list first-name middle-names last-name))
> (heading (mapcar (lambda (e) (cond ((seq-empty-p e) nil)
> (t e)))
> heading))
> (heading (delq nil heading))
> (heading (concat “* ” (string-join heading “ ”) “\n\n”))
> (text (with-temp-buffer
> (when (and email (> (length email) 0))
> (insert (concat “E-mail: ” email “\n\n”)))
> (when (and description (> (length description) 0))
> (insert description))
> (buffer-string))))
> (concat heading text “\n\n”)))
>
> (my-people-to-org-single 1) ⇒ “* Joseph Joe
>
> E-mail: joe@example.com
>
> This is just a sample description
>
> ”
>
> What if we have multiple people like “Joe Doe”? Then each will
> have its unique ID by which we have to be able to choose them.
>
> One approach is to add on the name a bracketed ID number, like:
>
> “Joe Doe [1]”
> “Joe Doe [2]”
>
> Another approach is to add various other attributes to make the
> entry distinguishable in completions:
>
> “Joe Doe, Ukraine [1]”
> “Joe Doe, Russia [2]”
> “Joe Doe, USA [3]”
> “Joe Doe, Emacs Users [4]”
>
> To cut the ID from the bracket on the end, following function does it:
>
> (defun rcd-get-bracketed-id-end (s)
> “Return the ID number in string S from within first brackets on its
> end. For example it would return 123 from `Some string [123]’”
> (let* ((match (string-match “\\[\\([[:digit:]]*\\)\\][[$” s)))
> (when match
> (string-to-number
> (substring-no-properties s (match-beginning 1) (match-end 1))))))
>
> Let us make generic function that expects bracketed ID and
> completes by SQL. This function could be better of course, this
> is example:
>
> (defun my-completing-id-by-sql-end (prompt sql db)
> “Return the ID as by finding [<ID:123>] on the end.
> Argument PROMPT will be displayed to user.
> Argument SQL is supplied query.
> Argument PG is database handle.”
> (let* ((selection (sqlite-select db sql))
> (choice (completing-read prompt selection)))
> (rcd-get-bracketed-id-end choice)))
>
> Let us now use that generic function to get a completion list:
>
> (defun my-people-completion-list ()
> (let ((sql “SELECT coalesce(CASE WHEN people_firstname IS NOT NULL
> AND length(people_firstname) > 0
> THEN people_firstname || ‘, ’
> END, ‘’) ||
> coalesce(CASE WHEN people_middlenames IS NOT NULL
> AND length(people_middlenames) > 0
> THEN people_middlenames || ‘, ’
> END, ‘’) ||
> people_name || ’ [’ || people_id || ’]’ FROM people”))
> (sqlite-select my-db sql)))
>
> And here is how completion list looks like:
>
> (my-people-completion-list) ⇒ ((“Joe, Doe [1]”))
>
> Here is the function to choose person among people and return it’s ID:
>
> (defun my-people-complete ()
> “Return person’s ID.”
> (let ((my-people (my-people-completion-list)))
> (cond (my-people (rcd-get-bracketed-id-end (completing-read “Choose person: ” my-people)))
> (t (error “No people in database”)))))
>
> (my-people-complete) ⇒ 1
>
> Let us get list of all columns in SQLite table:
>
> (defun my-sqlite-table-column-list (table)
> “From: <https://stackoverflow.com/questions/604939/how-can-i-get-the-list-of-a-columns-in-a-table-for-a-sqlite-database>”
> ;; (sqlite-select my-db “SELECT name FROM PRAGMA_TABLE_INFO(?)” (list table)))
> (mapcar ’cadr
> (sqlite-select my-db “
> SELECT
> m.name as tableName,
> p.name as columnName
> FROM
> sqlite_master m
> LEFT OUTER JOIN pragma_table_info((m.name)) p ON m.name <> p.name
> WHERE
> m.type IN (‘table’, ‘view’)
> AND m.name NOT LIKE ‘sqlite_%’
> AND m.name = ?
> ORDER BY
> tableName,
> columnName” (list table))))
>
> (my-sqlite-table-column-list “people”) ⇒ (“people_description” “people_email” “people_firstname” “people_id” “people_middlenames” “people_name”)
>
> Let us make function to get full person’s name.
>
> - people_firstname can be empty, what if it is empty, it should not be displaed
>
> - people_middlename should be in the middle, but could be empty
>
> - people_name represents either last name or company name or
> group name, business name, list of people, etc. It must be
> there.
>
> (defun my-people-name (id)
> (caar (sqlite-select my-db “SELECT coalesce(CASE WHEN people_firstname IS NOT NULL
> AND length(people_firstname) > 0
> THEN people_firstname || ’ ’
> END, ‘’) ||
> coalesce(CASE WHEN people_middlenames IS NOT NULL
> AND length(people_middlenames) > 0
> THEN people_middlenames || ’ ’
> END, ‘’) ||
> people_name
> FROM people
> WHERE people_id = ?”
> (list id))))
>
> (my-people-name 1) ⇒ “Joseph Joe Doe”
>
> Now function to edit people by their ID programmatically or
> interactively by choice:
>
> (defun my-people-edit (&optional id)
> (interactive)
> (let ((id (or id (my-people-complete)))
> (columns (my-sqlite-table-column-list “people”)))
> (cond (id (let ((column-to-edit (completing-read “Which column to edit? ” columns nil t)))
> (cond ((member column-to-edit columns) (let* ((initial-input (sqlite-db-get-entry “people” column-to-edit id my-db))
> (edited-entry (read-string (format “Edit `%s’: ” column-to-edit) initial-input nil initial-input)))
> (unless (string= initial-input edited-entry)
> (sqlite-execute my-db (format “UPDATE people SET %s = ? WHERE people_id = ?” column-to-edit)
> (list edited-entry id)))
> (my-people-edit id)))
> (t (message “No column choosen”)))))
> (t (message “No person selected for editing”)))))
>
> (sqlite-select my-db “SELECT * FROM people”) ⇒ ((1 “Joseph” “Joe” “Doe Junior” “joe@example.com” “This is just a sample description”))
>
> ;; Delete entry
>
> Now let us make possibility to delete single entries:
>
> (defun my-people-delete (&optional id)
> (interactive)
> (let* ((id (or id (my-people-complete)))
> (name (my-people-name id)))
> (when (y-or-n-p (format “Do you wish to delete entry `%s’? ” name))
> (sqlite-execute my-db “DELETE FROM people WHERE people_id = ?” (list id))
> (message “Deleted entry `%s’” name))))
>
> (sqlite-select my-db “SELECT * FROM people”) ⇒ nil
>
> Add again:
>
> (my-people-add)
>
> Select from database again:
>
> (sqlite-select my-db “SELECT * FROM people”) ⇒ ((1 “Joseph” “joe” “Doe” nil nil))
>
> Edit the entry
> (my-people-edit) or M-x my-people-edit
>
> (sqlite-select my-db “SELECT * FROM people”) ⇒ ((1 “Joseph” “Joe” “Doe” “joe@example.com” “This is just a sample description”))
>
> now we come to export single person to Org entry:
>
> (my-people-to-org 1) ⇒ “* Joseph Joe
> E-mail: joe@example.com
>
> This is just a sample description”
>
> Now we can make full export to Org of all people in the database:
>
> (defun my-people-to-org ()
> (let ((people (flatten-list (sqlite-select my-db “SELECT people_id FROM people”))))
> (with-temp-buffer
> (while people
> (insert (my-people-to-org-single (pop people))))
> (buffer-string))))
>
> (my-people-to-org) ⇒ “* Joseph Joe
>
> E-mail: joe@example.com
>
> This is just a sample description
>
> * Jane
>
>
>
> ”
>
> Then we can export everything to Org file:
>
> (defun my-people-export-to-org-file ()
> (interactive)
> (let ((file (read-file-name “Export people to which Org file? ”)))
> (with-temp-file file
> (insert (my-people-to-org)))))
>
> M-x my-people-export-to-org-file
>
> now when one is aware that people may be managed very easy in the
> SQLite database, one shall examine the modes of SQLite:
>
> .mode MODE ?TABLE? Set output mode where MODE is one of:
> csv Comma-separated values
> column Left-aligned columns. (See .width)
> html HTML <table> code
> insert SQL insert statements for TABLE
> line One value per line
> list Values delimited by .separator string
> tabs Tab-separated values
> tcl TCL list elements
>
> It also means that importing CSV files into SQLite is easy.
> Exporting from SQLite to Org file is also easy.
>
> Exporting SQL is easy:
>
> .mode insert
> sqlite> select * from people;
> INSERT INTO “table” VALUES(1,’Joseph’,’Joe’,’Doe’,’joe@example.com’,’This is just a sample description’);
> INSERT INTO “table” VALUES(2,’Jane’,’’,’Dine’,’’,NULL);
> INSERT INTO “table” VALUES(3,’Robert’,NULL,’Weiner’,’rsw@gnu.org’,NULL);
>
> Or one value per line:
>
> .mode line
> select * from people;
>
> people_id = 1
> people_firstname = Joseph
> people_middlenames = Joe
> people_name = Doe
> people_email = joe@example.com
> people_description = This is just a sample description
>
> people_id = 2
> people_firstname = Jane
> people_middlenames =
> people_name = Dine
> people_email =
> people_description =
>
> people_id = 3
> people_firstname = Robert
> people_middlenames =
> people_name = Weiner
> people_email = rsw@gnu.org
> people_description =
>
> Now we come to relation of Org to people ID.
>
> How about this:
>
> * My heading
> :PROPERTIES:
> :PEOPLE-ID-RELATED: 1
> :END:
>
> Now you know that ID is in the file my-people.sqlite and that ID
> is 1. That is to stay so, immutable.
>
> Let us make the report for person:
>
> (define-derived-mode my-people-view-mode org-mode “My People View Mode”
> “This is read only view mode for people”)
>
> (defun my-people-org-report (id)
> (let* ((name (my-people-name id))
> (buffer (get-buffer-create name))
> (org (my-people-to-org-single id)))
> (pop-to-buffer (get-buffer-create “My people report”))
> (read-only-mode 0)
> (erase-buffer)
> (insert org)
> (goto-char (point-min))
> (my-people-view-mode)
> (keymap-set my-people-view-mode-map “q” #’quit-window)
> (keymap-set my-people-view-mode-map “e” `(lambda () (interactive) (my-people-edit ,id)))
> (read-only-mode 1)))
>
> The above allows to open the new Org buffer where entry from database is shown:
>
> (my-people-org-report 1)
>
> Then I can see this:
>
> * Joseph Joe
>
> E-mail: joe@example.com
>
> This is just a sample description
>
> now back to heading in your real Org file:
>
> * My heading
> :PROPERTIES:
> :PEOPLE-ID-RELATED: 1
> :END:
>
> If person ID 1 is related to this heading, then I can make
> function to quickly see the entry of the person:
>
> (defun my-people-org-set-people-id-name (id)
> (let ((name (my-people-name id)))
> (org-set-property “PEOPLE-ID-NAME” name)))
>
> (defun my-people-org-related-view ()
> (interactive)
> (let ((people-id-related (cdr (assoc “PEOPLE-ID-RELATED” (org-entry-properties)))))
> (cond (people-id-related (progn (my-people-org-set-people-id-name people-id-related)
> (my-people-org-report people-id-related)))
> (t (message “No related contact found in this Org heading”)))))
>
> When there is related contact one jumps into generated Org file by C-c r
>
> and then with “e” one can already edit the contact in general way by using Emacs minibuffer.
>
> And what if we jump to related contact, maybe we still need contact
> name in properties, so it is generated automatically and directly from
> the database.
>
> * My heading
> :PROPERTIES:
> :PEOPLE-ID-RELATED: 1
> :PEOPLE-ID-NAME: Joseph Joe Doe
> :PEOPLE-ID-EMAIL: joe@example.com
> :END:
>
> What if we need email in properties?
>
> (defun my-people-org-set-people-id-email (id)
> (let ((email (sqlite-db-get-entry “people” “people_email” id my-db)))
> (org-set-property “PEOPLE-ID-EMAIL” email)))
>
>
> then
>
> (defun my-people-org-related-view ()
> (interactive)
> (let ((people-id-related (cdr (assoc “PEOPLE-ID-RELATED” (org-entry-properties)))))
> (cond (people-id-related (progn (my-people-org-set-people-id-email people-id-related)
> (my-people-org-set-people-id-name people-id-related)
> (my-people-org-report people-id-related)))
> (t (message “No related contact found in this Org heading”)))))
>
> And how to add related person straight from database?
>
> (defun my-people-org-related-person (&optional id)
> (interactive)
> (let ((id (or id (my-people-complete))))
> (when id
> (org-set-property “PEOPLE-ID-RELATED” (format “%s” id)))))
>
> This all assumes that it is just one person related to heading.
> We could make any number of people related to heading, but let
> us keep it to this example.
>
> At this moment maybe you are writing Org headline that is related
> to SCHOOL ABC:
>
> Here is the flow:
>
> 1. Add new entry in people table by using M-x my-people-add
>
> 2. Make new headline in Org:
>
> ** Cleaning project
>
> 3. Run function M-x my-people-org-related-person
>
> ** Cleaning project
> :PROPERTIES:
> :PEOPLE-ID-RELATED: 4
> :PEOPLE-ID-EMAIL: myschool@example.com
> :PEOPLE-ID-NAME: SCHOOL ABC
> :END:
>
> At this point you may examine the entry for the ABC SCHOOL by clicking
> C-c r and it will update Org properties.
>
> By using this principle it could update anything in Org but also in
> any other type of file.
>
> By using SQLite or PostgreSQL you can use plethora of OTHER PROGRAMS
> to manage entries in your database.
>
> For example in sqlitebrowser:
> <https://gnu.support/images/sqlite/2022/2022-10-09/2022-10-09-13:34:30.png>
>
> Now your contacts are separated from Org. Only by using SQLite browser
> you may freely enter new contacts in the database and edit them by
> your wish. There are many various tools to manage databases.
>
> I am editing contacts by using tabulated list mode in Emacs:
>
> ID 6
> Date created “2021-06-25 15:50:35.1712+03”
> Date modified “2022-10-06 12:37:31.877754+03”
> Prefix nil
> First name “Joe”
> Middle names nil
> Last name (People List Name) “Doe”
> Suffix nil
> Hyperdocument Set #1 nil
> Profile Image nil
> ID Document nil
> Lead source “thispersondoesnotexist.com/”
> Title nil
> Department nil
> Date of birth or Begin Date nil
> End date nil
> Don’t contact nil
> Description nil
> Modified by username “maddox”
> Created by username “maddox”
> Introduced by “Vicente Ramirez”
> Other names nil
> Tokens “‘data’:2 ‘enter’:1 ‘lastnam’:5 ‘people.people’:4”
> Rank 0
> Assigned to nil
> People type “Individual Person”
> Reports to nil
> Communication Language nil
> SIC Code nil
> Industry nil
> Tag #1 nil
> Tag #2 nil
> Tag #3 nil
> Active “Active”
> FROM Identity nil
> Internal information nil
>
> But I can as well edit my contacts by using external tools and
> exchange information with other software.
>
> Do you wish to share your contacts? That is easy, one can simple send
> the full file to somebody.
>
> By followed the thought patterns described one shall understand that
> contacts may be separated from single mode (Org) and separated from
> single software (Emacs) and that it will not minimize or limit you but
> rather widen the capacities and usefulness for human.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 889 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: SQLite for contacts and relations to Org - Re: contact management in emacs
2022-10-11 5:54 ` Sébastien Rey-Coyrehourcq
@ 2022-10-11 19:59 ` Jean Louis
0 siblings, 0 replies; 33+ messages in thread
From: Jean Louis @ 2022-10-11 19:59 UTC (permalink / raw)
To: Sébastien Rey-Coyrehourcq; +Cc: Alan Schmitt, emacs-orgmode
* Sébastien Rey-Coyrehourcq <sebastien.rey-coyrehourcq@univ-rouen.fr> [2022-10-11 08:56]:
> Hi Jean Louis,
>
> First i want to thank you for this very detailled explanation, this is very valuable for someone that start in elisp like me.
>
> Secondly, i found the idea of using sqlite for contacts very interesting, and i think a lot on this solution on my side the last weeks. With the new emacs interface to sql, it was easy i suppose to create a “both-way” syncing tool between org-contact (to easily maintain info, linking to notes, agenda, etc.) and a database that anyone could reuse, move, send also using mobile phone.
>
> I use org-roam that use both of the two world, database and org, in the light of recent discussion, why we cannot do the same things for org-contact ? Linking / syncing properties with unique hash/id also stored in a database. If you have 150000 contact, with 150000 unique ID, and if you want to create an org-contact file/propertie into an org document, that’s probably easy to inject and maintain some sort of syncing (like org-roam do) between the info in database and the info into some properties block no ?
That is exactly the point. Why keep well structured information such
as phone numbers, emails, addresses, in Org file, when structured
information by its type belong into structured forms like databases.
Keeping it in Org or any text files is not scalable, not usable, not
shareable. To tell people to use text files to keep information is
detrimental for people who listen to it. They can't know it
immediately, but one day they will realize that it does not fly.
Why email clients like Thunderbird have contacts features built-in?
For reason that contacts are related to communication and
information. Communication is connection in every relation between
people. Information is written because it fosters communication and
thus relations.
Org contacts try to store contacts into Org file. I don't know the
rest. I have looked inside the Org contacts code and I do not agree
with the design. It is not scalable.
From code:
,----
| To enter new contacts, you can use `org-capture' and a minimal
| template just like..
`----
;; this:
;; ("c" "Contacts" entry (file "~/Org/contacts.org")
;; "* %(org-contacts-template-name)
;; :PROPERTIES:
;; :EMAIL: %(org-contacts-template-email)
;; :END:")))
;;
;; You can also use a complex template, for example:
;;
;; ("c" "Contacts" entry (file "~/Org/contacts.org")
;; "* %(org-contacts-template-name)
;; :PROPERTIES:
;; :EMAIL: %(org-contacts-template-email)
;; :PHONE:
;; :ALIAS:
;; :NICKNAME:
;; :IGNORE:
;; :ICON:
;; :NOTE:
;; :ADDRESS:
;; :BIRTHDAY:
;; :END:")))
;;;; Usage:
;; How to search?
;; - You can use [M-x org-contacts] command to search.
I would not bother using that. Why? Because of experience.
- many people have many various emails, not just one.
- by using email as reference, I quickly jump to list of conversations
with that person
- if email is invalid, I still need the conversation retained
- I must know if email is for work or private, it needs more structure
- phones, I am sending SMS, I must know in structured way, if the
phone belongs to provider ABC or XYZ, as that decides on routing on
how to send SMS messages. Nobody likes spending money by using wrong
providers.
- fax is phone line, mobile phone and fixed lines are not same, I must
know type of phone line;
- aliases and nicknames belong to identities,
- single note about contact is not enough, contact may be related to
many notes.
- address must be structured, otherwise it is really difficult to use
it programmatically:
ID 198333
Date created "2022-10-11 21:28:42.565176"
Date modified nil
User created "maddox"
User modified "maddox"
Person "Joe Doe"
Type "Default address"
Address Name "Address in Germany"
Line #1 ""
Line #2 ""
Line #3 ""
City ""
Region ""
Post code ""
Country "GERMANY"
Date validated nil
Location nil
Description nil
Inactive nil
Default nil
There is no option but to keep structured information in structured
databases. I have working system with PostgreSQL and decentralized
collaboration, but I am now making SQLite minimized version, so when
package is finished I will let you know.
Package preparation:
https://gnu.support/images/2022/10/2022-10-11/Screenshot-2022-10-11-22-50-03-955596051.png
Editing of entry:
https://gnu.support/images/2022/10/2022-10-11/Screenshot-2022-10-11-22-57-51-793932307.png
--
Jean
Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns
In support of Richard M. Stallman
https://stallmansupport.org/
^ permalink raw reply [flat|nested] 33+ messages in thread
end of thread, other threads:[~2022-10-11 20:29 UTC | newest]
Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-27 11:08 contact management in emacs Alan Schmitt
2021-02-27 11:31 ` Martin Steffen
2021-02-27 13:20 ` andrés ramírez
2021-02-27 14:40 ` Eric S Fraga
2021-02-27 15:12 ` andrés ramírez
2021-02-28 10:21 ` Eric S Fraga
2021-02-27 15:14 ` Martin Steffen
2021-02-27 17:00 ` Dr. Arne Babenhauserheide
2021-02-27 16:53 ` Bob Newell
2021-02-28 9:06 ` Russell Adams
2021-02-28 11:09 ` Alan Schmitt
2021-03-03 14:40 ` TRS-80
2021-03-07 22:57 ` Jean Louis
2021-03-08 20:06 ` John Kitchin
2021-03-10 8:32 ` Jean Louis
2021-03-07 22:13 ` Jean Louis
2021-03-08 7:49 ` Alan Schmitt
2021-03-08 8:12 ` Jose E. Marchesi
2021-03-10 8:32 ` Jean Louis
2022-09-09 16:11 ` Sébastien Rey-Coyrehourcq
2022-09-10 5:46 ` Ihor Radchenko
2022-10-09 10:40 ` SQLite for contacts and relations to Org - " Jean Louis
2022-10-09 15:21 ` Quiliro Ordóñez
2022-10-09 16:59 ` Jean Louis
2022-10-09 19:09 ` Quiliro Ordóñez
2022-10-10 6:12 ` Jean Louis
2022-10-10 22:29 ` Robert Weiner
2022-10-10 23:32 ` Jean Louis
2022-10-11 3:20 ` Robert Weiner
2022-10-11 5:54 ` Sébastien Rey-Coyrehourcq
2022-10-11 19:59 ` Jean Louis
[not found] <mailman.47.1614445226.20994.emacs-orgmode@gnu.org>
2021-02-27 20:52 ` dalanicolai
2021-03-07 22:51 ` Jean Louis
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.