diff --git a/origami-parsers.el b/origami-parsers.el index 817baa3..041c78b 100644 --- a/origami-parsers.el +++ b/origami-parsers.el @@ -47,7 +47,8 @@ (python-mode . origami-indent-parser) (emacs-lisp-mode . origami-elisp-parser) (lisp-interaction-mode . origami-elisp-parser) - (clojure-mode . origami-clj-parser)) + (clojure-mode . origami-clj-parser) + (triple-braces . origami-triple-braces-parser)) "alist mapping major-mode to parser function." :type 'hook :group 'origami) @@ -217,6 +218,11 @@ position in the CONTENT." (defun origami-clj-parser (create) (origami-lisp-parser create "(def\\(\\w\\|-\\)*\\s-*\\(\\s_\\|\\w\\|[?!]\\)*\\([ \\t]*\\[.*?\\]\\)?")) +(defun origami-triple-braces-parser (create) + (lambda (content) + (let ((positions (origami-get-positions content "{{{\\|}}}"))) + (origami-build-pair-tree create "{{{" "}}}" positions)))) + (provide 'origami-parsers) ;;; origami-parsers.el ends here diff --git a/origami.el b/origami.el index 412cf2d..3f34f79 100644 --- a/origami.el +++ b/origami.el @@ -380,7 +380,9 @@ was last built." -last-item origami-fold-data) (origami-create-overlay beg end offset buffer))))))) - (-when-let (parser-gen (or (cdr (assoc (buffer-local-value 'major-mode buffer) + (-when-let (parser-gen (or (cdr (assoc (if (local-variable-p 'origami-fold-style) + (buffer-local-value 'origami-fold-style buffer) + (buffer-local-value 'major-mode buffer)) origami-parser-alist)) 'origami-indent-parser)) (funcall parser-gen create))))