comparison src/elisp/urweb-mode.el @ 2175:3ffef52d549c

Make urweb-mode inherit from prog-mode (contributed by Ziv Scully)
author Adam Chlipala <adam@chlipala.net>
date Thu, 15 Oct 2015 07:52:37 -0400
parents 3288e3c9948b
children e46989ea4ca7
comparison
equal deleted inserted replaced
2174:ce312cad5ecd 2175:3ffef52d549c
244 (1 font-lock-keyword-face) 244 (1 font-lock-keyword-face)
245 (2 (amAttribute font-lock-module-def-face))) 245 (2 (amAttribute font-lock-module-def-face)))
246 ("\\<\\(signature\\)\\s-+\\(\\sw+\\)" 246 ("\\<\\(signature\\)\\s-+\\(\\sw+\\)"
247 (1 font-lock-keyword-face) 247 (1 font-lock-keyword-face)
248 (2 (amAttribute font-lock-interface-def-face))) 248 (2 (amAttribute font-lock-interface-def-face)))
249 249
250 (,urweb-keywords-regexp . font-lock-keyword-face) 250 (,urweb-keywords-regexp . font-lock-keyword-face)
251 (,urweb-sql-keywords-regexp . font-lock-sql-face) 251 (,urweb-sql-keywords-regexp . font-lock-sql-face)
252 (,urweb-cident-regexp . font-lock-cvariable-face)) 252 (,urweb-cident-regexp . font-lock-cvariable-face))
253 "Regexps matching standard Ur/Web keywords.") 253 "Regexps matching standard Ur/Web keywords.")
254 254
375 ;;;###autoload (add-to-list 'load-path (file-name-directory load-file-name)) 375 ;;;###autoload (add-to-list 'load-path (file-name-directory load-file-name))
376 ;;;###autoload 376 ;;;###autoload
377 (add-to-list 'auto-mode-alist '("\\.urs?\\'" . urweb-mode)) 377 (add-to-list 'auto-mode-alist '("\\.urs?\\'" . urweb-mode))
378 378
379 ;;;###autoload 379 ;;;###autoload
380 (define-derived-mode urweb-mode fundamental-mode "Ur/Web" 380 (define-derived-mode urweb-mode prog-mode "Ur/Web"
381 "\\<urweb-mode-map>Major mode for editing Ur/Web code. 381 "\\<urweb-mode-map>Major mode for editing Ur/Web code.
382 This mode runs `urweb-mode-hook' just before exiting. 382 This mode runs `urweb-mode-hook' just before exiting.
383 \\{urweb-mode-map}" 383 \\{urweb-mode-map}"
384 (set (make-local-variable 'font-lock-defaults) urweb-font-lock-defaults) 384 (set (make-local-variable 'font-lock-defaults) urweb-font-lock-defaults)
385 (set (make-local-variable 'font-lock-multiline) 'undecided) 385 (set (make-local-variable 'font-lock-multiline) 'undecided)
407 407
408 (defun urweb-mode-variables () 408 (defun urweb-mode-variables ()
409 (set-syntax-table urweb-mode-syntax-table) 409 (set-syntax-table urweb-mode-syntax-table)
410 (setq local-abbrev-table urweb-mode-abbrev-table) 410 (setq local-abbrev-table urweb-mode-abbrev-table)
411 ;; A paragraph is separated by blank lines or ^L only. 411 ;; A paragraph is separated by blank lines or ^L only.
412 412
413 (set (make-local-variable 'indent-line-function) 'urweb-indent-line) 413 (set (make-local-variable 'indent-line-function) 'urweb-indent-line)
414 (set (make-local-variable 'comment-start) "(* ") 414 (set (make-local-variable 'comment-start) "(* ")
415 (set (make-local-variable 'comment-end) " *)") 415 (set (make-local-variable 'comment-end) " *)")
416 (set (make-local-variable 'comment-nested) t) 416 (set (make-local-variable 'comment-nested) t)
417 ;;(set (make-local-variable 'block-comment-start) "* ") 417 ;;(set (make-local-variable 'block-comment-start) "* ")