From b76270bf9e6dd375e495fec92140a79a79415d27 Mon Sep 17 00:00:00 2001 From: Patrick J Volkerding Date: Wed, 19 May 2010 08:58:23 +0000 Subject: Slackware 13.1 Wed May 19 08:58:23 UTC 2010 Slackware 13.1 x86_64 stable is released! Lots of thanks are due -- see the RELEASE_NOTES and the rest of the ChangeLog for credits. The ISOs are on their way to replication, a 6 CD-ROM 32-bit set and a dual-sided 32-bit/64-bit x86/x86_64 DVD. We are taking pre-orders now at store.slackware.com, and offering a discount if you sign up for a subscription. Consider picking up a copy to help support the project. Thanks again to the Slackware community for testing, contributing, and generally holding us to a high level of quality. :-) Enjoy! --- misc/slackbook/html/emacs-modes.html | 141 +++++++++++++++++++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 misc/slackbook/html/emacs-modes.html (limited to 'misc/slackbook/html/emacs-modes.html') diff --git a/misc/slackbook/html/emacs-modes.html b/misc/slackbook/html/emacs-modes.html new file mode 100644 index 000000000..ed22a3543 --- /dev/null +++ b/misc/slackbook/html/emacs-modes.html @@ -0,0 +1,141 @@ + + + + +Modes + + + + + + + + + + + +
+

17.3 Modes

+ +

Every buffer in Emacs has an associated mode. This mode is very different from the +idea of modes in vi: a mode tells you what kind of buffer you +are in. For example, there is text-mode for normal text files, but there are also modes +such as c-mode for editing C programs, sh-mode for editing shell scripts, latex-mode for +editing LaTeX files, mail-mode for editing email and news +messages, etc. A mode provides special customizations and functionality that is useful +for the kind of file you are editing. It is even possible for a mode to redefine keys and +key commands. For example, in Text mode, the Tab key simply jumps to the next tab stop, +but in many programming language modes, the Tab key indents the +current line according to the depth of the block that line is in.

+ +

The modes mentioned above are called major modes. Each buffer has exactly one major +mode. Additionally, a buffer can have one or more minor modes. A minor mode provides +additional features that may be useful for certain editing tasks. For example, if you hit +the INSERT key, you invoke overwrite-mode, which does what you'd +expect. There is also an auto-fill-mode, which is handy in combination with text-mode or +latex-mode: it causes each line that you type to be automatically wrapped once the line +reaches a certain number of characters. Without auto-fill-mode, you have to type M-q to fill out a paragraph. (Which you can also +use to reformat a paragraph after you've edited some text in it and it is no longer +nicely filled out.)

+ +
+

17.3.1 Opening +files

+ +

To open a file in Emacs, type

+ + + + + +
+
+C-x C-f
+
+
+ +

Emacs will ask you for the name of the file, filling in some default path for you +(which is usually ~/ ). After you type the filename (you can +use Tab completion) and hit ENTER , Emacs +will open the file in a new buffer and display that buffer on the screen.

+ +
+ + + + + +
Note +

Emacs will automatically create a new buffer, it will not load the file into the +current buffer.

+
+
+ +

In order to create a new file in emacs, you cannot just go typing right away. You +first have to create a buffer for it, and come up with a filename. You do this by typing +C-x C-f and typing a filename, just as if you were opening an existing file. +Emacs will notice that the file you typed doesn't exist, and will create a new buffer and +report “(New file)” in the minibuffer.

+ +

When you type C-x C-f and then enter a directory name instead of a +filename, Emacs will create a new buffer in which you will find a list of all the files +in that directory. You can move the cursor to the file that you are looking for and type +, and Emacs will open it. (There are in fact a lot more actions you can perform here, +such as deleting, renaming and moving files, etc. Emacs is now in dired-mode, which is +basically a simple file manager.)

+ +

When you have typed C-x C-f and suddenly change your mind, you can type +C-g to cancel the action. C-g works almost everywhere where you want to +cancel an action or command that you've started but don't want to finish.

+
+
+ + + + + -- cgit v1.2.3-80-g2a13