From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 0BcPBENQRWCHdgAA0tVLHw (envelope-from ) for ; Sun, 07 Mar 2021 22:14:27 +0000 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id IKNvO0JQRWA+MwAAB5/wlQ (envelope-from ) for ; Sun, 07 Mar 2021 22:14:26 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 34D4D1974A for ; Sun, 7 Mar 2021 23:14:26 +0100 (CET) Received: from localhost ([::1]:52228 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJ1fL-0003w4-VN for larch@yhetil.org; Sun, 07 Mar 2021 17:14:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44468) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJ1ez-0003vw-MO for emacs-orgmode@gnu.org; Sun, 07 Mar 2021 17:14:01 -0500 Received: from stw1.rcdrun.com ([217.170.207.13]:32909) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJ1ex-0003Pb-DD for emacs-orgmode@gnu.org; Sun, 07 Mar 2021 17:14:01 -0500 Received: from localhost ([::ffff:41.210.141.24]) (AUTH: PLAIN securesender, TLS: TLS1.2,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 000000000001E079.0000000060455024.00003311; Sun, 07 Mar 2021 15:13:55 -0700 Date: Mon, 8 Mar 2021 01:13:01 +0300 From: Jean Louis To: Alan Schmitt Subject: Re: contact management in emacs Message-ID: Mail-Followup-To: Alan Schmitt , emacs-orgmode References: <87lfb9bwff.fsf@m4x.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87lfb9bwff.fsf@m4x.org> User-Agent: Mutt/2.0 (3d08634) (2020-11-07) Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1615155266; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=qGaFaAakNdq6drJlp4m7NCMD48urv0UhylQWsJJIoR4=; b=MCftK6jToMvh9m/fVrWqVfICk9W8gUAGrXySjcP4IiO2xLcOm5E9mdLKTtXqVXv832Y0WF mLgiPe8wZ1XrV1HmMAM6n2J8oXyUKJV85Iwrus7X4MEo/0EQdyLPUft+H695zcEeFPEBIq Dx9eJfi2Pm38tyEdPUJKXQIKLH6KPdzmT+UItGC5yILvDIoSthDO6QeIBrS0cV5fkt22J4 uYyzS4wLe2uQYPCzlTc6T/l7utSXkp3sdpUtn2UjdhbQ2YmwIlcez2fP4MFcwJ7T0TIy5T 0mYOpyxVFiSFZYqESNp87fHroFsoUR5yJ9LXOP89teAmZmaHLuGr+wt0Xdj6nw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1615155266; a=rsa-sha256; cv=none; b=M6lKUWfj8hYZxFTaitKNaV/PARVxq9vf/H39ZNN2RTl5lYYANcBkvObjqKETYgJEv6Wp3d t0Zr6J+8dGv5n/afYw7ddDFpbr13UKTM980cpe85kGNU9iPbhG/IVx7FoUc8GsbIxmmhEd HFlHqPMaIwJ1yzFDUcVv4v6SilwgFaZzP0U8jXo/aK7m4vkQwdp1ljPMtGKnHFdbEy8qZB 0R23M4Eur3CQlBhTLzl4nXdicP29or0IsgaxSlOZEqVih37vpFUTD50PxLdCEJTg5KHWaX luYHO4SZrTlvQAQkbc2SwfYx3r9xQ4Rp7TfmKnf4C2kTRj+pPWVj5/pJX1ijSQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -2.38 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 34D4D1974A X-Spam-Score: -2.38 X-Migadu-Scanner: scn1.migadu.com X-TUID: rQxQX2lnTwAf * Alan Schmitt [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