To: jonathan.aquino@gmail.com Subject: calling Yubnub from Emacs From: Brad Collins Date: Mon, 20 Jun 2005 12:16:51 +0700 Jonathan/ Great app! Here is a trvial elisp function so that you can call yubnub from Emacs. To use it, paste the function below into your .emcas file and restart emacs. Then you can simply M-x yubnub. You will be prompted for the yubnub command. For example: M-x yubnub ls ge Your default external browser will then open and return the result. This has been tested on GNU Emacs both on Redhat and on Windows XP. I have only tested this on a fairly recent version of Emacs from CVS, so it may not work on older Emacsen which does not have "browse-url". You can change the default browser which browse-url uses by changing the variable browse-url-browser-function in customize. M-x customize-group browse-url Send suggestions, problems etc to Brad Collins -------- (defun yubnub (command) "Use `browse-url' to submits a command to yubnub and opens result in an external browser defined in `browse-url-browser-function'. To get started `M-x yubnub ls ' will return a list of all yubnub commands." (interactive "sCommand:") (browse-url (concat "http://yubnub.org/parser/parse?command=" command))) Cheers, b/ -- Brad Collins , Bangkok, Thailand To: jonathan.aquino@gmail.com Subject: adding yubnub:// links to Emacs Planner Pages From: Brad Collins Date: Mon, 20 Jun 2005 13:45:27 +0700 --=-=-= Jonathan/ Another rather trivial but useful yubnub hack for Emacs users... Emacs Planner Mode is a powerful application for project planning, managing tasks and keeping notes within Emacs. Planner-mode is based on Emacs-Wiki-Mode which is a application for creating and publishing a wiki from Emacs. One of the most powerful feature of emacs-wiki-mode is you can create new types of links. Included is "planner-yubnub.el" which allows you to create extended wiki hyper-links for yubnub commands: ;; To open open a request for comment (rfc) ;; [[yubnub://rfc 2252][See RFC2252]] ;; ;; To look up a domain name in the whois database: ;; [[yubnub://whois yubnub.org][whois database entry for yubnub.org]] ;; ;; To search for something in Google ;; [[yubnub://gg Charles Dickens][Google for Charles Dickens]] If you are using planner-mode the examples above will look like a href style hyper-links in a browser. For more information about planner mode -- use the yubnub command "ewiki PlannerMode" I will be sending this to the Planner Mode mailing list as well. If there is enough interest it will be included in a future release of planner. --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=planner-yubnub.el Content-Transfer-Encoding: 8bit Content-Description: planner-yubnub.el ;;; planner-yubnub.el --- Yubnub links for Emacs Planner ;; Copyright (C) 2005 Brad Collins ;; Author: Brad Collins ;; Maintainer: ;; Version: 20.06.2005 12:22 ;; Keywords: planner, url, yubnub ;; URL: ;; This file 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; either version 2, or (at your option) ;; any later version. ;; This file 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. ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. ;;; Commentary: ;; Allows you to use yubnub URL-commands as links within a planner page. ;; ;; Example: ;; ;; There are hundreds of yubnub commands, see ;; http://yubnub.org/parser/parse?command=ls to see a list of existing ;; commands. You can create your own commands if you don't see what you ;; need. ;; ;; ;; To open open a request for comment (rfc) ;; [[yubnub://rfc 2252][See RFC2252]] ;; ;; To look up a domain name in the whois database: ;; [[yubnub://whois yubnub.org][whois database entry for yubnub.org]] ;; ;; To search for something in Google ;; [[yubnub://gg Charles Dickens][search Google for Charles Dickens]] ;; ;; To install, place planner-yubnub.el where emacs can find it ;; and add (require 'planner-bxid) to your .emacs ;; ;; To search for a page in EmacsWiki wiki ;; [[yubnub://ewiki gnus][search for pages about gnus on EmacsWiki]] ;;; Code: (require 'planner) (add-to-list 'emacs-wiki-url-protocols '("yubnub" planner-yubnub-find nil)) (defun planner-yubnub-find (url) "If this is a yubnub URL-command, jump to it." ;; Remove the yubnub:// (setq yn-command (replace-regexp-in-string "yubnub://\\(.*\\)" "\\1" url)) (browse-url (concat "http://yubnub.org/parser/parse?command=" yn-command))) (provide 'planner-yubnub) ;;; planner-yubnub.el ends here --=-=-= Enjoy! Cheers, b/ -- Brad Collins , Bangkok, Thailand --=-=-=--