-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 10/06/12 14:39, Éibhear wrote:
> Hi,
>> On my Nokia N900 (yes, still have it, and still love it...), I use
> emacs' org-mode heavily. If we enter a web address into the org
> file in the correct format (e.g. [[http://www.linux.ie/][ILUG]]),
> it's represented in org-mode as a clickable link. When tapped, it
> launches the web browser and goes to the address.
>> At the same time, the browser has a handler for the "tel:"
> protocol (e.g. "<a href="tel:1890365365">Banking 365</a>"), which
> launches the 'phone dialler. By tapping on the link in the web
> browser, we're presented with the 'phone dialler with the number
> pre-filled in. All that's left to do is to tap on the "Call"
> button.
>> Looking at http://wiki.maemo.org/Phone_control, I know the DBUS
> command for launching the 'phone dialler with a number pre-filled.
>> What I can't find, though, is documentation on setting up a new
> protocol handler for org-mode, or a description by anyone else on
> setting up org-mode on the N900 to correctly handle "tel:" links
> (e.g. "[[tel:1890365365][Banking 365]]").
>> Any suggestions?
>> Thanks,
>> Éibhear
>
Hi,
Following Brendan's suggestion, here's what I ended up doing:
* I created a function that is loaded at init-time (i.e. sourced
through .emacs) as follows:
(defun N900-dial-number (the-number)
"To send a number to the N900's 'phone application to dial it"
(shell-command
(concat "dbus-send --type=method_call "
"--dest=com.nokia.CallUI "
"/com/nokia/CallUI "
"com.nokia.CallUI.CreateCall "
"string:\"tel:" the-number "\""
)
)
)
* I customised org-link-abbrev-alist to include
("tel" . "elisp:(N900-dial-number \"%s\")")
as an entry to abbreviate "tel:" references.
Now I can add "links" into my org-mode files of the format
[[tel:1890365365][Banking365]], and emacs will ask me to confirm this,
and when I tap "yes", then I'll get the dialler with the number
pre-filled.
The request for confirmation is a security measure to prevent
executable links in org-mode being maliciously placed into the file
and hidden (e.g. [[shell:rm -rf /*][ILUG website]]), and this is fine
with me. It can be customised away, though.
Aside from Brendan's suggestion (which I should have thought of
myself!), all the information for the above came from chapter 4
(Hyperlinks) from the org-mode manual (http://orgmode.org/org.pdf).
Éibhear
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk/V9BQACgkQ0ST+nPIXcQYghwCfXw8pTRBW5tIerKp50YFdCusy
Xv8AnA1TOSLsllCfdNJZqZxH3OcO0dlD
=TKQ9
-----END PGP SIGNATURE-----
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!