From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Mario_Castel=c3=a1n_Castro?= Newsgroups: gmane.emacs.help Subject: How to visit a file and kill the current buffer? Date: Sun, 10 Sep 2017 12:13:51 -0500 Message-ID: <82eece41-ee93-636c-1917-39462ce86106@yandex.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="m0dLaeMsUQHi99H6VTWeGo9SOil8AgT3q" X-Trace: blaine.gmane.org 1505319963 27328 195.159.176.226 (13 Sep 2017 16:26:03 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 13 Sep 2017 16:26:03 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 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 19:14:50 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 1dr5oP-0006Jk-2V for geh-help-gnu-emacs@m.gmane.org; Sun, 10 Sep 2017 19:14:25 +0200 Original-Received: from localhost ([::1]:53678 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dr5oW-0002Zs-Ax for geh-help-gnu-emacs@m.gmane.org; Sun, 10 Sep 2017 13:14:32 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54985) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dr5o4-0002Zi-Ld for help-gnu-emacs@gnu.org; Sun, 10 Sep 2017 13:14:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dr5o0-0002re-DX for help-gnu-emacs@gnu.org; Sun, 10 Sep 2017 13:14:04 -0400 Original-Received: from forward106o.mail.yandex.net ([37.140.190.187]:51712) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dr5o0-0002qj-1j for help-gnu-emacs@gnu.org; Sun, 10 Sep 2017 13:14:00 -0400 Original-Received: from mxback16j.mail.yandex.net (mxback16j.mail.yandex.net [IPv6:2a02:6b8:0:1619::92]) by forward106o.mail.yandex.net (Yandex) with ESMTP id 176A4783927 for ; Sun, 10 Sep 2017 20:13:56 +0300 (MSK) Original-Received: from smtp1o.mail.yandex.net (smtp1o.mail.yandex.net [2a02:6b8:0:1a2d::25]) by mxback16j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id BUu2Dt7mcR-DtWCSf7Y; Sun, 10 Sep 2017 20:13:56 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.com; s=mail; t=1505063636; bh=Ekxz50ovLnGN0gafCVYM7TIG1sE6jv3D8Sdi7jVFrVg=; h=To:From:Subject:Message-ID:Date; b=xVESz0LZBfQdzwRgZH1P45lgCbqWnElkPU9qEXiIGP9l2o1cQI4g1wqrPbCtENHPd t8CnhWiOXVZ/okJB+zqK3h6ooghLKV2uuRTVcH6QJzfGXBQ+b9ss4Nj5PnheSrt1E9 QS/c7z6IZE+Ha6GVH8r8gpufChGXxn043jfXqrB8= Original-Received: by smtp1o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id lzeHx3ryKj-DsSaiexw; Sun, 10 Sep 2017 20:13:54 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.com; s=mail; t=1505063635; bh=Ekxz50ovLnGN0gafCVYM7TIG1sE6jv3D8Sdi7jVFrVg=; h=To:From:Subject:Message-ID:Date; b=oL4aYBH5hbSXBeBqxe3QT17cH+owfkLwBMvKGqV1ebuhrwk/o3Px14AIofqaI+qL7 TJThXmJq6spKaAdehbVL0vgIc56kV9THb3iP5T6fGOBgiRrsPxPcZq5ZwmAbA9bHMh A7IAUP/ipXInOAhCLMUkufndL8yu/njdLlWP4+RM= Authentication-Results: smtp1o.mail.yandex.net; dkim=pass header.i=@yandex.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 37.140.190.187 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 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:114258 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --m0dLaeMsUQHi99H6VTWeGo9SOil8AgT3q From: =?UTF-8?Q?Mario_Castel=c3=a1n_Castro?= To: help-gnu-emacs@gnu.org Message-ID: <82eece41-ee93-636c-1917-39462ce86106@yandex.com> Subject: How to visit a file and kill the current buffer? Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello. Is there a way to visit a file in the current window and at the same time kill the previous buffer that occupied the current window? I am looking for something that behaves like the =E2=80=9COpen=E2=80=9D functi= onality in simple GUI text editors (like leafpad). Very often I have a frame displaying a file, but I no longer need to have that 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. Moreover, I tend to forget the later step and then I accumulate a lot of =E2=80=9Cgarbage=E2=80=9D buffers that are visiting files that I am no lo= nger interested in. I must note that I use IDO in case it makes any difference. Thanks. --=20 Do not eat animals; respect them as you respect people. https://duckduckgo.com/?q=3Dhow+to+(become+OR+eat)+vegan --m0dLaeMsUQHi99H6VTWeGo9SOil8AgT3q Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARMIAB0WIQS+wkyTBs7vJfjGA262380TuSZA2QUCWbVyzwAKCRC2380TuSZA 2YseAQDZP5JFUVaXvgINTd4MKeeYsoFDUOZmiIJ+TSg4WIydkwD8DmxrLOrmnmci HhCRkWwFSddhIu7a59FxsaukCkt9pSU= =7Oye -----END PGP SIGNATURE----- --m0dLaeMsUQHi99H6VTWeGo9SOil8AgT3q--