unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Joe Corneli <jcorneli@math.utexas.edu>
Subject: Re: Shortcut to change buffers?
Date: Thu, 21 Apr 2005 09:25:27 -0500	[thread overview]
Message-ID: <E1DOccR-0003Iu-00@lab45.ma.utexas.edu> (raw)
In-Reply-To: <d48cfn$svp$1@news.net.uni-c.dk> (message from JS on Thu, 21 Apr 2005 16:15:50 +0200)

>From the tutorial (C-h T) -- which you should read all of --

* BUFFERS
---------

If you find a second file with C-x C-f, the first file remains
inside Emacs.  You can switch back to it by finding it again with
C-x C-f.  This way you can get quite a number of files inside Emacs.

>> Create a file named "foo" by typing  C-x C-f foo <Return>.
   Then insert some text, edit it, and save "foo" by typing  C-x C-s.
   Finally, type C-x C-f TUTORIAL <Return>
   to come back to the tutorial.

Emacs stores each file's text inside an object called a "buffer".
Finding a file makes a new buffer inside Emacs.  To see a list of the
buffers that currently exist in your Emacs job, type

	C-x C-b   List buffers

>> Try C-x C-b now.

See how each buffer has a name, and it may also have a file name for
the file whose contents it holds.  ANY text you see in an Emacs window
is always part of some buffer.

>> Type C-x 1 to get rid of the buffer list.

When you have several buffers, only one of them is "current" at any
time.  That buffer is the one you edit.  If you want to edit another
buffer, you need to "switch" to it.  If you want to switch to a buffer
that corresponds to a file, you can do it by visiting the file again
with C-x C-f.  But there is an easier way: use the C-x b command.
In that command, you have to type the buffer's name.

>> Type C-x b foo <Return> to go back to the buffer "foo" which holds
   the text of the file "foo".  Then type C-x b TUTORIAL <Return>
   to come back to this tutorial.

Most of the time, the buffer's name is the same as the file name
(without the file directory part).  However, this is not always true.
The buffer list you make with C-x C-b always shows you the name of
every buffer.

ANY text you see in an Emacs window is always part of some buffer.
Some buffers do not correspond to files.  For example, the buffer
named "*Buffer List*" does not have any file.  It is the buffer which
contains the buffer list that you made with C-x C-b.  The buffer named
"*Messages*" also does not correspond to any file; it contains the
messages that have appeared on the bottom line during your Emacs
session.

>> Type C-x b *Messages* <Return> to look at the buffer of messages.
   Then type C-x b TUTORIAL <Return> to come back to this tutorial.

If you make changes to the text of one file, then find another file,
this does not save the first file.  Its changes remain inside Emacs,
in that file's buffer.  The creation or editing of the second file's
buffer has no effect on the first file's buffer.  This is very useful,
but it also means that you need a convenient way to save the first
file's buffer.  It would be a nuisance to have to switch back to
it with C-x C-f in order to save it with C-x C-s.  So we have

	C-x s     Save some buffers

C-x s asks you about each buffer which contains changes that you have
not saved.  It asks you, for each such buffer, whether to save the
buffer.

>> Insert a line of text, then type C-x s.
   It should ask you whether to save the buffer named TUTORIAL.
   Answer yes to the question by typing "y".

  reply	other threads:[~2005-04-21 14:25 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-21 14:15 Shortcut to change buffers? JS
2005-04-21 14:25 ` Joe Corneli [this message]
     [not found] ` <mailman.2409.1114093596.2895.help-gnu-emacs@gnu.org>
2005-04-21 14:51   ` JS
2005-04-21 15:04     ` Slawomir Nowaczyk
     [not found]     ` <mailman.2416.1114096435.2895.help-gnu-emacs@gnu.org>
2005-04-21 15:24       ` JS
2005-04-21 15:56         ` Slawomir Nowaczyk
2005-04-21 15:39     ` Kevin Rodgers
2005-04-21 16:33     ` Drew Adams
2005-04-22 15:41       ` Drew Adams
     [not found]     ` <mailman.2417.1114098305.2895.help-gnu-emacs@gnu.org>
2005-04-21 18:20       ` JS
2005-04-21 21:54     ` Joe Corneli
2005-04-22 10:21     ` Steinar Børmer
2005-04-22 11:54       ` JS
2005-04-25 21:57         ` Steinar Børmer
2005-04-21 16:33 ` Klaus Berndl
2005-04-21 18:09   ` JS
  -- strict thread matches above, loose matches on Subject: below --
2005-04-21 18:35 Ryan Bowman
     [not found] <mailman.2447.1114108880.2895.help-gnu-emacs@gnu.org>
2005-04-22  1:25 ` Quokka
2005-04-22  9:54   ` JS
2005-04-22 10:34     ` Tim X
2005-04-22 10:56       ` JS
2005-04-23  5:04         ` Tim X
2005-04-22 11:24       ` JS
2005-04-22 14:45         ` Mathias Dahl
2005-04-22 15:18           ` JS
2005-04-22 15:23             ` David Kastrup
2005-04-25  7:04               ` Mathias Dahl
2005-04-23  5:08         ` Tim X

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1DOccR-0003Iu-00@lab45.ma.utexas.edu \
    --to=jcorneli@math.utexas.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).