[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/jade-mode a22d4acd31 001/128: initial commit
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/jade-mode a22d4acd31 001/128: initial commit |
Date: |
Sat, 29 Jan 2022 08:24:41 -0500 (EST) |
branch: elpa/jade-mode
commit a22d4acd315acd36dce11d37276ceab9550f2ec0
Author: Brian Carlson <brian.m.carlson@gmail.com>
Commit: Brian Carlson <brian.m.carlson@gmail.com>
initial commit
---
example.jade | 21 +++++++++++++++++++
jade-mode.el | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 87 insertions(+)
diff --git a/example.jade b/example.jade
new file mode 100644
index 0000000000..f780219f0e
--- /dev/null
+++ b/example.jade
@@ -0,0 +1,21 @@
+!!!
+html
+ head
+ title My page
+ body.bp
+ #container
+ #header
+ h1.page-title= My.awesome. page #is awesome#
+ #nav
+ ul#nav_list something sweet
+ li
+ #content
+ #footer
+ #copywrite-text= locals
+
+
+
+
+
+
+
diff --git a/jade-mode.el b/jade-mode.el
new file mode 100644
index 0000000000..7b7ecf0f8a
--- /dev/null
+++ b/jade-mode.el
@@ -0,0 +1,66 @@
+;; copied from http://xahlee.org/emacs/elisp_syntax_coloring.html
+(require 'font-lock)
+
+(defvar jade-function-regexp "[A-Za-z]")
+(defvar jade-tab-width 2)
+
+(defun jade-debug (string &rest args)
+ "Prints a debug message"
+ (apply 'message (append (list string) args)))
+
+
+(defun jade-indent-line ()
+ "Indents current line"
+ (interactive)
+ (if (= (point) (point-at-bol))
+ (insert-tab)
+ (save-excursion
+ (let ((prev-indent 0) (cur-indent 0))
+ ;; Figure out the indentation of the previous line
+ (setq prev-indent)
+
+ ;; Figure out the current line's indentation
+ (setq cur-indent (current-indentation))
+
+ ;; Shift one column to the left
+ (beginning-of-line)
+ (insert-tab)
+
+ (when (= (point-at-bol) (point))
+ (forward-char 2))
+
+
+ ;; We're too far, remove all indentation.
+ ;; (when (> (- (current-indentation) prev-indent)
coffee-tab-width)
+ ;; (backward-to-indentation 0)
+ ;; (delete-region (point-at-bol) (point)))
+ ))))
+
+(setq jade-font-lock-keywords
+ `((,"!!!\\( \\(default\\|5\\|transitional\\)\\)?" .
font-lock-constant-face)
+ (,"#\\(\\w\\|_\\|-\\)*" . font-lock-type-face)
+ (,"\\.[A-Za-z0-9\-\_]*" . font-lock-function-name-face)
+ (,"^ *\\<\\([A-Za-z0-9]*\\)\\>" . font-lock-keyword-face)))
+
+
+;; mode declaration
+(define-derived-mode jade-mode fundamental-mode
+ "Jade"
+ "Major mode for editing jade node.js templates"
+ ;; ...
+ (kill-all-local-variables)
+ (setq tab-width 2)
+ ;; code for syntax highlighting
+ (setq major-mode 'jade-mode)
+
+
+ (setq font-lock-defaults '(jade-font-lock-keywords))
+ (setq mode-name "Jade")
+ (make-local-variable 'indent-line-function)
+ (setq indent-line-function 'jade-indent-line)
+ ;; no tabs
+ (setq indent-tabs-mode nil))
+
+(provide 'jade-mode)
+
+(add-to-list 'auto-mode-alist '("\\.jade$" . jade-mode))
- [nongnu] branch elpa/jade-mode created (now 1ad7c51f3c), ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 7a36edb480 002/128: added readme, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 63561e36f7 006/128: functional line indentation logic, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode f8b5b062a0 005/128: started work on electric tab, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 684a5c0fba 014/128: require whitespace-mode, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 63f6e54b85 013/128: define backtab for ubuntu, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode c6623ac6a6 021/128: added a basic stylus-mode, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 039b637cee 016/128: new blank line + single tab = full indent, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode b8778ae525 015/128: use builtin for moving point to beginning of text, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode de66308323 004/128: reboot, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode a22d4acd31 001/128: initial commit,
ELPA Syncer <=
- [nongnu] elpa/jade-mode a7c85da4df 048/128: Added single quoted strings support to stylus mode., ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 3db33f4642 050/128: Fixed sws-indent-line not detecting the use of tab indent, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode eea90de1df 038/128: Add support for keywords syntax coloring., ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode dd7becb0fb 062/128: Merge pull request #25 from gavinpc/patch-1, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 0eb59822bf 081/128: Merge pull request #35 from tjefferson08/add_new_comment_syntax, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 2e75549657 058/128: Merge pull request #18 from abutcher/comment-syntax, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 555c0863bc 009/128: bound S-tab to unindent line, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 523ac5b79f 022/128: Merge pull request #3 from mmichelli/master, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode e27e785ae7 003/128: added more code samples to example, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode e8e2964ef4 008/128: made tab cycle after hitting end, ELPA Syncer, 2022/01/29