Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content/cftbat/basic-emacs.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ <h3>Emacs Is a Lisp Interpreter</h3>
<h3>Modes</h3>
<p class="BodyFirst">An Emacs <em>mode</em> is a collection of key bindings and functions that are packaged together to help you be productive when editing different types of files. (Modes also do things like tell Emacs how to do syntax highlighting, but that’s of secondary importance, and I won’t cover that here.)</p>
<p class="Body"><span>For example, when you’re editing a Clojure file, you’ll want to load Clojure mode. Right now I’m writing a Markdown file and using </span>Markdown mode, which has lots of useful key bindings specific to working with Markdown. When editing Clojure, it’s best to have a set of Clojure-specific key bindings, like <strong>C-c C-k</strong> to load the current buffer into a REPL and compile it.</p>
<p class="Body">Modes come in two flavors: <em>major</em> modes and <em>minor</em> modes. Markdown mode and Clojure mode are major modes. Major modes are usually set by Emacs when you open a file, but you can also set the mode explicitly by running the relevant Emacs command, for example with<code> </code><strong>M-x </strong><span class="LiteralBold">clojure-mode</span> or <strong>M-x </strong><span class="LiteralBold">major-mode</span>. Only one major mode is active at a time.</p>
<p class="Body">Modes come in two flavors: <em>major</em> modes and <em>minor</em> modes. Markdown mode and Clojure mode are major modes. Major modes are usually set by Emacs when you open a file, but you can also set the mode explicitly by running the relevant Emacs command, for example with<code> </code><strong>M-x </strong><span class="LiteralBold">clojure-mode</span> or <strong>M-x </strong><span class="LiteralBold">markdown-mode</span>. Only one major mode is active at a time.</p>
<p class="Body"><span>Whereas major modes specialize Emacs for a certain file type or </span><span>language</span>, minor modes usually provide functionality that’s useful across file types. For example, abbrev mode “automatically expands text based on pre-defined abbreviation definitions” (per the Emacs manual<sup><a id="footnote-5680-1-backlink" class="footnote-link" href="#footnote-5680-1">1.</a></sup>). You can have multiple minor modes active at the same time.</p>
<p class="Body">You can see which modes are active on the <em>mode line</em>, as shown in Figure 2-7.</p>
<img src="/assets/images/cftbat/basic-emacs/emacs-mode-line.png" />
Expand Down