pico filename

 < Day Day Up > 

If the filename you designate does not already exist, a new file with that name will be created. Changes made to a file do not become permanent until you write them to the system. The command to do this is the Ctrl key followed by lowercase o. You can then exit Pico using the Ctrl key followed by the x key.


According to the Emacs manual, Emacs is an extensible, customizable, self- documenting real-time display editor. The name Emacs was originally an abbreviation of Editor MACroS. This is because Emacs was originally used strictly to edit macros. Macros are, in essence, mini programs, not unlike the shell scripts we previously explored. The original Emacs implementation was written for a rather specific system called the Incompatible Timesharing System (ITS). There was a custom of giving such macro packages names ending in the syllable mac or macs.

Emacs is perhaps the most powerful of the editors, but also the most complex. Entire books have been written on Emacs. This means that we will be touching on only the basics in this chapter. You also will find a lot of documentation on Emacs on the Internet. You can find some help from Web sites listed in Appendix A, “Other Resources,” or you can enter “Emacs” into your favorite search engine, and you will get quite a few responses. The Emacs documentation uses some specific terminology. You need to understand some of these terms to be able to use all the free help available on the Internet. Table 21.4 summarizes the more commonly used terms.

Table 21.4: Emacs Terminology

Emacs Term



Emacs loads files into internal buffers. A buffer is a temporary area in memory often used in many programs and operating systems to hold files that are currently being worked on. In some Emacs documentation, the file you are editing may be referred to as a buffer.


One Emacs process can produce a number of separate windows. Emacs calls each of these windows a frame.


Each frame can be split into sections that Emacs calls windows.


This designates the actual point where the text cursor currently is.

meta keys

Emacs documentation often refers to the Escape key as a meta key.


Emacs is not a self-contained binary. Many of Emacs’ commands are written in a language called Lisp. To call one of these functions by name, type M-x function name. The files containing these functions are in the directory /usr/src/editors/Emacs/lisp. You can write your own Lisp functions, but nearly all users will be able to do what they want without having to do this.

The syntax for opening a file with Emacs is much like the syntax for opening a file with Pico or vi:

   emacs filename

When you open a file, such as one of the script files from the previous chapter, you should see something like what is shown in Figure 21.8.

click to expand
Figure 21.8: Opening a file with Emacs.

You should note that when you do this, you launch a new window (if you are using a terminal within some desktop environment such as KDE or GNOME). The Emacs editor is split into two areas. The top area is where you edit your text, and the bottom area is the echo area. The echo area displays the commands you issue and any messages the Emacs editors have for you. You can abort a command by pressing the Ctrl key and the g key in combination.

The text area and the echo area are separated by a line called the mode line. This line shows the current status information of Emacs. Emacs uses a number of symbols to communicate information about the file you are editing. For example, the Emacs editor will place two asterisks (**) in front of the buffer name if changes have been made but not yet saved. Two percent signs (%%) will appear if the file is read-only. Next to the buffer name will be the major mode of the buffer. These modes control the way Emacs behaves with your text and consist of the text, lisp, and c modes. Next to the major mode will be a list of the minor options that can be altered. Next to this will be a display showing the percentage of the file displayed.

Most Emacs commands are based on the use of the Ctrl key or the Escape key (meta key). However, each of these keys works slightly differently. The Ctrl key should be held down while the next key is pressed. The Escape key, however, should be pressed and then released before entering the next key sequence. Also, the Ctrl key should be held only for the next character. For example, the command Ctrl-X U means hold down the Ctrl key and press x and then release the Ctrl key and press the u key. Some commands do not have key sequences assigned to them and must be entered by hand. You can exit the Emacs editor by either using Ctrl-X or Ctrl-C.

 < Day Day Up > 

Moving From Windows to Linux
Moving From Windows To Linux (Charles River Media Networking/Security)
ISBN: 1584502800
EAN: 2147483647
Year: 2004
Pages: 247
Authors: Chuck Easttom

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net