* Lisp Link type for Org mode
@ 2009-06-22 20:40 Jonathan Arkell
2009-06-22 22:35 ` Benjamin Andresen
0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Arkell @ 2009-06-22 20:40 UTC (permalink / raw)
To: emacs-orgmode@gnu.org
[-- Attachment #1: Type: text/plain, Size: 1017 bytes --]
Hey everyone
I've added a very simple link type to Org. This is descendent from Sacha Chua's lisp link plugin for planner, and works the same way.
This is a great way to make active buttons inside of your org mode files. I am not sure how well it would export however. I'm okay with it going into the org contrib directory, or being added to one or both of the contributed lisp eval files.
Enjoy!
Jonathan Arkell
Sr. Web Developer
Inspired by Drum + Bass, Scheme, Kawaii
402 - 11 Avenue SE
Calgary, AB T2G 0Y4
t: 403.206.4377
www.criticalmass.com
The information contained in this message is confidential. It is intended to be read only by the individual or entity named above or their designee. If the reader of this message is not the intended recipient, you are hereby notified that any distribution of this message, in any form, is strictly prohibited. If you have received this message in error, please immediately notify the sender and delete or destroy any copy of this message.
[-- Attachment #2: org-lisp-link.el --]
[-- Type: application/octet-stream, Size: 2325 bytes --]
;;; org-lisp-link.el --- Link for executing lisp on click
(defconst org-lisp-link-version "0.1")
;; Copyright (c)2008 Jonathan Arkell. (by)(nc)(sa) Some rights reserved.
;; Author: Jonathan Arkell <jonnay@jonnay.net>
;; This file is not part of GNU Emacs.
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation version 2.
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;; For a copy of the GNU General Public License, search the Internet,
;; or write to the Free Software Foundation, Inc., 59 Temple Place,
;; Suite 330, Boston, MA 02111-1307 USA
;;; Commentary:
;; This is decendent from Sacha Chua's lisp link plugin for planner
;;; Original Commentary:
;; Example:
;; [[lisp:/plan][Plan]] will be rendered as "Plan". Selecting the link
;; will run the plan function interactively.
;;
;; If the link is a lisp form it is evaluated non-interactively:
;; [[lisp:/(man "bash")][bash manual]] will be rendered as "bash
;; manual". Selecting the link will show the bash man page in Emacs.
;;; Contributors:
;; Gerd Flaig fixed the docstring for `planner-lisp-browse-url'.
;; Jim Ottaway made it such that if the URL like a lisp form, read and
;; evaluate it, otherwise call it interactively as before.
;;; Installation:
;; Put org-lisp-link.el somewhere in your load-path.
;; (Use M-x show-variable RET load-path to see what your load path is.)
;; Add this to your emacs init file.
;(require 'org-lisp-link)
;;; Commands:
;;
;; Below are complete command list:
;;
;;
;;; Customizable Options:
;;
;; Below are customizable option list:
;;
;;; CHANGELOG:
;; v 0.1 - Initial release
;;; Code:
(defun org-lisp-browse-url (url)
"If this is a LISP URL, evaluate it."
(if (string-match "\\`\\s-*\\((.+)\\)\\s-*\\'" url)
(eval (read (match-string 1 url)))
(eval (read (concat "(call-interactively '" url ")")))))
(org-add-link-type "lisp" 'org-lisp-browse-url)
(provide 'org-lisp-link)
;;; org-lisp-link ends here
[-- Attachment #3: Type: text/plain, Size: 204 bytes --]
_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Lisp Link type for Org mode
2009-06-22 20:40 Lisp Link type for Org mode Jonathan Arkell
@ 2009-06-22 22:35 ` Benjamin Andresen
2009-06-23 1:51 ` Jonathan Arkell
0 siblings, 1 reply; 3+ messages in thread
From: Benjamin Andresen @ 2009-06-22 22:35 UTC (permalink / raw)
To: Jonathan Arkell; +Cc: emacs-orgmode@gnu.org
Hey Jonathan,
Jonathan Arkell <jonathana@criticalmass.com> writes:
> Hey everyone
>
> I've added a very simple link type to Org. This is descendent from
> Sacha Chua's lisp link plugin for planner, and works the same way.
>
> This is a great way to make active buttons inside of your org mode
> files. I am not sure how well it would export however. I'm okay with
> it going into the org contrib directory, or being added to one or both
> of the contributed lisp eval files.
I think there is already something in org that does it.
Check (info "(org)External links") the linktype is called "elisp".
br,
benny
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: Lisp Link type for Org mode
2009-06-22 22:35 ` Benjamin Andresen
@ 2009-06-23 1:51 ` Jonathan Arkell
0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Arkell @ 2009-06-23 1:51 UTC (permalink / raw)
To: Benjamin Andresen; +Cc: emacs-orgmode@gnu.org
Aww Crap. How did I miss that. Whups. :/
-----Original Message-----
From: Benjamin Andresen [mailto:benny@in-ulm.de]
Sent: June 22, 2009 4:36 PM
To: Jonathan Arkell
Cc: emacs-orgmode@gnu.org
Subject: Re: Lisp Link type for Org mode
Hey Jonathan,
Jonathan Arkell <jonathana@criticalmass.com> writes:
> Hey everyone
>
> I've added a very simple link type to Org. This is descendent from
> Sacha Chua's lisp link plugin for planner, and works the same way.
>
> This is a great way to make active buttons inside of your org mode
> files. I am not sure how well it would export however. I'm okay with
> it going into the org contrib directory, or being added to one or both
> of the contributed lisp eval files.
I think there is already something in org that does it.
Check (info "(org)External links") the linktype is called "elisp".
br,
benny
The information contained in this message is confidential. It is intended to be read only by the individual or entity named above or their designee. If the reader of this message is not the intended recipient, you are hereby notified that any distribution of this message, in any form, is strictly prohibited. If you have received this message in error, please immediately notify the sender and delete or destroy any copy of this message.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-06-23 1:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-22 20:40 Lisp Link type for Org mode Jonathan Arkell
2009-06-22 22:35 ` Benjamin Andresen
2009-06-23 1:51 ` Jonathan Arkell
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).