From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Strey Subject: Re: phone links... Date: Thu, 4 Apr 2013 10:26:54 +0200 Message-ID: <20130404082653.GD3245@strey.biz> References: <5156228C.4010400@sift.info> <20130403145208.GC3245@strey.biz> <515C4555.8010309@sift.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([208.118.235.92]:57829) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNfVf-0002D8-P1 for emacs-orgmode@gnu.org; Thu, 04 Apr 2013 04:27:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UNfVa-0002GE-Mi for emacs-orgmode@gnu.org; Thu, 04 Apr 2013 04:27:03 -0400 Received: from mx2.supremebox.com ([198.23.53.42]:33033) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNfVa-0002G3-IY for emacs-orgmode@gnu.org; Thu, 04 Apr 2013 04:26:58 -0400 Content-Disposition: inline In-Reply-To: <515C4555.8010309@sift.net> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Cc: Robert Goldman Hi Robert, On Wed, Apr 03, 2013 at 10:05:57AM -0500, Robert Goldman wrote: > On 4/3/13 Apr 3 -9:52 AM, Michael Strey wrote: > > This gives me the opportunitie to publish my own attempt to implement > > telephone functionality into org. I'm using Linphone > > (http://www.linphone.org/) instead of Skype. > > Thanks! I am folding the linphone code in to make org-phone more generic. Great! > Question: why the removal of "(0)"? For international calls? Why "(0)" only, > instead of any 0 prefix? > > Also, do you ever want to remove it anywhere but as a prefix? > If so, maybe DELETE is the wrong function call. Linphone requires the numbers in form 0033456833 or +33456833 respectively. Usually my phone links look like [[tel:+49 351 4129535]]; but since I imported data sets from a larger contact data base that had evolved over time, I ended up with stuff like this in my data base: 1. [[tel:0033 (0) 4568-33]] 2. [[tel:+49 (0)3 8899 66]] 3. [[tel:0351 41295-35]] 4. [[tel:0351/4129535]] 5. [[tel:(0351) 412 95-35]] My filter function currently handles the cases 1. to 4. but (for no other reason than carelessness) not 5. #+BEGIN_SRC emacs-lisp (defun trim-phone-number (phonenumber) "Remove whitespaces from a telephone number" (setq trimmed_phonenumber (mapconcat 'identity (delete "(0)" (split-string phonenumber "[ /-]")) ""))) #+END_SRC Regards -- Michael Strey www.strey.biz