|
1 |
| -;;; splunk-mode.el --- Major Mode for editing Splunk Search Processing Language (SPL) source code -*- lexical-binding: t -*- |
| 1 | +;;; splunk-mode.el --- Major Mode for editing Splunk SPL source code -*- lexical-binding: t -*- |
2 | 2 |
|
3 | 3 | ;; Copyright (C) 2022–2024 Jake Ireland
|
4 | 4 |
|
5 | 5 | ;; Author: Jake Ireland <jakewilliami@icloud.com>
|
6 | 6 | ;; URL: https://github.com/jakewilliami/splunk-mode/
|
7 |
| -;; Version: 1.0 |
| 7 | +;; Version: 1.1 |
8 | 8 | ;; Keywords: languages splunk mode
|
9 |
| -;; Package-Requires: ((emacs "27")) |
| 9 | +;; Package-Requires: ((emacs "27.1")) |
10 | 10 |
|
11 | 11 | ;;; Usage:
|
12 | 12 | ;;
|
|
83 | 83 |
|
84 | 84 | (defvar splunk-mode-hook nil)
|
85 | 85 |
|
86 |
| -(defgroup splunk-mode () |
| 86 | +(defgroup splunk () |
87 | 87 | "Major mode for Splunk SPL code."
|
88 | 88 | :link '(url-link "https://docs.splunk.com/")
|
89 | 89 | :version "0.1"
|
|
126 | 126 | (defface splunk-comment-face
|
127 | 127 | '((t :inherit font-lock-comment-face))
|
128 | 128 | "Face for alternative comment syntax in Splunk."
|
129 |
| - :group 'splunk-mode) |
| 129 | + :group 'splunk) |
130 | 130 |
|
131 | 131 | (defface splunk-builtin-functions-face
|
132 | 132 | '((t :inherit font-lock-builtin-face))
|
133 | 133 | ;; '((t :inherit font-lock-function-name-face))
|
134 | 134 | ;; '((t :inherit font-lock-constant-face))
|
135 | 135 | "Face for builtin functions such as `rename', `table', and `stat' in Splunk."
|
136 |
| - :group 'splunk-mode) |
| 136 | + :group 'splunk) |
137 | 137 |
|
138 | 138 | (defface splunk-eval-functions-face
|
139 | 139 | '((t :inherit font-lock-function-name-face))
|
140 | 140 | ;; '((t :inherit font-lock-keyword-face))
|
141 | 141 | ;; '((t :inherit font-lock-type-face))
|
142 | 142 | "Face for eval functions such as `abs' and `mvindex' in Splunk."
|
143 |
| - :group 'splunk-mode) |
| 143 | + :group 'splunk) |
144 | 144 |
|
145 | 145 | (defface splunk-transforming-functions-face
|
146 | 146 | '((t :inherit font-lock-function-name-face))
|
147 | 147 | ;; '((t :inherit font-lock-keyword-face))
|
148 | 148 | ;; '((t :inherit font-lock-type-face))
|
149 | 149 | "Face for transforming functions such as `count' and `values' in Splunk."
|
150 |
| - :group 'splunk-mode) |
| 150 | + :group 'splunk) |
151 | 151 |
|
152 | 152 | (defface splunk-language-constants-face
|
153 | 153 | '((t :inherit font-lock-constant-face))
|
154 | 154 | ;; '((t :inherit font-lock-type-face))
|
155 | 155 | ;; '((t :inherit font-lock-function-name-face))
|
156 | 156 | "Face for language constants such as `as' and `by' in Splunk."
|
157 |
| - :group 'splunk-mode) |
| 157 | + :group 'splunk) |
158 | 158 |
|
159 | 159 | (defface splunk-macros-face
|
160 | 160 | '((t :inherit font-lock-function-name-face))
|
161 | 161 | ;; '((t :inherit font-lock-keyword-face))
|
162 | 162 | ;; '((t :inherit font-lock-type-face))
|
163 | 163 | "Face for macros in Splunk."
|
164 |
| - :group 'splunk-mode) |
| 164 | + :group 'splunk) |
165 | 165 |
|
166 | 166 | (defface splunk-keyword-face
|
167 | 167 | '((t :inherit font-lock-variable-name-face))
|
168 | 168 | ;; '((t :inherit font-lock-constant-face))
|
169 | 169 | ;; '((t :inherit font-lock-variable-name-face))
|
170 | 170 | "Face for keywords (e.g. `sourcetype=*') in Splunk."
|
171 |
| - :group 'splunk-mode) |
| 171 | + :group 'splunk) |
172 | 172 |
|
173 | 173 | (defface splunk-digits-face
|
174 | 174 | ;; '((t :inherit font-lock-number-face)) ;; Added too recently
|
175 | 175 | '((t :inherit font-lock-type-face))
|
176 | 176 | "Face for digits in Splunk."
|
177 |
| - :group 'splunk-mode) |
| 177 | + :group 'splunk) |
178 | 178 |
|
179 | 179 | (defface splunk-escape-chars-face
|
180 | 180 | ;; '((t :inherit font-lock-escape-face)) ;; Added too recently
|
181 | 181 | '((t :inherit font-lock-constant-face))
|
182 | 182 | "Face for escape characters in Splunk."
|
183 |
| - :group 'splunk-mode) |
| 183 | + :group 'splunk) |
184 | 184 |
|
185 | 185 | (defface splunk-operators-face
|
186 | 186 | '((t :inherit font-lock-builtin-face
|
187 | 187 | :weight bold))
|
188 | 188 | "Face for operators in Splunk."
|
189 |
| - :group 'splunk-mode) |
| 189 | + :group 'splunk) |
190 | 190 |
|
191 | 191 |
|
192 | 192 |
|
|
375 | 375 | :syntax-table splunk-mode-syntax-table
|
376 | 376 | (setq-local font-lock-defaults '(splunk-font-lock-keywords))
|
377 | 377 | (setq-local comment-start "//")
|
378 |
| - (setq-local indent-line-function 'splunk-indent-line) |
379 |
| - (font-lock-fontify-buffer)) |
| 378 | + (setq-local indent-line-function 'splunk-indent-line)) |
380 | 379 |
|
381 | 380 | ;;;###autoload
|
382 | 381 | (add-to-list 'auto-mode-alist '("\\.spl\\'" . splunk-mode))
|
|
0 commit comments