[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/jade-mode 18dfef2623 043/128: Merge pull request #9 from j
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/jade-mode 18dfef2623 043/128: Merge pull request #9 from jkpl/master |
Date: |
Sat, 29 Jan 2022 08:24:45 -0500 (EST) |
branch: elpa/jade-mode
commit 18dfef2623e855bf458fd82593828e3123ac239a
Merge: 823c573c29 109b9850d2
Author: Brian Carlson <brian.m.carlson@gmail.com>
Commit: Brian Carlson <brian.m.carlson@gmail.com>
Merge pull request #9 from jkpl/master
Improved stylus comment highlight and decimal point in constants
---
stylus-mode.el | 50 +++++++++++++++++++++++++++++++-------------------
1 file changed, 31 insertions(+), 19 deletions(-)
diff --git a/stylus-mode.el b/stylus-mode.el
index 857b4b786a..63eef0b6d0 100644
--- a/stylus-mode.el
+++ b/stylus-mode.el
@@ -39,19 +39,26 @@
'("return" "if" "else" "unless" "for" "in" "true" "false")))
"Stylus keywords.")
-(setq stylus-font-lock-keywords
- `(
- (,"^[ {2,}]+[a-z0-9_:\\-]+[ ]" 0 font-lock-variable-name-face)
- (,"^//.*" 0 font-lock-comment-face)
-
(,"\\(::?\\(root\\|nth-child\\|nth-last-child\\|nth-of-type\\|nth-last-of-type\\|first-child\\|last-child\\|first-of-type\\|last-of-type\\|only-child\\|only-of-type\\|empty\\|link\\|visited\\|active\\|hover\\|focus\\|target\\|lang\\|enabled\\|disabled\\|checked\\|not\\)\\)*"
. font-lock-type-face) ;; pseudoSelectors
- (,(concat "[^_$]?\\<\\(" stylus-colours "\\)\\>[^_]?")
- 0 font-lock-constant-face)
- (,(concat "[^_$]?\\<\\(" stylus-keywords "\\)\\>[^_]?")
- 0 font-lock-keyword-face)
-
(,"\\([0-9]+:?\\(em\\|ex\\|px\\|mm\\|cm\\|in\\|pt\\|pc\\|deg\\|rad\\|grad\\|ms\\|s\\|Hz\\|kHz\\|rem\\|%\\)\\)"
0 font-lock-constant-face)
- (,"#\\w+" 0 font-lock-keyword-face)
- (,"$\\w+" 0 font-lock-variable-name-face)
- ))
+(defvar stylus-font-lock-keywords
+ `(
+ (,"^[ {2,}]+[a-z0-9_:\\-]+[ ]" 0 font-lock-variable-name-face)
+
(,"\\(::?\\(root\\|nth-child\\|nth-last-child\\|nth-of-type\\|nth-last-of-type\\|first-child\\|last-child\\|first-of-type\\|last-of-type\\|only-child\\|only-of-type\\|empty\\|link\\|visited\\|active\\|hover\\|focus\\|target\\|lang\\|enabled\\|disabled\\|checked\\|not\\)\\)*"
. font-lock-type-face) ;; pseudoSelectors
+ (,(concat "[^_$]?\\<\\(" stylus-colours "\\)\\>[^_]?")
+ 0 font-lock-constant-face)
+ (,(concat "[^_$]?\\<\\(" stylus-keywords "\\)\\>[^_]?")
+ 0 font-lock-keyword-face)
+
(,"\\([.0-9]+:?\\(em\\|ex\\|px\\|mm\\|cm\\|in\\|pt\\|pc\\|deg\\|rad\\|grad\\|ms\\|s\\|Hz\\|kHz\\|rem\\|%\\)\\)"
0 font-lock-constant-face)
+ (,"#\\w+" 0 font-lock-keyword-face)
+ (,"$\\w+" 0 font-lock-variable-name-face)
+ ))
+
+(defvar stylus-syntax-table
+ (let ((syntable (make-syntax-table)))
+ (modify-syntax-entry ?\/ ". 124b" syntable)
+ (modify-syntax-entry ?* ". 23" syntable)
+ (modify-syntax-entry ?\n "> b" syntable)
+ syntable)
+ "Syntax table for `stylus-mode'.")
(defun stylus-region-for-sexp ()
"Selects the current sexp as the region"
@@ -72,12 +79,21 @@
(define-derived-mode stylus-mode sws-mode
"Stylus"
"Major mode for editing stylus node.js templates"
- (kill-all-local-variables)
(setq tab-width 2)
(setq mode-name "Stylus")
(setq major-mode 'stylus-mode)
+ ;; syntax table
+ (set-syntax-table stylus-syntax-table)
+
+ ;; highlight syntax
+ (setq font-lock-defaults '(stylus-font-lock-keywords))
+
+ ;; comments
+ (set (make-local-variable 'comment-start) "//")
+ (set (make-local-variable 'comment-end) "")
+
;; default tab width
(setq sws-tab-width 2)
(make-local-variable 'indent-line-function)
@@ -86,12 +102,8 @@
(setq indent-region-function 'sws-indent-region)
-
;; keymap
- (use-local-map stylus-mode-map)
-
- ;; highlight syntax
- (setq font-lock-defaults '(stylus-font-lock-keywords)))
+ (use-local-map stylus-mode-map))
;;;###autoload
(add-to-list 'auto-mode-alist '("\\.styl$" . stylus-mode))
- [nongnu] elpa/jade-mode eea90de1df 038/128: Add support for keywords syntax coloring., (continued)
- [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
- [nongnu] elpa/jade-mode 5552c5eaed 011/128: updated readme, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 871ec8a9b2 033/128: Change tag name's facename to font-lock-function-name-face., ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 18dfef2623 043/128: Merge pull request #9 from jkpl/master,
ELPA Syncer <=
- [nongnu] elpa/jade-mode fd8a4f3a09 028/128: Merge pull request #7 from purcell/master, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode c0b9cfc755 034/128: Modify mather for doctype., ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode d8324d4820 078/128: Improve comment line/region function, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 7f63cc296c 054/128: Merge pull request #14 from jkpl/master, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 2d8a3013c4 063/128: Create LICENSE.txt, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 544be1a87d 079/128: match full tag decl. and un-hl subsequent content, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode ae579601b8 070/128: Merge pull request #30 from tjefferson08/fix_indentation, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode c8532a66f6 037/128: Support comment-dwim for single line comment syntax., ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode a8d77823a7 087/128: Merge pull request #40 from tjefferson08/39_highlight_js, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 1b86926046 061/128: Refined and extended syntax highlighting, ELPA Syncer, 2022/01/29