Compare commits

..

2 Commits

Author SHA1 Message Date
Pavel Kulyov
7e689125e2 readme: add sex-mode.el installation via quelpa
All checks were successful
Sex CI / build-linux (pull_request) Successful in 5m54s
2026-10-28 23:00:03 +03:00
Pavel Kulyov
c54151e9a9 sex-mode: add header and footer, fix lint errors
That makes the package installable via quelpa.
2026-10-28 22:46:14 +03:00
2 changed files with 25 additions and 38 deletions

View File

@@ -289,4 +289,4 @@ To harness the power of sex-mode, add the following lines to your
:upgrade t))
#+end_src
~.sex~ files then open in ~sex-mode~.
~.sex~ and ~.hsex~ files then open in ~sex-mode~.

View File

@@ -26,7 +26,7 @@
;; :files ("sex-mode.el")
;; :upgrade t))
;;
;; Visiting a .sex file turns the mode on.
;; Visiting a .sex or .hsex file turns the mode on.
;;; Code:
@@ -59,55 +59,42 @@ All commands in `lisp-mode-shared-map' are inherited by this map.")
(defconst sex-font-lock-keywords
(eval-when-compile
(list
;; Declarations. `pub' and `extern' are optional prefixes, so
;; `(pub fn main' highlights both keywords and the name.
;; Declarations
(list (concat "("
"\\(?:\\(pub\\|extern\\)[[:space:]]+\\)?"
(regexp-opt '("define"
(regexp-opt '("chicken-define"
"chicken-define-syntax"
"chicken-import"
"chicken-load"
"define"
"defmacro"
"enum"
"fn"
"extern"
"import"
"include"
"fn"
"pub"
"struct"
"typedef"
"union"
"var")
'words)
"var"
"union")
'word)
"\\>"
"[[:space:]]*"
"\\([[:word:]]*\\)")
'(1 font-lock-keyword-face nil t)
'(2 font-lock-keyword-face)
'(3 font-lock-function-name-face nil t))
;; Statement and expression heads, plus the macro-language forms
;; that appear in `defmacro' bodies.
'(1 font-lock-keyword-face)
'(2 font-lock-function-name-face))
;; Keywords
(list (concat "("
(regexp-opt '("break"
"c-bit-or"
"c-bit-or="
"c-or"
(regexp-opt '("do"
"case"
"case/fallthrough"
"cast"
"closure"
"continue"
"default"
"do"
"else"
"if"
"for"
"goto"
"if"
"lambda"
"map-fields"
"return"
"sizeof"
"static-assert"
"switch"
"type-match"
"type-of"
"while"
":")
'words))
"var"
"while")
'word)
"\\>")
'(1 font-lock-builtin-face))))
"Font-lock keywords for Sex mode.")
@@ -147,7 +134,7 @@ Blank lines separate paragraphs. Semicolons start comments.
(sex-mode-set-variables))
;;;###autoload
(add-to-list 'auto-mode-alist '("\\.sex\\'" . sex-mode))
(add-to-list 'auto-mode-alist '("\\.\\(sex\\|hsex\\)\\'" . sex-mode))
(provide 'sex-mode)