From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: Return values of (find-file-noselect), etc. Date: Sun, 06 Jan 2019 17:13:27 -0500 Message-ID: References: <71340fe0-7373-f407-3bc7-7a2dcaf6b3b3@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1546812719 14918 195.159.176.226 (6 Jan 2019 22:11:59 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 6 Jan 2019 22:11:59 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jan 06 23:11:55 2019 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from listsout.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ggGeA-0003mz-VC for geh-help-gnu-emacs@m.gmane.org; Sun, 06 Jan 2019 23:11:55 +0100 Original-Received: from localhost ([127.0.0.1]:39398 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggGgH-0002JD-FO for geh-help-gnu-emacs@m.gmane.org; Sun, 06 Jan 2019 17:14:05 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:43800) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggGfp-0002J5-Mq for help-gnu-emacs@gnu.org; Sun, 06 Jan 2019 17:13:38 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ggGfo-00051h-Oe for help-gnu-emacs@gnu.org; Sun, 06 Jan 2019 17:13:37 -0500 Original-Received: from [195.159.176.226] (port=55286 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ggGfo-00051S-Hy for help-gnu-emacs@gnu.org; Sun, 06 Jan 2019 17:13:36 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1ggGde-0003GO-Em for help-gnu-emacs@gnu.org; Sun, 06 Jan 2019 23:11:22 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 14 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:mWpNjRmYJTpp/STXrBoMQztQ++4= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 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:119084 Archived-At: > If I have my emacs environment set up to call (cpio-mode) when it > detects that a file is a cpio archive, then, e.g. (find-file-noselect > "cpio-archive"), returns the dired-style buffer, not the buffer of the > found file. So, any processing based on the newly found file is done > with the dired-style buffer instead of the buffer with the newly found file. It should return the buffer whose buffer-file-name is that of the file. I think in your case, that should be the dired-style buffer and *also* the buffer from which cpio-mode was called (i.e. the buffer which originally held the file's content). In RMAIL we satisfy these constraints using buffer-swap-text. Stefan