Index: sbbs.el ================================================================== --- sbbs.el +++ sbbs.el @@ -563,13 +563,36 @@ (defvar sbbs-compose-mode-map (let ((map (make-sparse-keymap))) (define-key map (kbd "C-c C-c") #'sbbs-compose-create) map)) +(defvar sbbs--font-lock + ;; stolen/based on from http://textboard.org/prog/81/5 + '(;; code + ("^```\\(.*\n\\)*?```\n?" . 'sbbs--code-face) + ;; bold + ("\\*\\*[^ ].*?\\*\\*" . 'bold) + ;; italic + ("__[^ ].*?__" . 'italic) + ;; monospaced + ("==[^ ].*?==" . 'shadow) + ;; spoiler + ("~~[^ ].*?~~" . 'sbbs--spoiler-face) + ;; references + (">>\\([[:digit:]]+\\(?:-[[:digit:]]+\\)?\\(?:,[[:digit:]]+\\(?:-[[:digit:]]+\\)?\\)*\\)" + . 'link) + ;; quotes + ("^>.*" . font-lock-comment-face)) + "Highlighting for SchemeBBS posts") + (define-derived-mode sbbs-compose-mode text-mode "SchemeBBS Compose" "Major mode for composing replies and starting new threads." + (setq-local comment-start ">") + (setq-local comment-start-skip "^>") + (setq-local font-lock-defaults '(sbbs--font-lock)) + (setq-local font-lock-multiline t) (setq-local fill-column most-positive-fixnum) (message "Press C-c C-c to send")) (provide 'sbbs) ;;; sbbs.el ends here