Emacs stuff for wiki editting pasted by mario-goulart on Wed Jun 15 16:58:05 2011

(defmacro cw-open/close-tag (command open-tag close-tag)
  `(defun ,command (beg end)
     (interactive "r")
     (let ((start-tag ,open-tag)
	   (end-tag ,close-tag))
       (save-excursion
	 (goto-char beg)
	 (insert start-tag)
	 (goto-char (+ end (length start-tag)))
	 (insert end-tag)))))

(cw-open/close-tag cw-enscript-scheme "<enscript highlight=scheme>\n" "</enscript>\n")
(cw-open/close-tag cw-enscript-elisp "<enscript highlight=elisp>\n" "</enscript>\n")
(cw-open/close-tag cw-enscript-c "<enscript highlight=c>\n" "</enscript>\n")
(cw-open/close-tag cw-procedure "<procedure>" "</procedure>")
(cw-open/close-tag cw-constant "<constant>" "</constant>")
(cw-open/close-tag cw-syntax "<syntax>" "</syntax>")

Now with a hairier macro and support to all tags pasted by mario-goulart on Wed Jun 15 22:35:25 2011

(defmacro chicken-wiki-define=command (command &optional open-tag close-tag)
  `(defun ,(intern (concat "chicken-wiki-" (symbol-name command))) (beg end)
     (interactive "r")
     (let ((start-tag ,(or open-tag
			   (concat "<" (symbol-name command) ">")))
	   (end-tag ,(or close-tag
			 (concat "</" (symbol-name command) ">"))))
       (save-excursion
	 (goto-char beg)
	 (insert start-tag)
	 (goto-char (+ end (length start-tag)))
	 (insert end-tag)))))

(chicken-wiki-define-command procedure)
(chicken-wiki-define-command macro)
(chicken-wiki-define-command parameter)
(chicken-wiki-define-command constant)
(chicken-wiki-define-command record)
(chicken-wiki-define-command string)
(chicken-wiki-define-command class)
(chicken-wiki-define-command method)
(chicken-wiki-define-command setter)
(chicken-wiki-define-command type)

(chicken-wiki-define-command highlight-scheme
			     "<enscript highlight=scheme>\n"
			     "</enscript>\n")

(chicken-wiki-define-command highlight-elisp
			     "<enscript highlight=elisp>\n"
			     "</enscript>\n")

(chicken-wiki-define-command highlight-c
			     "<enscript highlight=c>\n"
			     "</enscript>\n")

Emacs stuff without typo added by mario-goulart on Wed Jun 15 22:57:04 2011

(defmacro chicken-wiki-define-command (command &optional open-tag close-tag)
  `(defun ,(intern (concat "chicken-wiki-" (symbol-name command))) (beg end)
     (interactive "r")
     (let ((start-tag ,(or open-tag
			   (concat "<" (symbol-name command) ">")))
	   (end-tag ,(or close-tag
			 (concat "</" (symbol-name command) ">"))))
       (save-excursion
	 (goto-char beg)
	 (insert start-tag)
	 (goto-char (+ end (length start-tag)))
	 (insert end-tag)))))

(chicken-wiki-define-command procedure)
(chicken-wiki-define-command macro)
(chicken-wiki-define-command parameter)
(chicken-wiki-define-command constant)
(chicken-wiki-define-command record)
(chicken-wiki-define-command string)
(chicken-wiki-define-command class)
(chicken-wiki-define-command method)
(chicken-wiki-define-command setter)
(chicken-wiki-define-command type)

(chicken-wiki-define-command highlight-scheme
			     "<enscript highlight=scheme>\n"
			     "</enscript>\n")

(chicken-wiki-define-command highlight-elisp
			     "<enscript highlight=elisp>\n"
			     "</enscript>\n")

(chicken-wiki-define-command highlight-c
			     "<enscript highlight=c>\n"
			     "</enscript>\n")