[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to visit a file and kill the current buffer?

From: Eli Zaretskii
Subject: Re: How to visit a file and kill the current buffer?
Date: Sun, 10 Sep 2017 21:01:26 +0300

> From: Mario Castelán Castro <>
> Date: Sun, 10 Sep 2017 12:13:51 -0500
> Very often I have a frame displaying a file, but I no longer need to
> have that file open.

Emacs doesn't keep the file open after visiting it.  The file's
contents is read into a buffer, and the file is closed.  So you
shouldn't worry about leaving the file open.

> I wish to instead open another file. What I do
> currently is to do C-x C-f and visit the new file, then kill the now
> unneeded buffer, but it is annoying to have to do this in 2 steps.

You don't need to kill the buffer.

> Moreover, I tend to forget the later step and then I accumulate a lot of
> “garbage” buffers that are visiting files that I am no longer interested in.

Activate midnight-mode, and all those buffers will be automatically
killed for you.

IOW, I think you are looking for a solution to a problem that doesn't
really exists in Emacs.  It only exists in those "simple GUI editors".

reply via email to

[Prev in Thread] Current Thread [Next in Thread]