From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: pillule Newsgroups: gmane.emacs.bugs Subject: bug#48367: 28.0.50; quit-restore-window may jam Date: Wed, 12 May 2021 14:10:27 +0000 Message-ID: <87sg2s3uwc.fsf@host.localdomain> References: <87h7j9xbj3.fsf@host.localdomain> <13f5a988-f78b-11ed-fcde-fc03ad841390@gmx.at> <87v97o42io.fsf@host.localdomain> <6a45ac55-4727-adca-009c-f4634619c21b@gmx.at> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30992"; mail-complaints-to="usenet@ciao.gmane.io" Cc: pillule , 48367@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 12 16:20:05 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 1lgpiW-0007vL-5F for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 12 May 2021 16:20:04 +0200 Original-Received: from localhost ([::1]:60916 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lgpiV-00028B-1N for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 12 May 2021 10:20:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57718) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lgpZm-00073U-Rt for bug-gnu-emacs@gnu.org; Wed, 12 May 2021 10:11:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56658) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lgpZm-0000wE-5v for bug-gnu-emacs@gnu.org; Wed, 12 May 2021 10:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lgpZm-00019g-1c for bug-gnu-emacs@gnu.org; Wed, 12 May 2021 10:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: pillule Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 12 May 2021 14:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48367 X-GNU-PR-Package: emacs Original-Received: via spool by 48367-submit@debbugs.gnu.org id=B48367.16208286504420 (code B ref 48367); Wed, 12 May 2021 14:11:01 +0000 Original-Received: (at 48367) by debbugs.gnu.org; 12 May 2021 14:10:50 +0000 Original-Received: from localhost ([127.0.0.1]:39971 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lgpZa-00019E-HJ for submit@debbugs.gnu.org; Wed, 12 May 2021 10:10:50 -0400 Original-Received: from mx1.riseup.net ([198.252.153.129]:37912) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lgpZY-00018y-MB for 48367@debbugs.gnu.org; Wed, 12 May 2021 10:10:49 -0400 Original-Received: from fews2.riseup.net (fews2-pn.riseup.net [10.0.1.84]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.riseup.net", Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified)) by mx1.riseup.net (Postfix) with ESMTPS id 4FgGsb1VZTzF24G; Wed, 12 May 2021 07:10:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1620828643; bh=qolm6JiMvVY75fod4H2zQ/dF/qXn+A8vsyoiMlUMDmk=; h=References:From:To:Cc:Subject:In-reply-to:Date:From; b=dqsHpuID7QvhyuzJcDBMjZ/i9NLyK0t+9L+94B4Kcl7//O0oNn31ffq3jM3V3B4vg MXl5+lQgXnQT1z1OrRJRi0ApYCqGLoXxhRFvcVKas15a14buDy1PzELGz+99kdQMSg RBr6Bh3pJIJvFDIK95UI1EgGO4NhuswR6hUQtwvs= X-Riseup-User-ID: B41A1AD654815B3F4CC8A1C85C5D5132720635AB9BB8E664B3F31B0B3FEA8E55 Original-Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews2.riseup.net (Postfix) with ESMTPSA id 4FgGsY1bHNz1xph; Wed, 12 May 2021 07:10:40 -0700 (PDT) In-reply-to: <6a45ac55-4727-adca-009c-f4634619c21b@gmx.at> 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:206326 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable martin rudalics writes: >> Is that OK to call a cl-lib function in the second patch even=20 >> if this library is not required in window.el ? > > No. I only re-compiled and did not build. Please try to avoid=20 > it since > otherwise we get a > > In end of data: > ../../lisp/window.el:5039:29: Warning: the function=20 > =E2=80=98cl-find-if-not=E2=80=99 is not > known to be defined. > > warning. Here an alternative version using subr.el instead : --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=quit-restore-window.patch Content-Description: quit-restore-patch-with-subr.el.patch >From 5c18c2b416b8fb6ef50dee6acc863130847eec03 Mon Sep 17 00:00:00 2001 From: Trust me I am a doctor Date: Wed, 12 May 2021 10:34:40 +0000 Subject: [PATCH] Clarifying code of quit-restore-window Still (bug #48367) This portion may be expressed more succinctly with an higher function. --- lisp/window.el | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lisp/window.el b/lisp/window.el index 24b5df3396..914467aba0 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -5036,14 +5036,10 @@ nil means to not handle the buffer in a particular way. This (setq window (window-normalize-window window t)) (let* ((buffer (window-buffer window)) (quit-restore (window-parameter window 'quit-restore)) - (prev-buffer - (let* ((prev-buffers (window-prev-buffers window)) - (prev-buffer (caar prev-buffers))) - (and (or (not (eq prev-buffer buffer)) - (and (cdr prev-buffers) - (not (eq (setq prev-buffer (cadr prev-buffers)) - buffer)))) - prev-buffer))) + (prev-buffer (catch 'prev-buffer + (dolist (buf (window-prev-buffers window)) + (unless (eq (car buf) buffer) + (throw 'prev-buffer (car buf)))))) quad entry) (cond ((and (not prev-buffer) -- 2.20.1 --=-=-= Content-Type: text/plain; format=flowed > They are trivial and we don't need an assignment for them. But > signing > the agreement is always a good idea. Ok, it's on its way. Thank you for the guidance. -- --=-=-=--