diff options
| author | Dave Love | 1997-12-13 22:21:03 +0000 |
|---|---|---|
| committer | Dave Love | 1997-12-13 22:21:03 +0000 |
| commit | 2b20743d79533eb9a339f2e4026a6b10185c0fec (patch) | |
| tree | 2590b69bbf2b523442c9520e3b838b8b8a5f9476 | |
| parent | e49172c89caffda8dd8ddc87814c000e46e678ac (diff) | |
| download | emacs-2b20743d79533eb9a339f2e4026a6b10185c0fec.tar.gz emacs-2b20743d79533eb9a339f2e4026a6b10185c0fec.zip | |
Define indentation in normal dialect for let-syntax,
letrec-syntax, syntax-rules, call-with-values, dynamic-wind.
(scheme-mode-map): Remove lisp-complete-symbol. Add
uncomment-region.
(scheme-mode-hook, dsssl-mode-hook): Declare customized.
(dsssl-sgml-declaration): Fix customization.
| -rw-r--r-- | lisp/progmodes/scheme.el | 44 |
1 files changed, 39 insertions, 5 deletions
diff --git a/lisp/progmodes/scheme.el b/lisp/progmodes/scheme.el index ed393a96d6f..17f0fda331c 100644 --- a/lisp/progmodes/scheme.el +++ b/lisp/progmodes/scheme.el | |||
| @@ -42,6 +42,17 @@ | |||
| 42 | ;; the `cmuscheme' package and also the implementation-specific | 42 | ;; the `cmuscheme' package and also the implementation-specific |
| 43 | ;; `xscheme' package. | 43 | ;; `xscheme' package. |
| 44 | 44 | ||
| 45 | ;; Here's a recipe to generate a TAGS file for DSSSL, by the way: | ||
| 46 | ;; etags --lang=scheme --regex='/[ \t]*(\(mode\|element\)[ \t | ||
| 47 | ;; ]+\([^ \t( | ||
| 48 | ;; ]+\)/\2/' --regex='/[ \t]*(element[ \t | ||
| 49 | ;; ]*([^)]+[ \t | ||
| 50 | ;; ]+\([^)]+\)[ \t | ||
| 51 | ;; ]*)/\1/' --regex='/(declare[^ \t | ||
| 52 | ;; ]*[ \t | ||
| 53 | ;; ]+\([^ \t | ||
| 54 | ;; ]+\)/\1/' "$@" | ||
| 55 | |||
| 45 | ;;; Code: | 56 | ;;; Code: |
| 46 | 57 | ||
| 47 | (require 'lisp-mode) | 58 | (require 'lisp-mode) |
| @@ -166,15 +177,19 @@ All commands in `shared-lisp-mode-map' are inherited by this map.") | |||
| 166 | (let ((map (make-sparse-keymap "Scheme"))) | 177 | (let ((map (make-sparse-keymap "Scheme"))) |
| 167 | (setq scheme-mode-map | 178 | (setq scheme-mode-map |
| 168 | (nconc (make-sparse-keymap) shared-lisp-mode-map)) | 179 | (nconc (make-sparse-keymap) shared-lisp-mode-map)) |
| 169 | (define-key scheme-mode-map "\e\t" 'lisp-complete-symbol) | ||
| 170 | (define-key scheme-mode-map [menu-bar] (make-sparse-keymap)) | 180 | (define-key scheme-mode-map [menu-bar] (make-sparse-keymap)) |
| 171 | (define-key scheme-mode-map [menu-bar scheme] | 181 | (define-key scheme-mode-map [menu-bar scheme] |
| 172 | (cons "Scheme" map)) | 182 | (cons "Scheme" map)) |
| 173 | (define-key map [run-scheme] '("Run Inferior Scheme" . run-scheme)) | 183 | (define-key map [run-scheme] '("Run Inferior Scheme" . run-scheme)) |
| 184 | (define-key map [uncomment-region] | ||
| 185 | '("Uncomment Out Region" . (lambda (beg end) | ||
| 186 | (interactive "r") | ||
| 187 | (comment-region beg end '(4))))) | ||
| 174 | (define-key map [comment-region] '("Comment Out Region" . comment-region)) | 188 | (define-key map [comment-region] '("Comment Out Region" . comment-region)) |
| 175 | (define-key map [indent-region] '("Indent Region" . indent-region)) | 189 | (define-key map [indent-region] '("Indent Region" . indent-region)) |
| 176 | (define-key map [indent-line] '("Indent Line" . lisp-indent-line)) | 190 | (define-key map [indent-line] '("Indent Line" . lisp-indent-line)) |
| 177 | (put 'comment-region 'menu-enable 'mark-active) | 191 | (put 'comment-region 'menu-enable 'mark-active) |
| 192 | (put 'uncomment-region 'menu-enable 'mark-active) | ||
| 178 | (put 'indent-region 'menu-enable 'mark-active))) | 193 | (put 'indent-region 'menu-enable 'mark-active))) |
| 179 | 194 | ||
| 180 | ;; Used by cmuscheme | 195 | ;; Used by cmuscheme |
| @@ -226,9 +241,23 @@ Set this to nil if you normally use another dialect." | |||
| 226 | "<!DOCTYPE style-sheet PUBLIC \"-//James Clark//DTD DSSSL Style Sheet//EN\"> | 241 | "<!DOCTYPE style-sheet PUBLIC \"-//James Clark//DTD DSSSL Style Sheet//EN\"> |
| 227 | " | 242 | " |
| 228 | "*An SGML declaration for the DSSSL file. | 243 | "*An SGML declaration for the DSSSL file. |
| 229 | This will be inserted into an empty buffer in dsssl-mode if it is | 244 | If it is defined as a string this will be inserted into an empty buffer |
| 230 | defined as a string. It is typically James Clark's style-sheet | 245 | which is in dsssl-mode. It is typically James Clark's style-sheet |
| 231 | doctype, as required for Jade." | 246 | doctype, as required for Jade." |
| 247 | :type '(choice (string :tag "Specified string") | ||
| 248 | (const :tag "None" :value nil)) | ||
| 249 | :group 'scheme) | ||
| 250 | |||
| 251 | (defcustom scheme-mode-hook nil | ||
| 252 | "*Normal hook (list of functions) run when entering scheme-mode. | ||
| 253 | See `run-hooks'." | ||
| 254 | :type 'hook | ||
| 255 | :group 'scheme) | ||
| 256 | |||
| 257 | (defcustom dsssl-mode-hook nil | ||
| 258 | "*Normal hook (list of functions) run when entering dsssl-mode. | ||
| 259 | See `run-hooks'." | ||
| 260 | :type 'hook | ||
| 232 | :group 'scheme) | 261 | :group 'scheme) |
| 233 | 262 | ||
| 234 | (defvar dsssl-imenu-generic-expression | 263 | (defvar dsssl-imenu-generic-expression |
| @@ -401,7 +430,11 @@ if that value is non-nil and inserts the value of | |||
| 401 | (put 'let 'scheme-indent-function 'scheme-let-indent) | 430 | (put 'let 'scheme-indent-function 'scheme-let-indent) |
| 402 | (put 'let* 'scheme-indent-function 1) | 431 | (put 'let* 'scheme-indent-function 1) |
| 403 | (put 'letrec 'scheme-indent-function 1) | 432 | (put 'letrec 'scheme-indent-function 1) |
| 404 | (put 'sequence 'scheme-indent-function 0) | 433 | (put 'sequence 'scheme-indent-function 0) ; SICP, not r4rs |
| 434 | (put 'let-syntax 'scheme-indent-function 1) | ||
| 435 | (put 'letrec-syntax 'scheme-indent-function 1) | ||
| 436 | (put 'syntax-rules 'scheme-indent-function 1) | ||
| 437 | |||
| 405 | 438 | ||
| 406 | (put 'call-with-input-file 'scheme-indent-function 1) | 439 | (put 'call-with-input-file 'scheme-indent-function 1) |
| 407 | (put 'with-input-from-file 'scheme-indent-function 1) | 440 | (put 'with-input-from-file 'scheme-indent-function 1) |
| @@ -409,6 +442,8 @@ if that value is non-nil and inserts the value of | |||
| 409 | (put 'call-with-output-file 'scheme-indent-function 1) | 442 | (put 'call-with-output-file 'scheme-indent-function 1) |
| 410 | (put 'with-output-to-file 'scheme-indent-function 1) | 443 | (put 'with-output-to-file 'scheme-indent-function 1) |
| 411 | (put 'with-output-to-port 'scheme-indent-function 1) | 444 | (put 'with-output-to-port 'scheme-indent-function 1) |
| 445 | (put 'call-with-values 'scheme-indent-function 1) ; r5rs? | ||
| 446 | (put 'dynamic-wind 'scheme-indent-function 3) ; r5rs? | ||
| 412 | 447 | ||
| 413 | ;;;; MIT Scheme specific indentation. | 448 | ;;;; MIT Scheme specific indentation. |
| 414 | 449 | ||
| @@ -416,7 +451,6 @@ if that value is non-nil and inserts the value of | |||
| 416 | (progn | 451 | (progn |
| 417 | (put 'fluid-let 'scheme-indent-function 1) | 452 | (put 'fluid-let 'scheme-indent-function 1) |
| 418 | (put 'in-package 'scheme-indent-function 1) | 453 | (put 'in-package 'scheme-indent-function 1) |
| 419 | (put 'let-syntax 'scheme-indent-function 1) | ||
| 420 | (put 'local-declare 'scheme-indent-function 1) | 454 | (put 'local-declare 'scheme-indent-function 1) |
| 421 | (put 'macro 'scheme-indent-function 1) | 455 | (put 'macro 'scheme-indent-function 1) |
| 422 | (put 'make-environment 'scheme-indent-function 0) | 456 | (put 'make-environment 'scheme-indent-function 0) |