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: Re: How to know the buffer I will return to from the minibuffer? Date: Sun, 17 Feb 2019 06:59:06 +0100 Message-ID: <874l93q7kl.fsf@mbork.pl> References: <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="194857"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: mu4e 1.1.0; emacs 27.0.50 Cc: Help Gnu Emacs mailing list To: Drew Adams Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Feb 17 07:00:29 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 1gvFV6-000oWl-Q1 for geh-help-gnu-emacs@m.gmane.org; Sun, 17 Feb 2019 07:00:28 +0100 Original-Received: from localhost ([127.0.0.1]:36986 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvFV5-0001Hb-MT for geh-help-gnu-emacs@m.gmane.org; Sun, 17 Feb 2019 01:00:27 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:54112) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvFUu-0001HL-UN for help-gnu-emacs@gnu.org; Sun, 17 Feb 2019 01:00:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvFUu-0002tL-2y for help-gnu-emacs@gnu.org; Sun, 17 Feb 2019 01:00:16 -0500 Original-Received: from mail.mojserwer.eu ([195.110.48.8]:55222) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvFUt-0002pP-O7 for help-gnu-emacs@gnu.org; Sun, 17 Feb 2019 01:00:15 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 811F5E68C5; Sun, 17 Feb 2019 07:00:04 +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 UJ4H3pyzJrTf; Sun, 17 Feb 2019 06:59:59 +0100 (CET) Original-Received: from localhost (static-dwadziewiec-jedenpiec7.echostar.pl [109.232.29.157]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 1EE45E66A3; Sun, 17 Feb 2019 06:59:59 +0100 (CET) In-reply-to: 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:119435 Archived-At: On 2019-02-14, at 16:38, Drew Adams wrote: >> 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? > > If you use Icicles then that buffer is the value of variable > `icicle-pre-minibuffer-buffer': I don't, but thanks for pointing me to `minibuffer-setup-hook' - it is interesting in itself. Best, -- Marcin Borkowski http://mbork.pl