From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#38164: quit-restore-window doesn't restore point in man Date: Fri, 15 Nov 2019 01:13:46 +0200 Organization: LINKOV.NET Message-ID: <874kz6aw5x.fsf@mail.linkov.net> References: <8ea0a3fa-5169-4493-bd54-3ebe47836a35@default> <87r3i9nped.fsf@gnus.org> <87wps1m7co.fsf@web.de> <87r22gbquk.fsf@mail.linkov.net> <875zjrzgoz.fsf_-_@mail.linkov.net> <02f0564a-baf3-b15c-bcc5-98d37f510d7a@gmx.at> <877e45ksaz.fsf@mail.linkov.net> <37ad920d-a8ca-8cc4-33c7-ecec4792eb61@gmx.at> <87sgmrjwih.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="135834"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 38164@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Nov 15 00:23:18 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iVOSM-000ZCI-Eo for geb-bug-gnu-emacs@m.gmane.org; Fri, 15 Nov 2019 00:23:18 +0100 Original-Received: from localhost ([::1]:34490 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iVOSK-0007YF-J9 for geb-bug-gnu-emacs@m.gmane.org; Thu, 14 Nov 2019 18:23:16 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37065) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iVOS8-0007Uk-7I for bug-gnu-emacs@gnu.org; Thu, 14 Nov 2019 18:23:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iVOS6-0001Bt-3o for bug-gnu-emacs@gnu.org; Thu, 14 Nov 2019 18:23:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54833) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iVOS6-0001Bp-0b for bug-gnu-emacs@gnu.org; Thu, 14 Nov 2019 18:23:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iVOS5-000864-RN for bug-gnu-emacs@gnu.org; Thu, 14 Nov 2019 18:23:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Nov 2019 23:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38164 X-GNU-PR-Package: emacs Original-Received: via spool by 38164-submit@debbugs.gnu.org id=B38164.157377372531041 (code B ref 38164); Thu, 14 Nov 2019 23:23:01 +0000 Original-Received: (at 38164) by debbugs.gnu.org; 14 Nov 2019 23:22:05 +0000 Original-Received: from localhost ([127.0.0.1]:35421 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iVORA-00084a-Ty for submit@debbugs.gnu.org; Thu, 14 Nov 2019 18:22:05 -0500 Original-Received: from egyptian.birch.relay.mailchannels.net ([23.83.209.56]:58325) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iVOR8-000844-L0 for 38164@debbugs.gnu.org; Thu, 14 Nov 2019 18:22:04 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 47F21E0B53; Thu, 14 Nov 2019 23:22:01 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a29.g.dreamhost.com (100-96-85-194.trex.outbound.svc.cluster.local [100.96.85.194]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id D74C9E0247; Thu, 14 Nov 2019 23:22:00 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a29.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.18.5); Thu, 14 Nov 2019 23:22:01 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Plucky-Minister: 0cccbe184f644d1f_1573773721100_219294941 X-MC-Loop-Signature: 1573773721100:3795033108 X-MC-Ingress-Time: 1573773721100 Original-Received: from pdx1-sub0-mail-a29.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a29.g.dreamhost.com (Postfix) with ESMTP id E834784631; Thu, 14 Nov 2019 15:21:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=Jz5HZ1b2AoEeVJ0f108X0lIZBYs=; b= ZH7rKreswcereoMLFY0/1LTMcgtfyo8NbdNGkD25DYva8ionW/Ivah+GkcrvOz2D QAOamdZLQfRkZILDMqo9HNbYNINCsQH0nlCkNW1MFcUhlWRSFBwCxcecozTb2CN4 VIG2mVoPu8aOmD1UF5RbrhmlBIgC2IcbkAyBNb0IVyY= Original-Received: from mail.jurta.org (m91-129-102-1.cust.tele2.ee [91.129.102.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a29.g.dreamhost.com (Postfix) with ESMTPSA id 790488462E; Thu, 14 Nov 2019 15:21:55 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a29 In-Reply-To: (martin rudalics's message of "Thu, 14 Nov 2019 10:20:09 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:171623 Archived-At: >> (progn >> (man "XYZ") >> (read-string "--> ")) >> >> 'read-string' activates the minibuffer, but asynchronous Man-bgproc-sentinel >> later calls 'quit-restore-window' that selects its previous window, >> ignoring the fact that now the selected window was in the minibuffer. >> So we need an exception for the case of active minibuffer. > > So what you want is probably (twice) > > (when (and (window-live-p (nth 2 quit-restore)) > (not (eq (selected-window) (minibuffer-window)))) > (select-window (nth 2 quit-restore)))) > > But note that quitting the minibuffer will restore the previous window > configuration and thus undo that selection and all other changes done > by 'quit-restore-window' anyway. Is it possible to not restore the previous window configuration when quitting the minibuffer?