aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2019-07-28 17:31:17 +0300
committerEli Zaretskii2019-07-28 17:31:17 +0300
commit42e4fb8ae9514573639fcfff2b957fa88f3f7e84 (patch)
tree5d001b6de822e06d948dbc62d395794af6d2e59c
parentefc6301068b53ab319aa6a8a1b5607273e4d5b17 (diff)
downloademacs-42e4fb8ae9514573639fcfff2b957fa88f3f7e84.tar.gz
emacs-42e4fb8ae9514573639fcfff2b957fa88f3f7e84.zip
; * lisp/emacs-lisp/derived.el (define-derived-mode): Doc fix.
-rw-r--r--lisp/emacs-lisp/derived.el41
1 files changed, 22 insertions, 19 deletions
diff --git a/lisp/emacs-lisp/derived.el b/lisp/emacs-lisp/derived.el
index dc867d61da3..a6578e33086 100644
--- a/lisp/emacs-lisp/derived.el
+++ b/lisp/emacs-lisp/derived.el
@@ -113,9 +113,9 @@
113 113
114;;;###autoload 114;;;###autoload
115(defmacro define-derived-mode (child parent name &optional docstring &rest body) 115(defmacro define-derived-mode (child parent name &optional docstring &rest body)
116 "Create a new mode as a variant of an existing mode. 116 "Create a new mode CHILD which is a variant of an existing mode PARENT.
117 117
118The arguments to this command are as follow: 118The arguments are as follows:
119 119
120CHILD: the name of the command for the derived mode. 120CHILD: the name of the command for the derived mode.
121PARENT: the name of the command for the parent mode (e.g. `text-mode') 121PARENT: the name of the command for the parent mode (e.g. `text-mode')
@@ -123,25 +123,28 @@ PARENT: the name of the command for the parent mode (e.g. `text-mode')
123NAME: a string which will appear in the status line (e.g. \"Hypertext\") 123NAME: a string which will appear in the status line (e.g. \"Hypertext\")
124DOCSTRING: an optional documentation string--if you do not supply one, 124DOCSTRING: an optional documentation string--if you do not supply one,
125 the function will attempt to invent something useful. 125 the function will attempt to invent something useful.
126KEYWORDS: optional keywords. 126KEYWORD-ARGS:
127 optional arguments in the form of pairs of keyword and value.
128 The following keyword arguments are currently supported:
129
130 :group GROUP
131 Declare the customization group that corresponds
132 to this mode. The command `customize-mode' uses this.
133 :syntax-table TABLE
134 Use TABLE instead of the default (CHILD-syntax-table).
135 A nil value means to simply use the same syntax-table
136 as the parent.
137 :abbrev-table TABLE
138 Use TABLE instead of the default (CHILD-abbrev-table).
139 A nil value means to simply use the same abbrev-table
140 as the parent.
141 :after-hook FORM
142 A single lisp form which is evaluated after the mode
143 hooks have been run. It should not be quoted.
144
127BODY: forms to execute just before running the 145BODY: forms to execute just before running the
128 hooks for the new mode. Do not use `interactive' here. 146 hooks for the new mode. Do not use `interactive' here.
129 147
130The following keywords are currently supported:
131
132:group GROUP
133 Declare the customization group that corresponds to this mode.
134 The command `customize-mode' uses this.
135:syntax-table TABLE
136 Use TABLE instead of the default (CHILD-syntax-table).
137 A nil value means to simply use the same syntax-table as the parent.
138:abbrev-table TABLE
139 Use TABLE instead of the default (CHILD-abbrev-table).
140 A nil value means to simply use the same abbrev-table as the parent.
141:after-hook FORM
142 A single lisp form which is evaluated after the mode hooks have been
143 run. It should not be quoted.
144
145Here is how you could define LaTeX-Thesis mode as a variant of LaTeX mode: 148Here is how you could define LaTeX-Thesis mode as a variant of LaTeX mode:
146 149
147 (define-derived-mode LaTeX-thesis-mode LaTeX-mode \"LaTeX-Thesis\") 150 (define-derived-mode LaTeX-thesis-mode LaTeX-mode \"LaTeX-Thesis\")
@@ -165,7 +168,7 @@ The new mode runs the hook constructed by the function
165 168
166See Info node `(elisp)Derived Modes' for more details. 169See Info node `(elisp)Derived Modes' for more details.
167 170
168\(fn CHILD PARENT NAME [DOCSTRING] [KEYWORDS...] &rest BODY)" 171\(fn CHILD PARENT NAME [DOCSTRING] [KEYWORD-ARGS...] &rest BODY)"
169 (declare (debug (&define name symbolp sexp [&optional stringp] 172 (declare (debug (&define name symbolp sexp [&optional stringp]
170 [&rest keywordp sexp] def-body)) 173 [&rest keywordp sexp] def-body))
171 (doc-string 4) 174 (doc-string 4)