emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jonathan Arkell <jonathana@criticalmass.com>
To: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Lisp Link type for Org mode
Date: Mon, 22 Jun 2009 16:40:06 -0400	[thread overview]
Message-ID: <7EA78739DB6FF044926304E83668BF8222D933D1@brewer.cmass.criticalmass.com> (raw)

[-- 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

             reply	other threads:[~2009-06-22 20:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-22 20:40 Jonathan Arkell [this message]
2009-06-22 22:35 ` Lisp Link type for Org mode Benjamin Andresen
2009-06-23  1:51   ` Jonathan Arkell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7EA78739DB6FF044926304E83668BF8222D933D1@brewer.cmass.criticalmass.com \
    --to=jonathana@criticalmass.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).