summaryrefslogtreecommitdiff
path: root/devdocs/elisp/basic-major-modes.html
diff options
context:
space:
mode:
Diffstat (limited to 'devdocs/elisp/basic-major-modes.html')
-rw-r--r--devdocs/elisp/basic-major-modes.html18
1 files changed, 18 insertions, 0 deletions
diff --git a/devdocs/elisp/basic-major-modes.html b/devdocs/elisp/basic-major-modes.html
new file mode 100644
index 00000000..fba3e060
--- /dev/null
+++ b/devdocs/elisp/basic-major-modes.html
@@ -0,0 +1,18 @@
+ <h4 class="subsection">Basic Major Modes</h4> <p>Apart from Fundamental mode, there are three major modes that other major modes commonly derive from: Text mode, Prog mode, and Special mode. While Text mode is useful in its own right (e.g., for editing files ending in <samp>.txt</samp>), Prog mode and Special mode exist mainly to let other modes derive from them. </p> <p>As far as possible, new major modes should be derived, either directly or indirectly, from one of these three modes. One reason is that this allows users to customize a single mode hook (e.g., <code>prog-mode-hook</code>) for an entire family of relevant modes (e.g., all programming language modes). </p> <dl> <dt id="text-mode">Command: <strong>text-mode</strong>
+</dt> <dd>
+<p>Text mode is a major mode for editing human languages. It defines the ‘<samp>"</samp>’ and ‘<samp>\</samp>’ characters as having punctuation syntax (see <a href="syntax-class-table">Syntax Class Table</a>), and binds <kbd>M-<span class="key">TAB</span></kbd> to <code>ispell-complete-word</code> (see <a href="https://www.gnu.org/software/emacs/manual/html_node/emacs/Spelling.html#Spelling">Spelling</a> in <cite>The GNU Emacs Manual</cite>). </p> <p>An example of a major mode derived from Text mode is HTML mode. See <a href="https://www.gnu.org/software/emacs/manual/html_node/emacs/HTML-Mode.html#HTML-Mode">SGML and HTML Modes</a> in <cite>The GNU Emacs Manual</cite>. </p>
+</dd>
+</dl> <dl> <dt id="prog-mode">Command: <strong>prog-mode</strong>
+</dt> <dd>
+<p>Prog mode is a basic major mode for buffers containing programming language source code. Most of the programming language major modes built into Emacs are derived from it. </p> <p>Prog mode binds <code>parse-sexp-ignore-comments</code> to <code>t</code> (see <a href="motion-via-parsing">Motion via Parsing</a>) and <code>bidi-paragraph-direction</code> to <code>left-to-right</code> (see <a href="bidirectional-display">Bidirectional Display</a>). </p>
+</dd>
+</dl> <dl> <dt id="special-mode">Command: <strong>special-mode</strong>
+</dt> <dd>
+<p>Special mode is a basic major mode for buffers containing text that is produced specially by Emacs, rather than directly from a file. Major modes derived from Special mode are given a <code>mode-class</code> property of <code>special</code> (see <a href="major-mode-conventions">Major Mode Conventions</a>). </p> <p>Special mode sets the buffer to read-only. Its keymap defines several common bindings, including <kbd>q</kbd> for <code>quit-window</code> and <kbd>g</kbd> for <code>revert-buffer</code> (see <a href="reverting">Reverting</a>). </p> <p>An example of a major mode derived from Special mode is Buffer Menu mode, which is used by the <samp>*Buffer List*</samp> buffer. See <a href="https://www.gnu.org/software/emacs/manual/html_node/emacs/List-Buffers.html#List-Buffers">Listing Existing Buffers</a> in <cite>The GNU Emacs Manual</cite>. </p>
+</dd>
+</dl> <p>In addition, modes for buffers of tabulated data can inherit from Tabulated List mode, which is in turn derived from Special mode. See <a href="tabulated-list-mode">Tabulated List Mode</a>. </p><div class="_attribution">
+ <p class="_attribution-p">
+ Copyright &copy; 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br>
+ <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Basic-Major-Modes.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Basic-Major-Modes.html</a>
+ </p>
+</div>