From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#53910: [External] : bug#53910: 29.0.50; context-menu-mode breaks help in read-only buffers Date: Sun, 13 Feb 2022 09:49:10 +0100 Message-ID: <5d2c2af9-d011-583b-e9c1-985bbc2378c2@gmx.at> References: <20220210001600.vjiuqzoiuuzzj54c.ref@Ergus> <20220210001600.vjiuqzoiuuzzj54c@Ergus> <87mtizdwrv.fsf@gnus.org> <86y22jxfsq.fsf@mail.linkov.net> <87o83f7y3x.fsf@gnus.org> <86iltmpn0a.fsf@mail.linkov.net> <86wni13ifi.fsf@mail.linkov.net> <86pmns10kw.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12165"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lars Ingebrigtsen , Ergus , "53910@debbugs.gnu.org" <53910@debbugs.gnu.org> To: Juri Linkov , Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 13 09:50:15 2022 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 1nJAaF-00033C-73 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 13 Feb 2022 09:50:15 +0100 Original-Received: from localhost ([::1]:47348 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nJAaD-0006bA-QE for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 13 Feb 2022 03:50:13 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:38576) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nJAa3-0006al-8K for bug-gnu-emacs@gnu.org; Sun, 13 Feb 2022 03:50:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42367) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nJAa2-0006JB-1J for bug-gnu-emacs@gnu.org; Sun, 13 Feb 2022 03:50:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nJAa2-0008AU-1J for bug-gnu-emacs@gnu.org; Sun, 13 Feb 2022 03:50:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 13 Feb 2022 08:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53910 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 53910-submit@debbugs.gnu.org id=B53910.164474216531347 (code B ref 53910); Sun, 13 Feb 2022 08:50:01 +0000 Original-Received: (at 53910) by debbugs.gnu.org; 13 Feb 2022 08:49:25 +0000 Original-Received: from localhost ([127.0.0.1]:36264 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJAZR-00089W-Bc for submit@debbugs.gnu.org; Sun, 13 Feb 2022 03:49:25 -0500 Original-Received: from mout.gmx.net ([212.227.17.22]:47115) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJAZP-00089H-JF for 53910@debbugs.gnu.org; Sun, 13 Feb 2022 03:49:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1644742152; bh=YSiWKL5WwkxtiJ7+Doan5fO665ihNd4sEkFHZY7T/BE=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=WhNaVSIl+ffxNstTu0STJoGqsPcitAdQAMoiZ79iGPntLxfuH71/Lzj7fHxS3Q6sh cLF7Nbt1aDryzNOTWa/zxKRIH5YSWa8GAhkVUMJwLiGdn/fOilQRRBI4Cgg1mQ5v73 fGQoc4/Zj3Izw4cEkcrEkt9wcIeSxCfIXKU4WnWY= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [192.168.1.101] ([212.95.5.197]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N5GE1-1oJxyH2vXJ-011DO1; Sun, 13 Feb 2022 09:49:12 +0100 Content-Language: en-US In-Reply-To: <86pmns10kw.fsf@mail.linkov.net> X-Provags-ID: V03:K1:4yGufGl3n5viWBTYPt4rOnZmGjmRgxjLAQWlHSpjOvb1i6mEBRI brC6FyVy9e9QlKzYMMuuCphwNFHtK9N8QSjeo49vGwAQnLJwg5YM2V1p4NkUXR0HEufQxAg dKPlpVNuXA0ui+8+e9Xtt5aUgDBkFFZcTUTHW6Z2k+yFpDEPuI2X6EnMWffRZlSvvmekpeG reECWgTSZlymXcQD8THHA== X-UI-Out-Filterresults: notjunk:1;V03:K0:MKZFRf9sO4E=:66AVHRRyniAmcmvAYgc0BA kTUA5RwHnQJJJ4Z4NPPK2Bt71Ck4AAWTJdAJyjp9nWChphtthfsqjapiQ/ULI5PcjIujzGVGD fsYO8rJk2NkTj83oqQ+8ml7OgZTjdQmNmTHwuIgJhMc92n7OaTwhBr6cQIIcvWsPQO6/vyknW yOcC4fjd5PMKE84TfdVVrwWEVdmNQhDVo/q4DBisyhoB54VylyxCgE5bpbhbrGhLO94aWl9GK ZxSPP9z0sp8TRvzo8qlLovxKy66+9oGDOe5vt0rbHoCWbdc9NNuKGE1EHQhvXcIis8KC386h0 kYR7StamWb5tr3DND64TVc4YETPRDQbY3DWrf9v2bXHQcmPKxZMZN0fGWHtnynJmiAZ2jp+wm mXVkhyEBvTv+Xc5Ips0DEpnPVvGU/Q17QolQ09R+mUrvpEJ52soDb1hiWeCbEBsm8Y6vojtON SUd7iZHl8JWrhdO47DFEvL8oMVhoPujAaJKjXnxJF9ms+l0sLiRFJG7BHjMFO1t4VyABV3tvY ZMtnwvGU6UDTNL1t8N1Tdc/3BV58v50QDnMD6oYaKdyCHe+nQ1CSxr6qVxXBbEe5liG2U+wTb Yupcuv9a9Um+jANRfNNS5vYcCXk4Hm7dD/vvwJLnbb4JvPK5NqBh7FFXJwNlJ0q/LlD5vEPQQ 5KqS3dMuOVbJ294eI94+Pxkn+3lJTmKz6ZADLODksdXAe632qraJgProQ5ttW3idIwt6YkZ+G UWZFtOWZj0up0vJQOE9CZ6PefLQQnvH3zZGnaMYxuNCMom+Kly6R91hQ47WWRCoTI+BU7re7 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:226774 Archived-At: > What worries me more is that the following idiom is not always safe: > > (with-selected-window (or window (selected-window)) > body > ...) > > because it might switch the buffer of the already selected window. IIUC you mean that it might make another buffer current? But the whole idea of selecting a window is that it gets you in a consistent state where, for example, the window is the selected window of its frame which is also the selected frame and point returns the position of point of the selected window. Everything else is of evil (on the Lisp level). I don't know why you need that idiom in tab-line.el but, for example, the completely misguided (defun window-safely-shrinkable-p (&optional window) "Return t if WINDOW can be shrunk without shrinking other windows. WINDOW defaults to the selected window." (with-selected-window (or window (selected-window)) (let ((edges (window-edges))) (or (= (nth 2 edges) (nth 2 (window-edges (previous-window)))) (= (nth 0 edges) (nth 0 (window-edges (next-window)))))))) should be written as (defun window-safely-shrinkable-p (&optional window) "Return t if WINDOW can be shrunk without shrinking other windows. WINDOW defaults to the selected window." (let ((edges (window-edges window))) (or (= (nth 2 edges) (nth 2 (window-edges (previous-window window)))) (= (nth 0 edges) (nth 0 (window-edges (next-window window))))))) So I'd urge you to rewrite the tab-line functions in a more safe way. martin