Doc new features

This commit is contained in:
Greg Sexton 2015-08-22 12:49:46 +01:00
parent 9a0722e052
commit b4ff0c40f6

View File

@ -163,10 +163,10 @@ surprisingly well for most major-modes and is great for folding text.
It should be trivial to add support for any language that uses braces It should be trivial to add support for any language that uses braces
to delimit blocks. Just add to `origami-parser-alist` something like: to delimit blocks. Just add to `origami-parser-alist` something like:
`(mode-name . origami-c-style-parser)`. Adding support for another `(mode-name . origami-c-style-parser)`. Adding support for another
lisp dialect should be almost as simple. With a little bit of effort lisp dialect should be almost as simple. You can also easily define a
it shouldn't be too hard to create a parser for anything with start parser for anything with start and end delimiters (similar to braces).
and end delimiters (similar to braces). See the Use the `origami-markers-parser` function for this. There's an example
`origami-c-style-parser` function for how to define this. defined for triple-braces in `origami-parser-alist`.
I'm happy to work on parsers for other languages if interest is I'm happy to work on parsers for other languages if interest is
expressed. Cut an issue and I'll see what I can do. expressed. Cut an issue and I'll see what I can do.
@ -188,6 +188,15 @@ While I work on writing better documentation for parsing, I suggest
starting by looking at the current parsers in origami-parsers.el to starting by looking at the current parsers in origami-parsers.el to
see how they work. see how they work.
# Can I override the folding parser for an individual file?
You most certainly can. Just add a buffer-local variable that
references a key in `origami-parser-alist`. Something like:
;; -*- origami-fold-style: triple-braces -*-
This will add fold-marker support to that file.
# How is this different from [yafolding](https://github.com/zenozeng/yafolding.el)? # How is this different from [yafolding](https://github.com/zenozeng/yafolding.el)?
I wasn't aware of yafolding before writing this. It looks like origami I wasn't aware of yafolding before writing this. It looks like origami
@ -209,12 +218,11 @@ folding operations easy.
# How is this different from [folding.el](http://www.emacswiki.org/emacs/folding.el)? # How is this different from [folding.el](http://www.emacswiki.org/emacs/folding.el)?
Folding.el uses markers in the buffer to annotate folds. It should be Folding.el uses markers in the buffer to annotate folds. Origami also
very easy to add support for this to origami if anyone is looking for supports this and more.
this feature?
# How is this different from folding implemented by a specific mode? # How is this different from folding implemented by a specific mode?
It's general purpose and concentrates only on providing a decent It's general purpose and concentrates only on providing a great
folding solution. You need only write a parser for origami to get all folding solution. You need only write a parser for origami to get all
of its folding features for free. of its fold-manipulating features for free.