| 1 | ;;; -*- Package: hemlock -*-
|
|---|
| 2 | ;;;
|
|---|
| 3 | ;;; **********************************************************************
|
|---|
| 4 | ;;; This code was written as part of the CMU Common Lisp project at
|
|---|
| 5 | ;;; Carnegie Mellon University, and has been placed in the public domain.
|
|---|
| 6 | ;;;
|
|---|
| 7 | #+CMU (ext:file-comment
|
|---|
| 8 | "$Header$")
|
|---|
| 9 | ;;;
|
|---|
| 10 | ;;; **********************************************************************
|
|---|
| 11 | ;;;
|
|---|
| 12 | ;;; This file contains a minimal dylan mode.
|
|---|
| 13 | ;;;
|
|---|
| 14 | (in-package :hemlock)
|
|---|
| 15 |
|
|---|
| 16 | ;;; hack ..
|
|---|
| 17 |
|
|---|
| 18 | (setf (getstring "dylan" *mode-names*) nil)
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 | (defmode "Dylan" :major-p t)
|
|---|
| 22 | (defcommand "Dylan Mode" (p)
|
|---|
| 23 | "Put the current buffer into \"Dylan\" mode."
|
|---|
| 24 | "Put the current buffer into \"Dylan\" mode."
|
|---|
| 25 | (declare (ignore p))
|
|---|
| 26 | (setf (buffer-major-mode (current-buffer)) "Dylan"))
|
|---|
| 27 |
|
|---|
| 28 | (define-file-type-hook ("dylan") (buffer type)
|
|---|
| 29 | (declare (ignore type))
|
|---|
| 30 | (setf (buffer-major-mode buffer) "Dylan"))
|
|---|
| 31 |
|
|---|
| 32 | (defhvar "Indent Function"
|
|---|
| 33 | "Indentation function which is invoked by \"Indent\" command.
|
|---|
| 34 | It must take one argument that is the prefix argument."
|
|---|
| 35 | :value #'generic-indent
|
|---|
| 36 | :mode "Dylan")
|
|---|
| 37 |
|
|---|
| 38 | (defhvar "Auto Fill Space Indent"
|
|---|
| 39 | "When non-nil, uses \"Indent New Comment Line\" to break lines instead of
|
|---|
| 40 | \"New Line\"."
|
|---|
| 41 | :mode "Dylan" :value t)
|
|---|
| 42 |
|
|---|
| 43 | (defhvar "Comment Start"
|
|---|
| 44 | "String that indicates the start of a comment."
|
|---|
| 45 | :mode "Dylan" :value "//")
|
|---|
| 46 |
|
|---|
| 47 | (defhvar "Comment End"
|
|---|
| 48 | "String that ends comments. Nil indicates #\newline termination."
|
|---|
| 49 | :mode "Dylan" :value nil)
|
|---|
| 50 |
|
|---|
| 51 | (defhvar "Comment Begin"
|
|---|
| 52 | "String that is inserted to begin a comment."
|
|---|
| 53 | :mode "Dylan" :value "// ")
|
|---|
| 54 |
|
|---|
| 55 | (bind-key "Delete Previous Character Expanding Tabs" #k"backspace"
|
|---|
| 56 | :mode "Dylan")
|
|---|
| 57 | (bind-key "Delete Previous Character Expanding Tabs" #k"delete" :mode "Dylan")
|
|---|
| 58 |
|
|---|
| 59 | ;;; hacks...
|
|---|
| 60 |
|
|---|
| 61 | (shadow-attribute :scribe-syntax #\< nil "Dylan")
|
|---|
| 62 | (shadow-attribute :scribe-syntax #\> nil "Dylan")
|
|---|
| 63 | (bind-key "Self Insert" #k"\>" :mode "Dylan")
|
|---|
| 64 | (bind-key "Scribe Insert Bracket" #k")" :mode "Dylan")
|
|---|
| 65 | (bind-key "Scribe Insert Bracket" #k"]" :mode "Dylan")
|
|---|
| 66 | (bind-key "Scribe Insert Bracket" #k"}" :mode "Dylan")
|
|---|