![]() Scroll the buffer in each of the two windows so that you’re looking at the same line of text. You can scroll around in each of the windows independently, but because they are two windows into the same buffer and not two buffers, any change you make to the text in one window will also affect the text seen in the other windows. When you split the current windows into two windows with C-x 2 or C-x 3, you see that each of the new windows contains a view into the same buffer (in this case, the buffer containing the alice1.txt file). The simplest way to create new emacs windows is to split the current window in half, either horizontally or vertically. It’s important to learn how to work with emacs windows, as many emacs command will open windows to display their output or to accept input or interaction beyond what can be done in the minibuffer. In a moment we’ll look at how to create more buffers, but first let’s look at how to work with windows. Congratulations! you’ve just created a buffer. If you don’t still have the file saved somewhere, go ahead and download it from the link above. So now that we know what buffers, windows, and frames are (in emacs terminology at least), how do we use them? To begin, lets open the alice1.txt file that we worked with in the last tutorial. What everyone else in the world calls windows are called “frames” by emacs. Within each “window” you can either display separate buffers, or you can display multiple views into the same buffer. ![]() Instead, it meant splitting the screen horizontally and/or vertically two or more times. So in emacs terminology opening a new window didn’t mean creating an overlapping, independent window like you’d expect in a modern GUI. Instead, it ran full screen in a character mode terminal. Remember that emacs originally didn’t run in a windowing GUI. And here is where the antique nature of emacs becomes important. Additionally, there are other specialized buffers, like the minibuffer, buffers that contain the emacs online help system, buffers that are attached to the input/output of a shell or other process, etc.īuffers are displayed in windows and frames. You can also have an unlimited number of scratch buffers, which are buffers that haven’t been saved to a file. However, not every buffer contains a file. In emacs, each file you open is contained in a separate buffer. Why is this important? We’ll see shortly.īut first, lets talk about buffers. Recall that emacs was created waaaay back in the almost prehistoric times before modern windowing interfaces. So let’s look at how to work with multiple files in emacs. But it’s pretty lame to only be able to work on one file at a time. So far, we’ve learned how to open files, save files, and navigate around a file.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |