summaryrefslogtreecommitdiff
path: root/lisp/textmodes/text-mode.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1997-06-11 19:02:06 +0000
committerRichard M. Stallman <rms@gnu.org>1997-06-11 19:02:06 +0000
commit946340aed2872039908657c62def32ed751673d4 (patch)
treec03affb868bb31905272f832eb8edf05a557ea00 /lisp/textmodes/text-mode.el
parent849f04e14de8ce4e1379d31e705f70c069fb6400 (diff)
downloademacs-946340aed2872039908657c62def32ed751673d4.tar.gz
(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.
Diffstat (limited to 'lisp/textmodes/text-mode.el')
-rw-r--r--lisp/textmodes/text-mode.el39
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.")
()
(setq text-mode-map (make-sparse-keymap))
(define-key text-mode-map "\e\t" 'ispell-complete-word)
- (define-key text-mode-map "\t" 'tab-to-tab-stop)
+ (define-key text-mode-map "\t" 'indent-relative)
(define-key text-mode-map "\es" 'center-line)
(define-key text-mode-map "\eS" 'center-paragraph))
@@ -76,47 +76,24 @@ Turning on Text mode runs the normal hook `text-mode-hook'."
(setq major-mode 'text-mode)
(run-hooks 'text-mode-hook))
-(defun spaced-text-mode ()
+(defun paragraph-indent-text-mode ()
"Major mode for editing text, with leading spaces starting a paragraph.
In this mode, you do not need blank lines between paragraphs
when the first line of the following paragraph starts with whitespace.
Special commands:
\\{text-mode-map}
-Turning on Spaced Text mode runs the normal hook `spaced-text-mode-hook'."
+Turning on Paragraph-Indent Text mode runs the normal hooks
+`text-mode-hook' and `paragraph-indent-text-mode-hook'."
(interactive)
(kill-all-local-variables)
(use-local-map text-mode-map)
- (setq mode-name "Spaced Text")
- (setq major-mode 'spaced-text-mode)
+ (setq mode-name "Parindent")
+ (setq major-mode 'paragraph-indent-text-mode)
(setq local-abbrev-table text-mode-abbrev-table)
(set-syntax-table text-mode-syntax-table)
- (run-hooks 'text-mode-hook 'spaced-text-mode-hook))
-
-(defvar indented-text-mode-map ()
- "Keymap for Indented Text mode.
-All the commands defined in Text mode are inherited unless overridden.")
-
-(if indented-text-mode-map
- ()
- ;; Make different definition for TAB before the one in text-mode-map, but
- ;; share the rest.
- (let ((newmap (make-sparse-keymap)))
- (define-key newmap "\t" 'indent-relative)
- (setq indented-text-mode-map (nconc newmap text-mode-map))))
+ (run-hooks 'text-mode-hook 'paragraph-indent-text-mode-hook))
-(defun indented-text-mode ()
- "Major mode for editing text which is often indented.
-This is like Text mode except that TAB runs `indent-relative'.
-\\{text-mode-map}
-Turning on Indented Text mode runs the normal hook `indented-text-mode-hook'."
- (interactive)
- (text-mode)
- (use-local-map indented-text-mode-map)
- (make-local-variable 'indent-line-function)
- (setq indent-line-function 'indent-relative-maybe)
- (setq mode-name "Indented Text")
- (setq major-mode 'indented-text-mode)
- (run-hooks 'text-mode-hook 'indented-text-mode-hook))
+(defalias 'indented-text-mode 'text-mode)
(defun center-paragraph ()
"Center each nonblank line in the paragraph at or after point.