From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.help Subject: How to know the buffer I will return to from the minibuffer? Date: Thu, 14 Feb 2019 08:10:54 +0100 Message-ID: <87r2caonep.fsf@mbork.pl> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="206333"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: mu4e 1.1.0; emacs 27.0.50 To: Help Gnu Emacs mailing list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Feb 14 08:12:14 2019 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1guBBt-000rYM-4A for geh-help-gnu-emacs@m.gmane.org; Thu, 14 Feb 2019 08:12:13 +0100 Original-Received: from localhost ([127.0.0.1]:41915 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guBBs-0001YM-4N for geh-help-gnu-emacs@m.gmane.org; Thu, 14 Feb 2019 02:12:12 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:50359) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guBBd-0001Wr-Bw for help-gnu-emacs@gnu.org; Thu, 14 Feb 2019 02:11:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1guBBc-0005Zy-9N for help-gnu-emacs@gnu.org; Thu, 14 Feb 2019 02:11:57 -0500 Original-Received: from mail.mojserwer.eu ([195.110.48.8]:38836) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guBBc-0005XG-0l for help-gnu-emacs@gnu.org; Thu, 14 Feb 2019 02:11:56 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 1F288E671E for ; Thu, 14 Feb 2019 08:11:53 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu Original-Received: from mail.mojserwer.eu ([127.0.0.1]) by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 36iYbN4vdS9Y for ; Thu, 14 Feb 2019 08:11:49 +0100 (CET) Original-Received: from localhost (apn-95-40-154-76.dynamic.gprs.plus.pl [95.40.154.76]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 9F620E6554 for ; Thu, 14 Feb 2019 08:11:49 +0100 (CET) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.110.48.8 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:119395 Archived-At: Hi all, I am writing an interactive command to be used while in the minibuffer. I need to know the buffer I was in when I issued the command that put me in the minibuffer (like M-: or M-!). I tried (other-buffer (current-buffer)) and (last-buffer (current-buffer)), but to no avail. Then I re-read the docs for `other-buffer' and used this: (other-buffer (current-buffer) t), and it seemed to work. The question is, how reliable it is. Am I doing this correctly? TIA, -- Marcin Borkowski http://mbork.pl