# HG changeset patch # User Richard M. Stallman # Date 865312073 0 # Node ID 95f6ac42b352d15bca467549d10bed2c3f46c395 # Parent 5711f2e5a64304a30089dddd67146d393ba3deeb (spaced-text-mode): Renamed from text-mode. But change the mode name and hooks. (text-mode): Put the guts of indented-text-mode here. But don't define text-mode-abbrev-table, just use it. Don't set indent-line-function, and use text-mode-map. (indented-text-mode): Call text-mode. diff -r 5711f2e5a643 -r 95f6ac42b352 lisp/textmodes/text-mode.el --- a/lisp/textmodes/text-mode.el Tue Jun 03 03:39:31 1997 +0000 +++ b/lisp/textmodes/text-mode.el Tue Jun 03 04:27:53 1997 +0000 @@ -56,26 +56,41 @@ (define-key text-mode-map "\eS" 'center-paragraph)) -;(defun non-saved-text-mode () -; "Like text-mode, but delete auto save file when file is saved for real." -; (text-mode) -; (make-local-variable 'delete-auto-save-files) -; (setq delete-auto-save-files t)) - (defun text-mode () - "Major mode for editing text intended for humans to read. -Special commands: + "Major mode for editing text written for humans to read. +In this mode, paragraphs are delimited only by blank lines. +You can thus get the full benefit of adaptive filling + (see the variable `adaptive-fill-mode'). \\{text-mode-map} -Turning on Text mode calls the value of the variable `text-mode-hook', -if that value is non-nil." +Turning on Text mode runs the normal hook `text-mode-hook'." (interactive) (kill-all-local-variables) (use-local-map text-mode-map) + (setq local-abbrev-table text-mode-abbrev-table) + (set-syntax-table text-mode-syntax-table) + (make-local-variable 'paragraph-start) + (setq paragraph-start (concat "$\\|" page-delimiter)) + (make-local-variable 'paragraph-separate) + (setq paragraph-separate paragraph-start) (setq mode-name "Text") (setq major-mode 'text-mode) + (run-hooks 'text-mode-hook)) + +(defun spaced-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'." + (interactive) + (kill-all-local-variables) + (use-local-map text-mode-map) + (setq mode-name "Spaced Text") + (setq major-mode 'spaced-text-mode) (setq local-abbrev-table text-mode-abbrev-table) (set-syntax-table text-mode-syntax-table) - (run-hooks 'text-mode-hook)) + (run-hooks 'text-mode-hook 'spaced-text-mode-hook)) (defvar indented-text-mode-map () "Keymap for Indented Text mode. @@ -88,28 +103,17 @@ (let ((newmap (make-sparse-keymap))) (define-key newmap "\t" 'indent-relative) (setq indented-text-mode-map (nconc newmap text-mode-map)))) - + (defun indented-text-mode () - "Major mode for editing text with indented paragraphs. -In this mode, paragraphs are delimited only by blank lines. -You can thus get the benefit of adaptive filling - (see the variable `adaptive-fill-mode'). -\\{indented-text-mode-map} -Turning on `indented-text-mode' calls the value of the variable -`text-mode-hook', if that value is non-nil." + "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) - (kill-all-local-variables) - (use-local-map text-mode-map) - (define-abbrev-table 'text-mode-abbrev-table ()) - (setq local-abbrev-table text-mode-abbrev-table) - (set-syntax-table text-mode-syntax-table) + (text-mode) + (use-local-map indented-text-mode-map) (make-local-variable 'indent-line-function) (setq indent-line-function 'indent-relative-maybe) - (make-local-variable 'paragraph-start) - (setq paragraph-start (concat "$\\|" page-delimiter)) - (make-local-variable 'paragraph-separate) - (setq paragraph-separate paragraph-start) - (use-local-map indented-text-mode-map) (setq mode-name "Indented Text") (setq major-mode 'indented-text-mode) (run-hooks 'text-mode-hook 'indented-text-mode-hook))