[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Geiser-users] [PATCH] Font lock `define-syntax-rule' like `define' proc
From: |
Diogo F. S. Ramos |
Subject: |
[Geiser-users] [PATCH] Font lock `define-syntax-rule' like `define' procedures |
Date: |
Mon, 24 Feb 2014 17:46:50 -0300 |
`define-syntax-rule' is similar enough to procedure definitions that
it should be highlight as a slightly different version of one.
The faces were chosen to keep the same scheme used by `define-macro'.
`define-syntax-rule' was removed from Racket's extra keywords as there
is no need to special case it.
---
elisp/geiser-racket.el | 3 +--
elisp/geiser-syntax.el | 8 ++++++--
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/elisp/geiser-racket.el b/elisp/geiser-racket.el
index e466ce3..4c1b127 100644
--- a/elisp/geiser-racket.el
+++ b/elisp/geiser-racket.el
@@ -61,8 +61,7 @@ This executable is used by `run-gracket', and, if
:group 'geiser-racket)
(geiser-custom--defcustom geiser-racket-extra-keywords
- '("define-syntax-rule" "provide" "require"
- "unless" "when" "with-handlers")
+ '("provide" "require" "unless" "when" "with-handlers")
"Extra keywords highlighted in Racket buffers."
:type '(repeat string)
:group 'geiser-racket)
diff --git a/elisp/geiser-syntax.el b/elisp/geiser-syntax.el
index 7a33770..8b427f6 100644
--- a/elisp/geiser-syntax.el
+++ b/elisp/geiser-syntax.el
@@ -52,8 +52,12 @@
;;; Extra syntax keywords
(defconst geiser-syntax--keywords
- '(("\\[\\(else\\)\\>" . 1)
- ("(\\(parameterize\\)\\>" . 1)))
+ `(("\\[\\(else\\)\\>" . 1)
+ ("(\\(parameterize\\)\\>" . 1)
+ (,(rx "(" (group "define-syntax-rule") eow (* space)
+ (? "(") (? (group (1+ word))))
+ (1 font-lock-keyword-face)
+ (2 font-lock-variable-name-face))))
(font-lock-add-keywords 'scheme-mode geiser-syntax--keywords)
--
1.9.0
- [Geiser-users] [PATCH] Font lock `define-syntax-rule' like `define' procedures,
Diogo F. S. Ramos <=