[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/jinja2-mode 2dc43224b2 09/57: Now kw are function and user
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/jinja2-mode 2dc43224b2 09/57: Now kw are function and user can define user kw list |
Date: |
Mon, 17 Jan 2022 05:58:23 -0500 (EST) |
branch: elpa/jinja2-mode
commit 2dc43224b258f1ee69e526473bbe76ce92f327c8
Author: Florian Mounier <florian.mounier@kozea.fr>
Commit: Florian Mounier <florian.mounier@kozea.fr>
Now kw are function and user can define user kw list
---
jinja2.el | 56 +++++++++++++++++++++++++++++++-------------------------
1 file changed, 31 insertions(+), 25 deletions(-)
diff --git a/jinja2.el b/jinja2.el
index 39e4239f9e..5b1365ca77 100644
--- a/jinja2.el
+++ b/jinja2.el
@@ -26,18 +26,25 @@
(require 'sgml-mode)
-(defconst jinja2-closing-keywords
- '(
- "if" "for" "block" "filter" "with"
- "raw" "macro" "autoescape" "trans" "call"
- ;; Hydra specific
- "auth" "showonmatch" "errorproof"))
+(if (not (boundp 'jinja2-user-keywords))
+ (setq jinja2-user-keywords nil))
+(if (not (boundp 'jinja2-user-functions))
+ (setq jinja2-user-functions nil))
+
+(defun jinja2-closing-keywords ()
+ (append
+ jinja2-user-keywords
+ '(
+ "if" "for" "block" "filter" "with"
+ "raw" "macro" "autoescape" "trans" "call"
+ )))
-(defconst jinja2-indenting-keywords
- (append jinja2-closing-keywords
- '("else" "elif" )))
+(defun jinja2-indenting-keywords ()
+ (append
+ (jinja2-closing-keywords)
+ '("else" "elif" )))
-(defconst jinja2-builtin-keywords
+(defun jinja2-builtin-keywords ()
'(
"as" "autoescape" "debug" "extends"
"firstof" "in" "include" "load"
@@ -50,8 +57,11 @@
"context" "with" "without" "ignore"
"missing" "scoped"))
-(defconst jinja2-functions-keywords
- '(
+(defun jinja2-functions-keywords ()
+ (message "CALLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL")
+ (append
+ jinja2-user-functions
+ '(
"abs" "attr" "batch" "capitalize"
"center" "default" "dictsort"
"escape" "filesizeformat" "first"
@@ -63,11 +73,7 @@
"sort" "string" "striptags" "sum"
"title" "trim" "truncate" "upper"
"urlize" "wordcount" "wordwrap" "xmlattr"
- ;; Hydra specific
- "date_format" "money_format"
- "money_format_no_currency" "sublength"
- "json" "percent_format" "person_title"
- "mail_format" "sort_by" "split"))
+ )))
(defun jinja2-find-open-tag ()
(if (search-backward-regexp
@@ -78,7 +84,7 @@
"end"))
(group
,(append '(or)
- jinja2-closing-keywords
+ (jinja2-closing-keywords)
))
(group
(*? anything))
@@ -147,7 +153,7 @@
(,(rx-to-string `(and (group "|" (* whitespace))
(group
,(append '(or)
- jinja2-functions-keywords
+ (jinja2-functions-keywords)
))))
(1 font-lock-keyword-face t)
(2 font-lock-function-name-face t)
@@ -155,12 +161,12 @@
(,(rx-to-string `(and word-start
(? "end")
,(append '(or)
- jinja2-indenting-keywords
+ (jinja2-indenting-keywords)
)
word-end)) (0 font-lock-keyword-face))
(,(rx-to-string `(and word-start
,(append '(or)
- jinja2-builtin-keywords
+ (jinja2-builtin-keywords)
)
word-end)) (0 font-lock-builtin-face))
@@ -205,12 +211,12 @@
(progn
(save-excursion
(forward-line -1)
- (if (looking-at (concat "^[ \t]*{% *.*?{% *end" (regexp-opt
jinja2-indenting-keywords)))
+ (if (looking-at (concat "^[ \t]*{% *.*?{% *end" (regexp-opt
(jinja2-indenting-keywords))))
(progn
(setq cur-indent (current-indentation))
;; (message (format "Jinja_No1] jinja : %d sgml : %d"
cur-indent html-indentation ))
)
- (if (looking-at (concat "^[ \t]*{% *" (regexp-opt
jinja2-indenting-keywords)))
+ (if (looking-at (concat "^[ \t]*{% *" (regexp-opt
(jinja2-indenting-keywords))))
(setq cur-indent (current-indentation))
(setq cur-indent (- (current-indentation) indent-width)))
;; (message (format "Jinja_end1] jinja : %d sgml : %d" cur-indent
html-indentation ))
@@ -231,12 +237,12 @@
(setq cur-indent (current-indentation))
;; (message (format "Jinja_end2] jinja : %d sgml : %d"
cur-indent html-indentation ))
(setq not-indented nil))
- (if (looking-at (concat "^[ \t]*{% *.*?{% *end" (regexp-opt
jinja2-indenting-keywords)))
+ (if (looking-at (concat "^[ \t]*{% *.*?{% *end" (regexp-opt
(jinja2-indenting-keywords))))
(progn
(setq cur-indent (current-indentation))
;; (message (format "Jinja_No] jinja : %d sgml : %d"
cur-indent html-indentation ))
(setq not-indented nil))
- (if (looking-at (concat "^[ \t]*{% *" (regexp-opt
jinja2-indenting-keywords))) ; Check start tag
+ (if (looking-at (concat "^[ \t]*{% *" (regexp-opt
(jinja2-indenting-keywords)))) ; Check start tag
(progn
(setq cur-indent (+ (current-indentation) indent-width))
;; (message (format "Jinja_open] jinja : %d sgml : %d"
cur-indent html-indentation ))
- [nongnu] elpa/jinja2-mode a598357069 56/57: Bump version to 0.3, (continued)
- [nongnu] elpa/jinja2-mode a598357069 56/57: Bump version to 0.3, ELPA Syncer, 2022/01/17
- [nongnu] elpa/jinja2-mode 03e5430a7e 57/57: Merge pull request #23 from skangas/bump-version, ELPA Syncer, 2022/01/17
- [nongnu] elpa/jinja2-mode 5ac022d688 51/57: Merge pull request #17 from yafeunteun/master, ELPA Syncer, 2022/01/17
- [nongnu] elpa/jinja2-mode 9fff9d22b0 46/57: Indent buffer on save, ELPA Syncer, 2022/01/17
- [nongnu] elpa/jinja2-mode 954a810732 36/57: Merge pull request #6 from sindikat/master, ELPA Syncer, 2022/01/17
- [nongnu] elpa/jinja2-mode c8ba3b7274 50/57: Merge pull request #15 from EdwardBetts/spelling, ELPA Syncer, 2022/01/17
- [nongnu] elpa/jinja2-mode 6fe1c59b6a 45/57: correct spelling mistake, ELPA Syncer, 2022/01/17
- [nongnu] elpa/jinja2-mode 832c03e0a2 35/57: elpa compatibility, ELPA Syncer, 2022/01/17
- [nongnu] elpa/jinja2-mode 67ab5f0bb4 14/57: Add tags insertion, ELPA Syncer, 2022/01/17
- [nongnu] elpa/jinja2-mode bbfe9b4940 30/57: Add logic operators, ELPA Syncer, 2022/01/17
- [nongnu] elpa/jinja2-mode 2dc43224b2 09/57: Now kw are function and user can define user kw list,
ELPA Syncer <=
- [nongnu] elpa/jinja2-mode c2d801ad8e 21/57: fix indentation bug, ELPA Syncer, 2022/01/17
- [nongnu] elpa/jinja2-mode a6e6574441 37/57: Consider quote as quote, ELPA Syncer, 2022/01/17
- [nongnu] elpa/jinja2-mode 97dacbedac 15/57: Add indent on insert tags, ELPA Syncer, 2022/01/17
- [nongnu] elpa/jinja2-mode 40c5ef2efa 23/57: Fuck tab, ELPA Syncer, 2022/01/17
- [nongnu] elpa/jinja2-mode 159558e0bb 54/57: Indent on save only when enabled, default disabled, ELPA Syncer, 2022/01/17
- [nongnu] elpa/jinja2-mode b3e564bfef 40/57: Fix uncomment, ELPA Syncer, 2022/01/17
- [nongnu] elpa/jinja2-mode 487b95f0d4 20/57: Merge pull request #1 from amirouche/master, ELPA Syncer, 2022/01/17
- [nongnu] elpa/jinja2-mode 757e3fa162 25/57: Add defcustom for kw and fun, ELPA Syncer, 2022/01/17
- [nongnu] elpa/jinja2-mode 985c538160 28/57: Add comment command, ELPA Syncer, 2022/01/17
- [nongnu] elpa/jinja2-mode ab077df663 24/57: Support whitespace tag syntax, ELPA Syncer, 2022/01/17