From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#48409: Text runs away before user can copy it Date: Sat, 15 May 2021 08:56:41 +0300 Message-ID: <83im3ky1ye.fsf@gnu.org> References: <87cztt4yg9.5.fsf@jidanni.org> <83fsypztd4.fsf@gnu.org> <87cztt9qdj.fsf@mail.linkov.net> <83mtsxxfo8.fsf@gnu.org> <83lf8hxedd.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15318"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 48409@debbugs.gnu.org, juri@linkov.net To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 15 07:57:11 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lhnIU-0003oS-KK for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 15 May 2021 07:57:10 +0200 Original-Received: from localhost ([::1]:36822 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhnIS-0006yN-Qu for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 15 May 2021 01:57:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59886) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhnIM-0006yD-Iv for bug-gnu-emacs@gnu.org; Sat, 15 May 2021 01:57:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35848) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lhnIM-0007eC-BS for bug-gnu-emacs@gnu.org; Sat, 15 May 2021 01:57:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lhnIM-0007cc-99 for bug-gnu-emacs@gnu.org; Sat, 15 May 2021 01:57:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 May 2021 05:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48409 X-GNU-PR-Package: emacs Original-Received: via spool by 48409-submit@debbugs.gnu.org id=B48409.162105821729288 (code B ref 48409); Sat, 15 May 2021 05:57:02 +0000 Original-Received: (at 48409) by debbugs.gnu.org; 15 May 2021 05:56:57 +0000 Original-Received: from localhost ([127.0.0.1]:47394 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lhnIG-0007cI-9B for submit@debbugs.gnu.org; Sat, 15 May 2021 01:56:57 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:37976) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lhnIC-0007c2-A5 for 48409@debbugs.gnu.org; Sat, 15 May 2021 01:56:55 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:60762) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhnI5-0007Tv-W1; Sat, 15 May 2021 01:56:46 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3993 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhnI5-0005mZ-9n; Sat, 15 May 2021 01:56:45 -0400 In-Reply-To: (message from Alan Mackenzie on Fri, 14 May 2021 20:53:38 +0000) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:206565 Archived-At: > Date: Fri, 14 May 2021 20:53:38 +0000 > Cc: juri@linkov.net, 48409@debbugs.gnu.org > From: Alan Mackenzie > > > Alan, is the below the right fix? The problem is that no one is > > setting up the minibuffer in inactive mode until after the first time > > the minibuffer is activated. > > > diff --git a/src/minibuf.c b/src/minibuf.c > > index 428998a..9ec93a0 100644 > > --- a/src/minibuf.c > > +++ b/src/minibuf.c > > @@ -2297,6 +2297,8 @@ init_minibuf_once_for_pdumper (void) > > minibuf_prompt = Qnil; > > minibuf_save_list = Qnil; > > last_minibuf_string = Qnil; > > + Lisp_Object minibuf = get_minibuffer (0); > > + set_minibuffer_mode (minibuf, 0); > > } > > > > void > > I'm not entirely sure. I actually added a "get_minibuffer (0);" to > init_minibuf_once in my commit earlier on today, so perhaps the > "set_minibuffer_mode (minibuf, 0);" really belongs in that function. init_minibuf_once isn't called after dumping, so that would not help. We need to make sure the minibuffer is put in inactive mode when we start Emacs. > I'm not quite sure in my own mind what should go into init_minibuf_once > and what into init_minibuf_once_for_pdumper. I've taken as the > criterion what the comment there says: > > /* We run this function on first initialization and whenever we > restore from a dump file. pdumper doesn't try to preserve > frames, windows, and so on, so reset everything related here. */ > > , and thus put the creation of *Minibuf-0* into init_minibuf_once. See above: this won't survive the dumping because the minibuffer's mode isn't dumped. And I see no reason to dump it; after all, it only makes sense to dump things whose preparation is time-consuming. > It would be good to have a relatively simple fix for something in > minibuf.c, for once. ;-) And I thought I was fine providing a very simple fix. Oh well...