From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert Goldman Subject: phone links... Date: Fri, 29 Mar 2013 18:23:56 -0500 Message-ID: <5156228C.4010400@sift.info> Reply-To: rpgoldman@sift.info 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]:39010) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULieR-0002Kn-MV for emacs-orgmode@gnu.org; Fri, 29 Mar 2013 19:24:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ULieN-0005Vz-4N for emacs-orgmode@gnu.org; Fri, 29 Mar 2013 19:24:03 -0400 Received: from 23-25-144-217-static.hfc.comcastbusiness.net ([23.25.144.217]:52869 helo=mpls.sift.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULieM-0005Ui-VQ for emacs-orgmode@gnu.org; Fri, 29 Mar 2013 19:23:59 -0400 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: Org Mode Since I keep my todo tasks in my org files, and some of them involve phone calls, I made a rudimentary handler for "phone:" links that I would like to contribute. It features a link declaration (in org-phone.el) and an ancillary script (currently only working on Mac OS X, but should be translatable to other platforms) that can be used to place skype calls to the phone numbers. One thing it does not do is support interactive entry of phone numbers. The two files are below, in hopes of getting suggestions for improvement so that someday this could find itself into contrib/. Cheers, r --------------------org-phone.el-------------------- ;;;--------------------------------------------------------------------------- ;;; 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.01 ;; 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 'skype-call "The Emacs function to be used to call a phone number." :group 'org-link :type 'symbol) (defcustom org-skype-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 skype-call (phone-number) (shell-command (format "%s %s" org-skype-command 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) --------------------skype-call-------------------- #!/bin/sh command="CALL $1" osascript -e 'tell application "Skype"' \ -e "send command \"${command}\" script name \"skype-call\"" \ -e 'end tell'