Mercurial > emacs
comparison lisp/textmodes/text-mode.el @ 1576:ddfd236e2c0c
Dox fix.
author | Christopher Zaborsky <rogue@erratum.com> |
---|---|
date | Tue, 10 Nov 1992 19:51:29 +0000 |
parents | 2cdce064065f |
children | 9e7ec92a4fdf |
comparison
equal
deleted
inserted
replaced
1575:ae13f4027ebd | 1576:ddfd236e2c0c |
---|---|
55 ; (make-local-variable 'delete-auto-save-files) | 55 ; (make-local-variable 'delete-auto-save-files) |
56 ; (setq delete-auto-save-files t)) | 56 ; (setq delete-auto-save-files t)) |
57 | 57 |
58 (defun text-mode () | 58 (defun text-mode () |
59 "Major mode for editing text intended for humans to read. Special commands:\\{text-mode-map} | 59 "Major mode for editing text intended for humans to read. Special commands:\\{text-mode-map} |
60 Turning on text-mode calls the value of the variable `text-mode-hook', | 60 Turning on Text mode calls the value of the variable `text-mode-hook', |
61 if that value is non-nil." | 61 if that value is non-nil." |
62 (interactive) | 62 (interactive) |
63 (kill-all-local-variables) | 63 (kill-all-local-variables) |
64 (use-local-map text-mode-map) | 64 (use-local-map text-mode-map) |
65 (setq mode-name "Text") | 65 (setq mode-name "Text") |
80 (define-key newmap "\t" 'indent-relative) | 80 (define-key newmap "\t" 'indent-relative) |
81 (setq indented-text-mode-map (nconc newmap text-mode-map)))) | 81 (setq indented-text-mode-map (nconc newmap text-mode-map)))) |
82 | 82 |
83 (defun indented-text-mode () | 83 (defun indented-text-mode () |
84 "Major mode for editing indented text intended for humans to read.\\{indented-text-mode-map} | 84 "Major mode for editing indented text intended for humans to read.\\{indented-text-mode-map} |
85 Turning on indented-text-mode calls the value of the variable `text-mode-hook', | 85 Turning on `indented-text-mode' calls the value of the variable |
86 if that value is non-nil." | 86 `text-mode-hook', if that value is non-nil." |
87 (interactive) | 87 (interactive) |
88 (kill-all-local-variables) | 88 (kill-all-local-variables) |
89 (use-local-map text-mode-map) | 89 (use-local-map text-mode-map) |
90 (define-abbrev-table 'text-mode-abbrev-table ()) | 90 (define-abbrev-table 'text-mode-abbrev-table ()) |
91 (setq local-abbrev-table text-mode-abbrev-table) | 91 (setq local-abbrev-table text-mode-abbrev-table) |
97 (setq major-mode 'indented-text-mode) | 97 (setq major-mode 'indented-text-mode) |
98 (run-hooks 'text-mode-hook)) | 98 (run-hooks 'text-mode-hook)) |
99 | 99 |
100 (defun center-paragraph () | 100 (defun center-paragraph () |
101 "Center each nonblank line in the paragraph at or after point. | 101 "Center each nonblank line in the paragraph at or after point. |
102 See center-line for more info." | 102 See `center-line' for more info." |
103 (interactive) | 103 (interactive) |
104 (save-excursion | 104 (save-excursion |
105 (forward-paragraph) | 105 (forward-paragraph) |
106 (or (bolp) (newline 1)) | 106 (or (bolp) (newline 1)) |
107 (let ((end (point))) | 107 (let ((end (point))) |
108 (backward-paragraph) | 108 (backward-paragraph) |
109 (center-region (point) end)))) | 109 (center-region (point) end)))) |
110 | 110 |
111 (defun center-region (from to) | 111 (defun center-region (from to) |
112 "Center each nonblank line starting in the region. | 112 "Center each nonblank line starting in the region. |
113 See center-line for more info." | 113 See `center-line' for more info." |
114 (interactive "r") | 114 (interactive "r") |
115 (if (> from to) | 115 (if (> from to) |
116 (let ((tem to)) | 116 (let ((tem to)) |
117 (setq to from from tem))) | 117 (setq to from from tem))) |
118 (save-excursion | 118 (save-excursion |