diff options
| author | Stefan Monnier | 2001-10-13 19:13:38 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2001-10-13 19:13:38 +0000 |
| commit | ffe7a2a203b61a126a0a6a47782e325a65bfdec3 (patch) | |
| tree | 7853f4a7139c70d28f82a82a214fb508dfc7d1aa | |
| parent | b546b1a52d92dc025dc38befe79d0fa176dc8744 (diff) | |
| download | emacs-ffe7a2a203b61a126a0a6a47782e325a65bfdec3.tar.gz emacs-ffe7a2a203b61a126a0a6a47782e325a65bfdec3.zip | |
(scribe-mode): Use define-derived-mode.
| -rw-r--r-- | lisp/textmodes/scribe.el | 54 |
1 files changed, 20 insertions, 34 deletions
diff --git a/lisp/textmodes/scribe.el b/lisp/textmodes/scribe.el index d1b5aedf3c6..f40c1dfc0b6 100644 --- a/lisp/textmodes/scribe.el +++ b/lisp/textmodes/scribe.el | |||
| @@ -110,52 +110,38 @@ These should match up with `scribe-open-parenthesis'.") | |||
| 110 | (define-key scribe-mode-map "\C-c\C-u" 'scribe-underline-word)) | 110 | (define-key scribe-mode-map "\C-c\C-u" 'scribe-underline-word)) |
| 111 | 111 | ||
| 112 | ;;;###autoload | 112 | ;;;###autoload |
| 113 | (defun scribe-mode () | 113 | (define-derived-mode scribe-mode text-mode "Scribe" |
| 114 | "Major mode for editing files of Scribe (a text formatter) source. | 114 | "Major mode for editing files of Scribe (a text formatter) source. |
| 115 | Scribe-mode is similar to text-mode, with a few extra commands added. | 115 | Scribe-mode is similar to text-mode, with a few extra commands added. |
| 116 | \\{scribe-mode-map} | 116 | \\{scribe-mode-map} |
| 117 | 117 | ||
| 118 | Interesting variables: | 118 | Interesting variables: |
| 119 | 119 | ||
| 120 | scribe-fancy-paragraphs | 120 | `scribe-fancy-paragraphs' |
| 121 | Non-nil makes Scribe mode use a different style of paragraph separation. | 121 | Non-nil makes Scribe mode use a different style of paragraph separation. |
| 122 | 122 | ||
| 123 | scribe-electric-quote | 123 | `scribe-electric-quote' |
| 124 | Non-nil makes insert of double quote use `` or '' depending on context. | 124 | Non-nil makes insert of double quote use `` or '' depending on context. |
| 125 | 125 | ||
| 126 | scribe-electric-parenthesis | 126 | `scribe-electric-parenthesis' |
| 127 | Non-nil makes an open-parenthesis char (one of `([<{') | 127 | Non-nil makes an open-parenthesis char (one of `([<{') |
| 128 | automatically insert its close if typed after an @Command form." | 128 | automatically insert its close if typed after an @Command form." |
| 129 | (interactive) | 129 | (set (make-local-variable 'comment-start) "@Comment[") |
| 130 | (kill-all-local-variables) | 130 | (set (make-local-variable 'comment-start-skip) (concat "@Comment[" scribe-open-parentheses "]")) |
| 131 | (use-local-map scribe-mode-map) | 131 | (set (make-local-variable 'comment-column) 0) |
| 132 | (setq mode-name "Scribe") | 132 | (set (make-local-variable 'comment-end) "]") |
| 133 | (setq major-mode 'scribe-mode) | 133 | (set (make-local-variable 'paragraph-start) |
| 134 | (define-abbrev-table 'scribe-mode-abbrev-table ()) | 134 | (concat "\\([\n\f]\\)\\|\\(@\\w+[" |
| 135 | (setq local-abbrev-table scribe-mode-abbrev-table) | 135 | scribe-open-parentheses |
| 136 | (make-local-variable 'comment-start) | 136 | "].*[" |
| 137 | (setq comment-start "@Comment[") | 137 | scribe-close-parentheses |
| 138 | (make-local-variable 'comment-start-skip) | 138 | "]$\\)")) |
| 139 | (setq comment-start-skip (concat "@Comment[" scribe-open-parentheses "]")) | 139 | (set (make-local-variable 'paragraph-separate) |
| 140 | (make-local-variable 'comment-column) | 140 | (if scribe-fancy-paragraphs paragraph-start "$")) |
| 141 | (setq comment-column 0) | 141 | (set (make-local-variable 'sentence-end) |
| 142 | (make-local-variable 'comment-end) | 142 | "\\([.?!]\\|@:\\)[]\"')}]*\\($\\| $\\|\t\\| \\)[ \t\n]*") |
| 143 | (setq comment-end "]") | 143 | (set (make-local-variable 'compile-command) |
| 144 | (make-local-variable 'paragraph-start) | 144 | (concat "scribe " (buffer-file-name)))) |
| 145 | (setq paragraph-start (concat "\\([\n\f]\\)\\|\\(@\\w+[" | ||
| 146 | scribe-open-parentheses | ||
| 147 | "].*[" | ||
| 148 | scribe-close-parentheses | ||
| 149 | "]$\\)")) | ||
| 150 | (make-local-variable 'paragraph-separate) | ||
| 151 | (setq paragraph-separate (if scribe-fancy-paragraphs | ||
| 152 | paragraph-start "$")) | ||
| 153 | (make-local-variable 'sentence-end) | ||
| 154 | (setq sentence-end "\\([.?!]\\|@:\\)[]\"')}]*\\($\\| $\\|\t\\| \\)[ \t\n]*") | ||
| 155 | (make-local-variable 'compile-command) | ||
| 156 | (setq compile-command (concat "scribe " (buffer-file-name))) | ||
| 157 | (set-syntax-table scribe-mode-syntax-table) | ||
| 158 | (run-hooks 'text-mode-hook 'scribe-mode-hook)) | ||
| 159 | 145 | ||
| 160 | (defun scribe-tab () | 146 | (defun scribe-tab () |
| 161 | (interactive) | 147 | (interactive) |