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#69259: 30.0.50; (get-pos-property 9483 'cursor-intangible) gives args-out-of-range error in folded magit buffer Date: Wed, 21 Feb 2024 14:31:21 +0200 Message-ID: <86zfvum21y.fsf@gnu.org> References: <87msrxo4ji.fsf@strawberrytea.xyz> <861q98r64n.fsf@gnu.org> <871q97b09m.fsf@strawberrytea.xyz> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20230"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 69259@debbugs.gnu.org, Jonas Bernoulli To: StrawberryTea , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 21 16:33:37 2024 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 1rcobJ-00051i-Gn for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 21 Feb 2024 16:33:37 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rcoVf-00045D-LD; Wed, 21 Feb 2024 10:27:49 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rcoMj-0004a7-QX for bug-gnu-emacs@gnu.org; Wed, 21 Feb 2024 10:18:38 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rclmC-0006sb-4B for bug-gnu-emacs@gnu.org; Wed, 21 Feb 2024 07:32:40 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rclmY-0006pn-2p for bug-gnu-emacs@gnu.org; Wed, 21 Feb 2024 07:33:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 21 Feb 2024 12:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69259 X-GNU-PR-Package: emacs Original-Received: via spool by 69259-submit@debbugs.gnu.org id=B69259.170851872426194 (code B ref 69259); Wed, 21 Feb 2024 12:33:02 +0000 Original-Received: (at 69259) by debbugs.gnu.org; 21 Feb 2024 12:32:04 +0000 Original-Received: from localhost ([127.0.0.1]:47989 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcllb-0006oP-Gb for submit@debbugs.gnu.org; Wed, 21 Feb 2024 07:32:03 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:59058) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcllW-0006na-4q for 69259@debbugs.gnu.org; Wed, 21 Feb 2024 07:32:02 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rcll0-0006e6-6O; Wed, 21 Feb 2024 07:31:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=5kVxY2R99ZPdAp96EIEhVZvyvo5Za0S1IKEKcsLidtA=; b=VFzk6eRoZ0HinrQBxnQM 3IFu+xUj3BTxGULwI01DSI4HpfYgBU7iTV4focOcXac90JN6gQZwkoe8Nzo3JDnwCd3a+Snu5QYu3 spRNE1A5bSIJ6eFz9exmXaPfBff1JJ/HozvJPIzs5oZ3Uq1jj3/zSUSI3KlBwOkJ2mQKKMVw8Eg3J WkwtwfYbWsQAkxQQ5WiAxWMjgOwGlEHq6A0V3CjyPQlG5Tutp7pYuwNxbvSsAs4+ZVRAMSiqVoYpH Bs7028gOQ1kevXQNXN85gER8wSa1JsZHY5cumXev/oAMCh2HomcBLuAPjhnq1HhEGjfKEQiYgRAwt K0+fefsLHEqIrA==; In-Reply-To: <871q97b09m.fsf@strawberrytea.xyz> (message from StrawberryTea on Tue, 20 Feb 2024 09:42:36 -0600) 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:280384 Archived-At: > From: StrawberryTea > Cc: 69259@debbugs.gnu.org > Date: Tue, 20 Feb 2024 09:42:36 -0600 > > Hi Eli. I inserted a print function into magit-post-command-hook: > > (defadvice! cae-magit-section-post-command-hook-a (oldfun) > :around #’magit-section-post-command-hook > (condition-case e > (funcall oldfun) > (error > (+log “magit-post-command-hook error:” > (current-buffer) (selected-window) (buffer-narrowed-p) (point-min) > (point-max) (buffer-size))))) > > and it outputted this: > Values: magit-post-command-hook error:, magit: emacs, # *Messages*>, nil, 1, 20993, 20992 Eli Zaretskii > > So basically, the situation is that the (current-buffer) is magit: emacs whereas > the window is on \*Messages\* and so when we call (get-pos-property pos > ’cursor-intangible), it uses a point value from magit: emacs on the messages > buffer. > > Why exactly are the window-buffer and the current-buffer different? I think this > has to do with persp-mode. My guess is that when it sets the new window > configuration, the current-buffer is not updated to the new window’s buffer > immediately. It is more likely that the post-command-hook was somehow invoked inside with-selected-window or save-window-excursion or something like that. I think cursor-sensor is written under the assumption that the selected window's buffer is also the current buffer, and if so, magit-post-command-hook should abide by that protocol. Stefan, am I right?