aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/textmodes
diff options
context:
space:
mode:
authorDave Love2000-01-05 22:32:54 +0000
committerDave Love2000-01-05 22:32:54 +0000
commit9f78d51a129afa1e893699bfbf5e0e02fba6fbb7 (patch)
treec3dbe9df25746d6d8433f4c6ac710b2246dafad5 /lisp/textmodes
parent3cc9d384b9507f50769679443b4e06029f7203a4 (diff)
downloademacs-9f78d51a129afa1e893699bfbf5e0e02fba6fbb7.tar.gz
emacs-9f78d51a129afa1e893699bfbf5e0e02fba6fbb7.zip
(text-mode): Remove page-delimiter's `^' from paragraph-start.
(paragraph-indent-minor-mode): New command.
Diffstat (limited to 'lisp/textmodes')
-rw-r--r--lisp/textmodes/text-mode.el16
1 files changed, 16 insertions, 0 deletions
diff --git a/lisp/textmodes/text-mode.el b/lisp/textmodes/text-mode.el
index 63e5c3dc042..6277d344203 100644
--- a/lisp/textmodes/text-mode.el
+++ b/lisp/textmodes/text-mode.el
@@ -79,6 +79,8 @@ Turning on Text mode runs the normal hook `text-mode-hook'."
79 (set-syntax-table text-mode-syntax-table) 79 (set-syntax-table text-mode-syntax-table)
80 (make-local-variable 'paragraph-start) 80 (make-local-variable 'paragraph-start)
81 (setq paragraph-start (concat page-delimiter "\\|[ \t]*$")) 81 (setq paragraph-start (concat page-delimiter "\\|[ \t]*$"))
82 (if (eq ?^ (aref paragraph-start 0))
83 (setq paragraph-start (substring paragraph-start 1)))
82 (make-local-variable 'paragraph-separate) 84 (make-local-variable 'paragraph-separate)
83 (setq paragraph-separate paragraph-start) 85 (setq paragraph-separate paragraph-start)
84 (make-local-variable 'indent-line-function) 86 (make-local-variable 'indent-line-function)
@@ -91,6 +93,7 @@ Turning on Text mode runs the normal hook `text-mode-hook'."
91 "Major mode for editing text, with leading spaces starting a paragraph. 93 "Major mode for editing text, with leading spaces starting a paragraph.
92In this mode, you do not need blank lines between paragraphs 94In this mode, you do not need blank lines between paragraphs
93when the first line of the following paragraph starts with whitespace. 95when the first line of the following paragraph starts with whitespace.
96`paragraph-indent-minor-mode' provides a similar facility as a minor mode.
94Special commands: 97Special commands:
95\\{text-mode-map} 98\\{text-mode-map}
96Turning on Paragraph-Indent Text mode runs the normal hooks 99Turning on Paragraph-Indent Text mode runs the normal hooks
@@ -103,6 +106,19 @@ Turning on Paragraph-Indent Text mode runs the normal hooks
103 (setq local-abbrev-table text-mode-abbrev-table) 106 (setq local-abbrev-table text-mode-abbrev-table)
104 (set-syntax-table text-mode-syntax-table) 107 (set-syntax-table text-mode-syntax-table)
105 (run-hooks 'text-mode-hook 'paragraph-indent-text-mode-hook)) 108 (run-hooks 'text-mode-hook 'paragraph-indent-text-mode-hook))
109
110(defun paragraph-indent-minor-mode ()
111 "Minor mode for editing text, with leading spaces starting a paragraph.
112In this mode, you do not need blank lines between paragraphs when the
113first line of the following paragraph starts with whitespace, as with
114`paragraph-indent-mode'.
115Turning on Paragraph-Indent minor mode runs the normal hook
116`paragraph-indent-text-mode-hook'."
117 (interactive)
118 (set (make-local-variable 'paragraph-start)
119 (default-value 'paragraph-start))
120 (set (make-local-variable 'paragraph-separate) paragraph-start)
121 (run-hooks 'paragraph-indent-text-mode-hook))
106 122
107(defalias 'indented-text-mode 'text-mode) 123(defalias 'indented-text-mode 'text-mode)
108 124