From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert Goldman Subject: Re: phone links... Date: Wed, 03 Apr 2013 10:05:57 -0500 Message-ID: <515C4555.8010309@sift.net> References: <5156228C.4010400@sift.info> <20130403145208.GC3245@strey.biz> Reply-To: rpgoldman@sift.net Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:34519) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNPGJ-0003qa-G0 for emacs-orgmode@gnu.org; Wed, 03 Apr 2013 11:06:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UNPGD-0003hm-12 for emacs-orgmode@gnu.org; Wed, 03 Apr 2013 11:06:07 -0400 Received: from 23-25-144-217-static.hfc.comcastbusiness.net ([23.25.144.217]:55782 helo=mpls.sift.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNPGC-0003hR-Sn for emacs-orgmode@gnu.org; Wed, 03 Apr 2013 11:06:00 -0400 In-Reply-To: <20130403145208.GC3245@strey.biz> 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, Robert Goldman 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. 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. Current draft: ;;;--------------------------------------------------------------------------- ;;; org-phone.el ;;; Add support for "phone:" links to phone numbers. ;;; Optional support for calling them with skype ;;;--------------------------------------------------------------------------- ;;; Copyright (C) 2013 Free Software Foundation, Inc. ;; Author: Robert P. Goldman ;; Homepage: http://orgmode.org ;; Version: 0.02 ;; This file is not yet part of GNU Emacs. (require 'org) (org-add-link-type "phone" 'org-phone-open) ;; not sure whether we need/want this yet... ;;(add-hook 'org-store-link-functions 'org-phone-store-link) (defcustom org-phone-function 'org-phone-call "The Emacs function to be used to call a phone number. By default, a simple function that uses shell-command to apply org-phone-call-command (qv.) to the phone number." :group 'org-link :type 'symbol) (defcustom org-phone-call-command "skype-call" "The executable command to be used to call a phone number. This should be a script that starts the call and returns: it should not block." :group 'org-link :type 'string) (defun org-phone-open (phone-number) "Phone the number PHONE-NUMBER. PHONE-NUMBER should be a string for a PSTN phone number." (funcall org-phone-function phone-number)) (defun org-phone-call (phone-number) (shell-command (format "%s %s" org-phone-call-command phone-number))) (defun trim-phone-number (phone-number) "Remove whitespaces from a telephone number" (mapconcat 'identity (delete "(0)" (split-string phone-number "[ /-]")) "")) ;; (defun org-phone-store-link () ;; "Store a link to a phone number." ;; ;; This is a man page, we do make this link ;; (let* ((page (org-man-get-page-name)) ;; (link (concat "man:" page)) ;; (description (format "Manpage for %s" page))) ;; (org-store-link-props ;; :type "man" ;; :link link ;; :description description)))) (provide 'org-phone)