From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#48337: Fwd: 28.0.50; Emacs crashing randomly (possibly minibuffer activity related) Date: Thu, 13 May 2021 12:09:44 +0000 Message-ID: References: <838s4l5uld.fsf@gnu.org> <83zgx14cal.fsf@gnu.org> <83cztx3v04.fsf@gnu.org> <37291ae0-11cb-c817-cf26-b90ad50bfaaa@gmx.at> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28630"; mail-complaints-to="usenet@ciao.gmane.io" Cc: alex.bennee@linaro.org, 48337@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 13 14:10:57 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 1lhAB5-0007K1-TI for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 13 May 2021 14:10:55 +0200 Original-Received: from localhost ([::1]:44466 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhAB4-00049b-Rk for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 13 May 2021 08:10:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57452) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhAAG-00047C-G4 for bug-gnu-emacs@gnu.org; Thu, 13 May 2021 08:10:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58270) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lhAAD-0003qd-Ub for bug-gnu-emacs@gnu.org; Thu, 13 May 2021 08:10:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lhAAD-0004vB-Pw for bug-gnu-emacs@gnu.org; Thu, 13 May 2021 08:10:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 13 May 2021 12:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48337 X-GNU-PR-Package: emacs Original-Received: via spool by 48337-submit@debbugs.gnu.org id=B48337.162090779318899 (code B ref 48337); Thu, 13 May 2021 12:10:01 +0000 Original-Received: (at 48337) by debbugs.gnu.org; 13 May 2021 12:09:53 +0000 Original-Received: from localhost ([127.0.0.1]:41583 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lhAA5-0004uk-1M for submit@debbugs.gnu.org; Thu, 13 May 2021 08:09:53 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:57281 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1lhAA3-0004uY-OJ for 48337@debbugs.gnu.org; Thu, 13 May 2021 08:09:52 -0400 Original-Received: (qmail 98306 invoked by uid 3782); 13 May 2021 12:09:44 -0000 Original-Received: from acm.muc.de (p4fe15ecf.dip0.t-ipconnect.de [79.225.94.207]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 13 May 2021 14:09:44 +0200 Original-Received: (qmail 10510 invoked by uid 1000); 13 May 2021 12:09:44 -0000 Content-Disposition: inline In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de 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:206435 Archived-At: Hello, Martin. On Thu, May 13, 2021 at 11:54:37 +0000, Alan Mackenzie wrote: > How about the following functions, in which minibuf.c now bypasses > record-window-buffer, instead calling push-window-buffer-onto-prev > direct? I'm still not convinced that the call to > buffer-list-update-hooks belongs in record-window-buffer, but that > doesn't seem too important any more. On preliminary testing, these > appear to work: OK, I've wrongly moved the with-current-buffer form in the first function. I'm aware of this and will correct it. Also, I've forgotten to amend the doc string of record-window-buffer. I'll correct that, too. > (defun push-window-buffer-onto-prev (&optional window) > "Push entry for WINDOW's buffer onto WINDOW's prev-buffers list. > WINDOW must be a live window and defaults to the selected one. > Any duplicate entries for the buffer in the list are removed." > (let* ((window (window-normalize-window window t)) > (buffer (window-buffer window)) > (w-list (window-prev-buffers window)) > (entry (assq buffer w-list))) > (when entry > (setq w-list (assq-delete-all buffer w-list))) > (let ((start (window-start window)) > (point (window-point window))) > (setq entry > (cons buffer > (if entry > ;; We have an entry, update marker position. > (list (set-marker (nth 1 entry) start) > (set-marker (nth 2 entry) point)) > (list (copy-marker start) > (copy-marker > ;; Preserve window-point-insertion-type > ;; (Bug#12855) > point (with-current-buffer buffer > window-point-insertion-type)))))) > (set-window-prev-buffers window (cons entry w-list))))) -- Alan Mackenzie (Nuremberg, Germany).