Overview
Atlassian has a wiki called Confluence. This Emacs extension allows you to interact with Confluence from Emacs.
Some of the features it supports are:
- creating and editing pages
- executing Wiki search
- diffing your buffer versus the current page in the wiki
- the following of links beneath the cursor (point)
- an etags like history navigation (push/pop)
- viewing/editing of labels
- viewing/downloading of attachments
- the quick-start describes how to use LongLines mode, which makes editing the wiki-markup much more pleasant.
- much, much more...
Setting Up Confluence
Before you can use this mode to interact with your Confluence installation, you will need your Confluence (system) administrator to enable the xml-rpc interface within Confluence. Currently confluence-el support http and does not support https.
More information about the xml-rpc api is available at the Atlassian Confluence Website.
Quick Start
;; assuming confluence.el and xml-rpc.el are in your load path
(require 'confluence)
;; note, all customization must be in *one* custom-set-variables block
(custom-set-variables
;; ... other custimization
;; confluence customization
'(confluence-url "http://intranet/confluence/rpc/xmlrpc")
'(confluence-default-space-alist (list (cons confluence-url "your-default-space-name"))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; confluence editing support (with longlines mode)
(autoload 'confluence-get-page "confluence" nil t)
(eval-after-load "confluence"
'(progn
(require 'longlines)
(progn
(add-hook 'confluence-mode-hook 'longlines-mode)
(add-hook 'confluence-before-save-hook 'longlines-before-revert-hook)
(add-hook 'confluence-before-revert-hook 'longlines-before-revert-hook)
(add-hook 'confluence-mode-hook '(lambda () (local-set-key "\C-j" 'confluence-newline-and-indent))))))
;; LongLines mode: http://www.emacswiki.org/emacs-en/LongLines
(autoload 'longlines-mode "longlines" "LongLines Mode." t)
(eval-after-load "longlines"
'(progn
(defvar longlines-mode-was-active nil)
(make-variable-buffer-local 'longlines-mode-was-active)
(defun longlines-suspend ()
(if longlines-mode
(progn
(setq longlines-mode-was-active t)
(longlines-mode 0))))
(defun longlines-restore ()
(if longlines-mode-was-active
(progn
(setq longlines-mode-was-active nil)
(longlines-mode 1))))
;; longlines doesn't play well with ediff, so suspend it during diffs
(defadvice ediff-make-temp-file (before make-temp-file-suspend-ll
activate compile preactivate)
"Suspend longlines when running ediff."
(with-current-buffer (ad-get-arg 0)
(longlines-suspend)))
(add-hook 'ediff-cleanup-hook
'(lambda ()
(dolist (tmp-buf (list ediff-buffer-A
ediff-buffer-B
ediff-buffer-C))
(if (buffer-live-p tmp-buf)
(with-current-buffer tmp-buf
(longlines-restore))))))))
;; keybindings (change to suit)
;; open confluence page
(global-set-key "\C-xwf" 'confluence-get-page)
;; setup confluence mode
(add-hook 'confluence-mode-hook
'(lambda ()
(local-set-key "\C-xw" confluence-prefix-map)))