<<< Current version is 0.18 -- Vivek Dasmohapatra >>>
unity.el
unity.el is an emacs mode for editing Unity Wiki pages from the comfort and safety of emacs. It fetches the text for you to edit, provides syntax highlighting and a few functions to help with editing tables, and saves the pages back to the wiki when you're done.
emacs22 a couple of minor tweaks may be required when using unity.el under emacs22. I suspect I am the only user, but if you want to try it, drop me a line.
M-x unity-edit lets you edit a page (just enter PageName or page name when prompted)
M-x unity-save uploads said page to the wiki.
Normally unity.el should kill your old buffer when you save, but I have added code so that if a collision is detected, the old buffer hangs around and a new unity edit buffer is created, so that you can compare your version with the current page (eg with M-x ediff-buffers).
You can edit more than one page at a time, cutting and pasting between page and graveyard (or between pages) should work fine, there's no magic there.
You cannot currently save the buffer to a file and reopen it later for editing, I suppose I could add that, if people wanted.
Installation
See the source of unity dot el for the file.
Ok, the wiki kind of choked on that. It appears to have created an uneditable page. I'll put it up on http://rtfm.etla.org/emacs/unity.el instead.
Copy unity.el to somewhere suitable, say ~/lib/emacs/unity.el and then add the following to your ~/.emacs:
(load-library "~/lib/emacs/unity.el")
Alternatively, if ~/lib/emacs is already in your load path:
(load-library "unity.el")
or
(require 'unity)
unity.el uses the emacs url libraries to fetch and save unity pages.
At the time of writing, you could get these in the following ways:
- install the w3 package if you are using a released emacs (emacs21) (this is what I do)
- download from CVS at subversions.gnu.org using the commands
cvs -z3 -d :pserver:anoncvs@subversions.gnu.org:/home/cvs login
cvs -z3 -d :pserver:anoncvs@subversions.gnu.org:/home/cvs checkout url
- download from cvs at savannah.gnu.org
- use a CVS (ie current development) copy of emacs, which includes the libraries
Keybindings
C-c C-f
- M-x unity-follow: follow the unity link at the current position.
C-c C-c or C-x C-s
- M-x unity-save: upload the current page content and graveyard to the wiki.
C-c t r
- M-x unity-table-add-row: add a row after the current row in the table, or at the end of the table if we are on the line after the last table row.
Uses the forst row as a header line to put in clue-markers in each new cell, so you can see what content to add more easily.
C-c t c
- M-x unity-table-add-column: add a column to a table, either efter the current column or at the beginning or end of the table if that is where we are currently located. If there are rows with too few cells, they will be padded with placeholder cells to the required minimum length.
C-c t k
- M-x unity-table-del-column: remove the current (or first) table column as appropriate.
C-c t TAB
- M-x unity-table-align: tidy up the current table and try to align it to some reasonable degree.
C-c t ?
- M-x unity-table-whereami: tells you where in the table you are (ie column number and title, if any).
C-c d i
- M-x unity-idiff: interactively go through the differences between the original and current contents of the buffer in ediff.
C-c d =
- M-x unity-diff: show a unified diff of the changes you have made in the current unity buffer.
<<< This currently leaves a couple of temporary files lying around in /tmp,
apologies for the untidiness. -- Vivek Dasmohapatra >>>
<
Bound to unity-electric-maybe-comment : If you set unity-electric-comments to on (M-x customize RET unity-electric-comments RET) then a "<<<" sequence will result in an automatic " -- [Your Name]>>>" being inserted.
Syntax-Highlighting
unity.el understands the bold and italic markup. It also groks wiki words and square bracketed links, [ [ macros ] ], table markup and comments. And anchors. And links to anchors. And horizontal dividers.
Planned-commands
Um. I finished all the commands I planned. Suggestions welcome.
!!!Planned-features
Also done.
Notes
The syntax highlighting is not perfect, (I don't think it copes with comments wrapped around table rows) but I don't have a canonical syntax for the wiki, so I guess it's fine as it is.
Version 0.17 uploads text as utf-8, so pretty much all characters should be covered. (There are some limitations with composed character sets but this seems to be a browser/ui limitation rather than anything to do with unity.el or emacs per se.
UTF-8 |
what is it? |
Þ |
Thorn |
æ |
ae ligature |
Æ |
AE ligature |
か |
hiragana ka syllable |
ø |
my sister was bitten by a møøse once |
Œ |
OE ligature |
悪 |
kanji aku |
विवेक |
somewhat unlikely to render, indic support is weak |
שנבג |
some hebrew |
¥¤€£ |
yen, currency, euro, pound |
®© |
registered, copyright |