diff options
| author | Richard M. Stallman | 1997-06-11 19:02:06 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-06-11 19:02:06 +0000 |
| commit | 946340aed2872039908657c62def32ed751673d4 (patch) | |
| tree | c03affb868bb31905272f832eb8edf05a557ea00 | |
| parent | 849f04e14de8ce4e1379d31e705f70c069fb6400 (diff) | |
| download | emacs-946340aed2872039908657c62def32ed751673d4.tar.gz emacs-946340aed2872039908657c62def32ed751673d4.zip | |
(paragraph-indent-text-mode): Renamed from spaced-text-mode.
(text-mode-map): Bind TAB to indent-relative.
(indented-text-mode-map): Variable deleted.
(indented-text-mode): Now an alias for text-mode.
| -rw-r--r-- | lisp/textmodes/text-mode.el | 39 |
1 files changed, 8 insertions, 31 deletions
diff --git a/lisp/textmodes/text-mode.el b/lisp/textmodes/text-mode.el index e7bd36ad695..b555d61a810 100644 --- a/lisp/textmodes/text-mode.el +++ b/lisp/textmodes/text-mode.el | |||
| @@ -51,7 +51,7 @@ inherit all the commands defined in this map.") | |||
| 51 | () | 51 | () |
| 52 | (setq text-mode-map (make-sparse-keymap)) | 52 | (setq text-mode-map (make-sparse-keymap)) |
| 53 | (define-key text-mode-map "\e\t" 'ispell-complete-word) | 53 | (define-key text-mode-map "\e\t" 'ispell-complete-word) |
| 54 | (define-key text-mode-map "\t" 'tab-to-tab-stop) | 54 | (define-key text-mode-map "\t" 'indent-relative) |
| 55 | (define-key text-mode-map "\es" 'center-line) | 55 | (define-key text-mode-map "\es" 'center-line) |
| 56 | (define-key text-mode-map "\eS" 'center-paragraph)) | 56 | (define-key text-mode-map "\eS" 'center-paragraph)) |
| 57 | 57 | ||
| @@ -76,47 +76,24 @@ Turning on Text mode runs the normal hook `text-mode-hook'." | |||
| 76 | (setq major-mode 'text-mode) | 76 | (setq major-mode 'text-mode) |
| 77 | (run-hooks 'text-mode-hook)) | 77 | (run-hooks 'text-mode-hook)) |
| 78 | 78 | ||
| 79 | (defun spaced-text-mode () | 79 | (defun paragraph-indent-text-mode () |
| 80 | "Major mode for editing text, with leading spaces starting a paragraph. | 80 | "Major mode for editing text, with leading spaces starting a paragraph. |
| 81 | In this mode, you do not need blank lines between paragraphs | 81 | In this mode, you do not need blank lines between paragraphs |
| 82 | when the first line of the following paragraph starts with whitespace. | 82 | when the first line of the following paragraph starts with whitespace. |
| 83 | Special commands: | 83 | Special commands: |
| 84 | \\{text-mode-map} | 84 | \\{text-mode-map} |
| 85 | Turning on Spaced Text mode runs the normal hook `spaced-text-mode-hook'." | 85 | Turning on Paragraph-Indent Text mode runs the normal hooks |
| 86 | `text-mode-hook' and `paragraph-indent-text-mode-hook'." | ||
| 86 | (interactive) | 87 | (interactive) |
| 87 | (kill-all-local-variables) | 88 | (kill-all-local-variables) |
| 88 | (use-local-map text-mode-map) | 89 | (use-local-map text-mode-map) |
| 89 | (setq mode-name "Spaced Text") | 90 | (setq mode-name "Parindent") |
| 90 | (setq major-mode 'spaced-text-mode) | 91 | (setq major-mode 'paragraph-indent-text-mode) |
| 91 | (setq local-abbrev-table text-mode-abbrev-table) | 92 | (setq local-abbrev-table text-mode-abbrev-table) |
| 92 | (set-syntax-table text-mode-syntax-table) | 93 | (set-syntax-table text-mode-syntax-table) |
| 93 | (run-hooks 'text-mode-hook 'spaced-text-mode-hook)) | 94 | (run-hooks 'text-mode-hook 'paragraph-indent-text-mode-hook)) |
| 94 | |||
| 95 | (defvar indented-text-mode-map () | ||
| 96 | "Keymap for Indented Text mode. | ||
| 97 | All the commands defined in Text mode are inherited unless overridden.") | ||
| 98 | |||
| 99 | (if indented-text-mode-map | ||
| 100 | () | ||
| 101 | ;; Make different definition for TAB before the one in text-mode-map, but | ||
| 102 | ;; share the rest. | ||
| 103 | (let ((newmap (make-sparse-keymap))) | ||
| 104 | (define-key newmap "\t" 'indent-relative) | ||
| 105 | (setq indented-text-mode-map (nconc newmap text-mode-map)))) | ||
| 106 | 95 | ||
| 107 | (defun indented-text-mode () | 96 | (defalias 'indented-text-mode 'text-mode) |
| 108 | "Major mode for editing text which is often indented. | ||
| 109 | This is like Text mode except that TAB runs `indent-relative'. | ||
| 110 | \\{text-mode-map} | ||
| 111 | Turning on Indented Text mode runs the normal hook `indented-text-mode-hook'." | ||
| 112 | (interactive) | ||
| 113 | (text-mode) | ||
| 114 | (use-local-map indented-text-mode-map) | ||
| 115 | (make-local-variable 'indent-line-function) | ||
| 116 | (setq indent-line-function 'indent-relative-maybe) | ||
| 117 | (setq mode-name "Indented Text") | ||
| 118 | (setq major-mode 'indented-text-mode) | ||
| 119 | (run-hooks 'text-mode-hook 'indented-text-mode-hook)) | ||
| 120 | 97 | ||
| 121 | (defun center-paragraph () | 98 | (defun center-paragraph () |
| 122 | "Center each nonblank line in the paragraph at or after point. | 99 | "Center each nonblank line in the paragraph at or after point. |