From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: How to visit a file and kill the current buffer? Date: Sun, 10 Sep 2017 21:01:26 +0300 Message-ID: <83wp56touh.fsf@gnu.org> References: <82eece41-ee93-636c-1917-39462ce86106@yandex.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1505066557 15515 195.159.176.226 (10 Sep 2017 18:02:37 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 10 Sep 2017 18:02:37 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Sep 10 20:02:32 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dr6Ym-0003HB-LO for geh-help-gnu-emacs@m.gmane.org; Sun, 10 Sep 2017 20:02:20 +0200 Original-Received: from localhost ([::1]:53805 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dr6Yt-00079e-VB for geh-help-gnu-emacs@m.gmane.org; Sun, 10 Sep 2017 14:02:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35902) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dr6YE-000786-6K for help-gnu-emacs@gnu.org; Sun, 10 Sep 2017 14:01:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dr6YB-0000F9-5R for help-gnu-emacs@gnu.org; Sun, 10 Sep 2017 14:01:46 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:37447) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dr6YB-0000F4-3F for help-gnu-emacs@gnu.org; Sun, 10 Sep 2017 14:01:43 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3524 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dr6Xy-0004cA-NG for help-gnu-emacs@gnu.org; Sun, 10 Sep 2017 14:01:43 -0400 In-reply-to: <82eece41-ee93-636c-1917-39462ce86106@yandex.com> (message from Mario =?utf-8?Q?Castel=C3=A1n?= Castro on Sun, 10 Sep 2017 12:13:51 -0500) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:114229 Archived-At: > 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".