jinja.el: replace obsolete mumamo-find-possible-chunk with mumamo-quick-chunk-forward . This allows jinja mode to be used with nxhtml mode versions later than 2.07.
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Kanak Kshetri · committed by Armin Ronacher · parent 75ffeb6 · Browse files · 1 file·+9 added−94 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Trailers
- Signed-off-by: Armin Ronacher <armin.ronacher@active-4.com>
Diff stats
1 file+9 added−94 removed
- other:+9 added−94 removed
Provenance
- Commit
e68d4c6- Tree
6d829e8- Author
Kanak Kshetri <kanakkshetri@fastmail.fm>- Committer
Armin Ronacher <armin.ronacher@active-4.com>- Parent
75ffeb6
1 file changed+9 added−94 removed
modified:ext/jinja.el+9 added-94 removed
78 unmodified lines79 ;;(set (make-local-variable 'comment-end) "#}")80 (setq font-lock-defaults '(jinja-font-lock-keywords)))81 82 ;; mumamo stuff83-83 (when (require 'mumamo nil t)84 86- (defun mumamo-chunk-jinja3(pos min max)87- "Find {# ... #}. Return range and `jinja-mode'.88-See `mumamo-find-possible-chunk' for POS, MIN and MAX."89- (mumamo-find-possible-chunk pos min max90- 'mumamo-search-bw-exc-start-jinja391- 'mumamo-search-bw-exc-end-jinja392- 'mumamo-search-fw-exc-start-jinja393- 'mumamo-search-fw-exc-end-jinja3))85+ (defun mumamo-chunk-jinja3 (pos max)86+ "Find {# ... #}"87+ (mumamo-quick-chunk-forward pos max "{#" "#}" 'borders 'jinja-mode))88 95- (defun mumamo-chunk-jinja2(pos min max)96- "Find {{ ... }}. Return range and `jinja-mode'.97-See `mumamo-find-possible-chunk' for POS, MIN and MAX."98- (mumamo-find-possible-chunk pos min max99- 'mumamo-search-bw-exc-start-jinja2100- 'mumamo-search-bw-exc-end-jinja2101- 'mumamo-search-fw-exc-start-jinja2102- 'mumamo-search-fw-exc-end-jinja2))89+ (defun mumamo-chunk-jinja2 (pos max)90+ "Find {{ ... }}"91+ (mumamo-quick-chunk-forward pos max "{{" "}}" 'borders 'jinja-mode))92 104- (defun mumamo-chunk-jinja (pos min max)105- "Find {% ... %}. Return range and `jinja-mode'.106-See `mumamo-find-possible-chunk' for POS, MIN and MAX."107- (mumamo-find-possible-chunk pos min max108- 'mumamo-search-bw-exc-start-jinja109- 'mumamo-search-bw-exc-end-jinja110- 'mumamo-search-fw-exc-start-jinja111- 'mumamo-search-fw-exc-end-jinja))93+ (defun mumamo-chunk-jinja (pos max)94+ "Find {% ... %}"95+ (mumamo-quick-chunk-forward pos max "{%" "%}" 'borders 'jinja-mode))96 113- (defun mumamo-search-bw-exc-start-jinja (pos min)114- "Helper for `mumamo-chunk-jinja'.115-POS is where to start search and MIN is where to stop."116- (let ((exc-start (mumamo-chunk-start-bw-str-inc pos min "{%")))117- (and exc-start118- (<= exc-start pos)119- (cons exc-start 'jinja-mode))))120-121- (defun mumamo-search-bw-exc-start-jinja2(pos min)122- "Helper for `mumamo-chunk-jinja2'.123-POS is where to start search and MIN is where to stop."124- (let ((exc-start (mumamo-chunk-start-bw-str-inc pos min "{{")))125- (and exc-start126- (<= exc-start pos)127- (cons exc-start 'jinja-mode))))128-129- (defun mumamo-search-bw-exc-start-jinja3(pos min)130- "Helper for `mumamo-chunk-jinja3'.131-POS is where to start search and MIN is where to stop."132- (let ((exc-start (mumamo-chunk-start-bw-str-inc pos min "{#")))133- (and exc-start134- (<= exc-start pos)135- (cons exc-start 'jinja-mode))))136-137- (defun mumamo-search-bw-exc-end-jinja (pos min)138- "Helper for `mumamo-chunk-jinja'.139-POS is where to start search and MIN is where to stop."140- (mumamo-chunk-end-bw-str-inc pos min "%}"))141-142- (defun mumamo-search-bw-exc-end-jinja2(pos min)143- "Helper for `mumamo-chunk-jinja2'.144-POS is where to start search and MIN is where to stop."145- (mumamo-chunk-end-bw-str-inc pos min "}}"))146-147- (defun mumamo-search-bw-exc-end-jinja3(pos min)148- "Helper for `mumamo-chunk-jinja3'.149-POS is where to start search and MIN is where to stop."150- (mumamo-chunk-end-bw-str-inc pos min "#}"))151-152- (defun mumamo-search-fw-exc-start-jinja (pos max)153- "Helper for `mumamo-chunk-jinja'.154-POS is where to start search and MAX is where to stop."155- (mumamo-chunk-start-fw-str-inc pos max "{%"))156-157- (defun mumamo-search-fw-exc-start-jinja2(pos max)158- "Helper for `mumamo-chunk-jinja2'.159-POS is where to start search and MAX is where to stop."160- (mumamo-chunk-start-fw-str-inc pos max "{{"))161-162- (defun mumamo-search-fw-exc-start-jinja3(pos max)163- "Helper for `mumamo-chunk-jinja3'.164-POS is where to start search and MAX is where to stop."165- (mumamo-chunk-start-fw-str-inc pos max "{#"))166-167- (defun mumamo-search-fw-exc-end-jinja (pos max)168- "Helper for `mumamo-chunk-jinja'.169-POS is where to start search and MAX is where to stop."170- (mumamo-chunk-end-fw-str-inc pos max "%}"))171-172- (defun mumamo-search-fw-exc-end-jinja2(pos max)173- "Helper for `mumamo-chunk-jinja2'.174-POS is where to start search and MAX is where to stop."175- (mumamo-chunk-end-fw-str-inc pos max "}}"))176-177- (defun mumamo-search-fw-exc-end-jinja3(pos max)178- "Helper for `mumamo-chunk-jinja3'.179-POS is where to start search and MAX is where to stop."180- (mumamo-chunk-end-fw-str-inc pos max "#}"))181-97 ;;;###autoload98 (define-mumamo-multi-major-mode jinja-html-mumamo99 "Turn on multiple major modes for Jinja with main mode `html-mode'.100 This also covers inlined style and javascript."28 unmodified lines