This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; -*- lexical-binding: t -*- | |
(defmacro with-process-shell-command (name buffer command &rest sentinel-forms) | |
`(let ((proc (start-process-shell-command ,name ,buffer ,command))) | |
(let ((sentinel-cb (lambda (process signal) | |
,@sentinel-forms))) | |
(set-process-sentinel proc sentinel-cb) | |
))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; creole.el --- A parser for the Creole Wiki language | |
;;; Copyright (C) 2011 by Nic Ferrier | |
;;; Commentary: | |
;; This is a WikiCreole wiki parser. WikiCreole is something like the | |
;; Wiki language used by OddMuse, which is the EmacsWiki wiki | |
;; language. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro with-process-shell-command (command buffer-or-filter &rest forms) | |
"Run COMMAND through /in the BUFFER-OR-FILTER using FORMS as the sentinel. | |
FORMS is a 'cond' like you'd use in a sentinel, for example: | |
(with-process-shell-command \"ls\" some-buffer | |
((equal signal \"finished\\n\") | |
;; Clean up? | |
(with-current-buffer (get-buffer \"* log *\") | |
(insert \"some text\\\n\"))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro worker-elisp (output-stream &rest lisp) | |
"Evaluate the LISP in a child Emacs sending output to OUTPUT-STREAM. | |
The child Emacs has a 'load-path' exactly as the 'load-path' of | |
the parent Emacs at execution. | |
The OUTPUT-STREAM could be a buffer, a function or a process. | |
If the OUTPUT-STREAM is a process it may have a process property |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun ispell-lookup (word) | |
(interactive "Mword: ") | |
(with-current-buffer (get-buffer-create "* ispell-lookup *") | |
(erase-buffer) | |
(insert word) | |
(goto-char (point-min)) | |
(switch-to-buffer-other-window (current-buffer)) | |
(ispell-word))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro elnode-worker-elisp (output-stream &rest body) | |
"Evaluate the BODY in a child Emacs connected to OUTPUT-STREAM. | |
The child Emacs has a 'load-path' exactly as the 'load-path' of | |
the parent Emacs at execution. | |
The created child Emacs process is returned. It's possible to | |
kill the child Emacs process or do other things to it directly. | |
This could be very dangerous however, you should know what you | |
are doing before attempting it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun pinboard-get () | |
"A little function to retrieve pinboard.in into a buffer. | |
The buffer is *pinboard*. We don't even switch to it." | |
(interactive) | |
(url-retrieve | |
"https://api.pinboard.in/v1/posts/all/?format=json" | |
(lambda (status &rest args) | |
(save-excursion | |
(re-search-forward "^$" nil 't) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; wikiengine.el --- a WIKI engine -*- lexical-binding: t -*- | |
;; Copyright (C) 2011 Nic Ferrier | |
;; Author: Nic Ferrier - <nferrier@ferrier.me.uk> | |
;; Version: 0.1 | |
;; Keywords: hypermedia | |
;; 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(progn (setq load-path (quote ("/home/nferrier/.emacs.d/elpa/ahg-0.99" "/home/nferrier/.emacs.d/elpa/chess-1.96" "/home/nferrier/.emacs.d/elpa/creole-0.6.1" | |
"/home/nferrier/.emacs.d/elpa/elnode-0.9"))) (let ((target "/home/nferrier/wiki/README.creole") (header "<div id='top'></div>") (footer "<div id='footer'> | |
<form action='/wiki/' method='POST'> | |
<textarea name='wikitext'> | |
{{text}} | |
</textarea> | |
<input type='submit' name='send' value='send'/> | |
<input type='submit' name='preview' value='preview'/> | |
</form> | |
</div>")) (progn (require (quote creole)) (creole-wiki target :destination t :body-header header :body-footer footer)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_config(repo, rev=None): | |
"""Get the config from the veh root. | |
We try and work out what version control system is being used from | |
the location of the veh config file. | |
We currently only support Mercurial and GIT. | |
The veh.conf MUST exist in the file system though we might read a | |
completly different version of course.""" |
OlderNewer