From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: How to visit a file and kill the current buffer? Date: Sun, 10 Sep 2017 18:18:30 +0000 (UTC) Message-ID: References: <82eece41-ee93-636c-1917-39462ce86106@yandex.com> <83wp56touh.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1505067555 29830 195.159.176.226 (10 Sep 2017 18:19:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 10 Sep 2017 18:19:15 +0000 (UTC) To: Eli Zaretskii , 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:19:09 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 1dr6ov-000754-2x for geh-help-gnu-emacs@m.gmane.org; Sun, 10 Sep 2017 20:19:01 +0200 Original-Received: from localhost ([::1]:53844 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dr6p2-00033h-Dy for geh-help-gnu-emacs@m.gmane.org; Sun, 10 Sep 2017 14:19:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39076) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dr6ob-00033b-I9 for help-gnu-emacs@gnu.org; Sun, 10 Sep 2017 14:18:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dr6oa-0001W4-Jd for help-gnu-emacs@gnu.org; Sun, 10 Sep 2017 14:18:41 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:19768) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dr6oT-0001Uw-IK; Sun, 10 Sep 2017 14:18:33 -0400 Original-Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v8AIIVEL004219 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 10 Sep 2017 18:18:32 GMT Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id v8AIIVf9003530 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 10 Sep 2017 18:18:31 GMT Original-Received: from ubhmp0018.oracle.com (ubhmp0018.oracle.com [156.151.24.71]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v8AIIVrx011061; Sun, 10 Sep 2017 18:18:31 GMT In-Reply-To: <83wp56touh.fsf@gnu.org> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6774.5000 (x86)] X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] [fuzzy] X-Received-From: 141.146.126.69 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:114231 Archived-At: > > Very often I have a frame displaying a file, but I no longer need to > > have that file open. >=20 > 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. >=20 > > 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. >=20 > You don't need to kill the buffer. >=20 > > Moreover, I tend to forget the later step and then I accumulate a lot o= f > > =E2=80=9Cgarbage=E2=80=9D buffers that are visiting files that I am no = longer interested > in. >=20 > Activate midnight-mode, and all those buffers will be automatically > killed for you. >=20 > 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". I think that perhaps you and others who have replied to this so far have misunderstood what the request is (or else I have). I think he's asking to kill the current buffer and visit a file in its window. That's `C-x C-v'.