From unknown Fri Sep 05 09:30:12 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#54800 <54800@debbugs.gnu.org> To: bug#54800 <54800@debbugs.gnu.org> Subject: Status: 28.1; calc: Cursor positioned at weird position in calc stack Reply-To: bug#54800 <54800@debbugs.gnu.org> Date: Fri, 05 Sep 2025 16:30:12 +0000 retitle 54800 28.1; calc: Cursor positioned at weird position in calc stack reassign 54800 emacs submitter 54800 Christoph Arenz severity 54800 normal tag 54800 moreinfo thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 08 15:44:47 2022 Received: (at submit) by debbugs.gnu.org; 8 Apr 2022 19:44:47 +0000 Received: from localhost ([127.0.0.1]:36018 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ncuXH-0005h5-1z for submit@debbugs.gnu.org; Fri, 08 Apr 2022 15:44:47 -0400 Received: from lists.gnu.org ([209.51.188.17]:44246) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ncuXE-0005gx-Gg for submit@debbugs.gnu.org; Fri, 08 Apr 2022 15:44:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57786) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ncuXE-0002aF-A0 for bug-gnu-emacs@gnu.org; Fri, 08 Apr 2022 15:44:44 -0400 Received: from mout.web.de ([212.227.17.11]:57011) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ncuXC-0005Kf-6S for bug-gnu-emacs@gnu.org; Fri, 08 Apr 2022 15:44:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1649447079; bh=4brtjj4FkErvPzxukJX9VyIPx5GLEYfI8yac5xzcO+Q=; h=X-UI-Sender-Class:Date:To:Subject:From; b=el6MszR6fn0jTXd7kDPCn0BCVwLRJP3NmaranOkgRbIW4AygYct8cwPO9Yp/HnxM7 WRrG6RnHXNwDMCLJxOsJSPBL/IofHHGpxrg65CiuBRh3+PDtJKAAK/GhdnPXoeEx/P 74zH/Eg6m48mA3YL5cz/wBynKn5s+aWQ8Z+2Sp5g= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from [192.168.188.20] ([5.83.177.87]) by smtp.web.de (mrweb105 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MqqTb-1oGfCB45yr-00msEJ for ; Fri, 08 Apr 2022 21:44:39 +0200 Content-Type: multipart/alternative; boundary="------------DoEdFgjKBxYtTz2RW4dX4z0a" Message-ID: <4a0319d6-b533-b3d8-bf52-bb18d74757e1@web.de> Date: Fri, 8 Apr 2022 21:44:38 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 To: bug-gnu-emacs@gnu.org Subject: 28.1; calc: Cursor positioned at weird position in calc stack Content-Language: en-US From: Christoph Arenz X-Provags-ID: V03:K1:J+cV0PtUS55IUm2tmapmR60a+dVwkWQJAVelREuqDeuLEJy5nFL A9rjzJOYFnLQerqXLSOZiZknN/5GNR/49So53l+TkWKzhPBVS86MAw3NQ8cWNg5kPuv/l9m pxZTi2uCMdoHIfQcGRWBaiB5rvKcR/Li2Bc40PQG+WZLrP5EOKeb6y29CvvyzsJ2UsAafSt mizIke3kc+lezz47QXjrg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:5S7s40SFJYc=:Oqr+utCAmXA7hpeJsLZiDu h/yan/EI2C+kE8jwdrytr2otKwgDoBqNtZKeB2LJccZn3teZM/0ZDJJkozEFNMokrzwejUlgl ilhOB8i5UBwd8dfxA7JnKs+1/gKKsFiEMUkoEjwGwrwU71eHw4wwtCzRNE+PvNI8GesKouC2s sl4HYrETcd6D1tfhlLSMrCB82WsDZGpmgHNVYDBmXqy5fd5WmgSyHKUcX8DXgWdwUCfyVKbKH LStrYWO+8TKqiYlXmPZNlap5+/c7WQVQxXCCxsgirUZqn7l41gvkWeYS2UUN+iOMkR9GvOxdT t5H/Hhlr/0N5ALiM+C4FfravLOHRbronYhGSvy86u0IZk7KgCPQU2Xdfvo9BKR4aNirFeNzaW i7KdjI9QmuqBFCVXfWSlZ6J0b2KArGZ/MmaSydQpZOyxB3CfEPuv0aSw3JE66hSap2O4pmhkD Cd8kUPz73TTktB8RURUZPUqz51i21CxKtOkHW2B/dm15Dfdcv6KfxuYBGqT3mIUVRVP+5qfkZ UmdkcjUB/ZGz6Nxl7+pc3LTN7Pp/bMMDvXGQPQJPdOqvPSGY+zyt8NjqqI8QmgNeEdQa8jxwn b6orYRYo3NeE+mALPEoU55mwqIGep7FEAzaPSsQb4VD6/EyUWWgqkoAZCniDLSCrQM+Lu6u+r jzSAWK+aTcS7x81KadAn+ytkjKIy3y828rZhU+KekBOj5HmlZN2o4/52dHMeZ4big9opwKeBr n3vgUvBn+J2p77Zi+OjJCjASuBIAnWdCduiD4TUWMRtaJETWXw12YzRT0wwuWlcHH9jLBNJ08 M7eeT9aCH8OyFjKb/kbLYh9huvJgMxTb7q7xmJYLNTN4Q7vxWfv2OYYpZe6RYQCb9GubBeHBS j4mbBmWW7qz79QzRDDVQzcSbFLs1rFtPtYONrKs2gWr1NoUbNeTn6wp4Bg9zFytqO84e7qzHc pHMpIxXKPGhl09k3+VKHTBquKLDtohw7PYuu356dw/mrt79yrpotjthA6IrdIBs41NS2PsCY0 ++h1TQ9EQ1jP/SubSf9CwrRWrCvllLK3B2EQ+GbCJpD02UII6FZ81ZTYyQLn2x9bZEOkO3+dP Xj9slft4Eq4+9s= Received-SPF: pass client-ip=212.227.17.11; envelope-from=tiga.arenz@web.de; helo=mout.web.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) This is a multi-part message in MIME format. --------------DoEdFgjKBxYtTz2RW4dX4z0a Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable When the content of the calc stack inclusive top-of-stack symbol `.' gets larger in height than the calc window, the cursor is positioned at a weird position in the upper half of the stack window. When line-numbering is on, the cursor is positioned at the beginning of the line at the line number. Calling `calc-realign' does not change the cursor postion. How to reproduce: 1. emacs -Q 2. C-x * * (to start calc) 3. enter a number and RET 4. repeat No. 3 until the stacks grows and the symptom appears Expected behavior for the cursor is to be placed on the `.' symbol, representing the top of the stack. 5. After pressing `o' [calc-realign], the expected behavior would also be for the cursor to be positioned at the top of the calc stack. Debugging the function calc-align-stack-window with edebug, the symptom goes away when placing a breakpoint at the line (calc-cursor-stack-index 0) just after the set-window-start call, and then continuing from there. The following patch fixes the problem for me, but I do not fully understand the NOFORCE option of the set-window-start function. Thanks, Christoph 1 file changed, 1 insertion(+), 1 deletion(-) lisp/calc/calc.el | 2 +- modified=C2=A0=C2=A0 lisp/calc/calc.el @@ -1816,7 +1816,7 @@ calc-align-stack-window =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (progn =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 (calc-cursor-stack-index 0) =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 (vertical-motion (- 2 (window= -height win))) -=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 (set-window-start win (point))))) +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 (set-window-start win (point) 'nofo= rce)))) =C2=A0=C2=A0=C2=A0=C2=A0 (calc-cursor-stack-index 0) =C2=A0=C2=A0=C2=A0=C2=A0 (if (looking-at " *\\.$") =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 (goto-char (1- (match-end 0))= ))) In GNU Emacs 28.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30, cairo version 1.15.10) of 2022-04-05 built on M92p Repository revision: 5a223c7f2ef4c31abbd46367b6ea83cd19d30aa7 Repository branch: HEAD Windowing system distributor 'The X.Org Foundation', version 11.0.11906000 System Description: Ubuntu 18.04.6 LTS Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG LCMS2 LIBOTF LIBSELINUX LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM GTK3 ZLIB Important settings: value of $LC_MONETARY: de_DE.UTF-8 value of $LC_NUMERIC: de_DE.UTF-8 value of $LC_TIME: de_DE.UTF-8 value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=3Dibus locale-coding-system: utf-8-unix --------------DoEdFgjKBxYtTz2RW4dX4z0a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable When the content of the calc stack inclusive top-of-stack symbol `.'
gets larger in height than the calc window, the cursor is positioned at
a weird position in the upper half of the stack window. When
line-numbering is on, the cursor is positioned at the beginning of the
line at the line number. Calling `calc-realign' does not change the
cursor postion.

How to reproduce:
1. emacs -Q
2. C-x * * (to start calc)
3. enter a number and RET
4. repeat No. 3 until the stacks grows and the symptom appears

Expected behavior for the cursor is to be placed on the `.' symbol,
representing the top of the stack.

5. After pressing `o' [calc-realign], the expected behavior would also
be for the cursor to be positioned at the top of the calc stack.

Debugging the function calc-align-stack-window with edebug, the symptom
goes away when placing a breakpoint at the line
(calc-cursor-stack-index 0) just after the set-window-start call, and
then continuing from there.

The following patch fixes the problem for me, but I do not fully
understand the NOFORCE option of the set-window-start function.

Thanks, Christoph

1 file changed, 1 insertion(+), 1 deletion(-)
lisp/calc/calc.el | 2 +-

modified=C2=A0=C2=A0 lisp/calc/calc.el
@@ -1816,7 +1816,7 @@ calc-align-stack-window
=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (progn =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 (calc-cursor-stack-i= ndex 0)
=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 (vertical-motion (- = 2 (window-height win)))
-=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 (set-window-start win (po= int)))))
+=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 (set-window-start win (po= int) 'noforce))))
=C2=A0=C2=A0=C2=A0=C2=A0 (calc-cursor-stack-index 0)
=C2=A0=C2=A0=C2=A0=C2=A0 (if (looking-at " *\\.$")
=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 (goto-char (1- (matc= h-end 0)))))



In GNU Emacs 28.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30, cairo version 1.15.10)
of 2022-04-05 built on M92p
Repository revision: 5a223c7f2ef4c31abbd46367b6ea83cd19d30aa7
Repository branch: HEAD
Windowing system distributor 'The X.Org Foundation', version 11.0.11906000
System Description: Ubuntu 18.04.6 LTS

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
LCMS2 LIBOTF LIBSELINUX LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER
PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM
GTK3 ZLIB

Important settings:
value of $LC_MONETARY: de_DE.UTF-8
value of $LC_NUMERIC: de_DE.UTF-8
value of $LC_TIME: de_DE.UTF-8
value of $LANG: en_US.UTF-8
value of $XMODIFIERS: @im=3Dibus
locale-coding-system: utf-8-unix


--------------DoEdFgjKBxYtTz2RW4dX4z0a-- From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 09 03:35:01 2022 Received: (at 54800) by debbugs.gnu.org; 9 Apr 2022 07:35:01 +0000 Received: from localhost ([127.0.0.1]:36630 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nd5cb-0004yT-41 for submit@debbugs.gnu.org; Sat, 09 Apr 2022 03:35:01 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49586) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nd5cZ-0004xK-6a for 54800@debbugs.gnu.org; Sat, 09 Apr 2022 03:34:59 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:40854) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nd5cT-0007Cm-Ho; Sat, 09 Apr 2022 03:34:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=BVwnWGG5DK2t7mOMfjmtKo4GWhdgoPxNkXEpo2SYUiQ=; b=aR3ePekHJEWP 5PSvfviKSxyM6HR6N+doCg0ZwpLjOfNpoq0CNt3W1m5SK4z4Q3EM8h71BBNyVZG8EtWGYAdwXyOCx JL/fq4VAuNbvDXAhSJ15chAn8joGfVWwlj+NtUGgyt9puFtxWXSrUoom8byqN472XDcm1iSp+jy9U CXbYacnCZ0Jjf4reXbx3OtQX5rbysdMBSbEBYy/pyTC+40eS/jiAFZWIk4DJ5HI0CQbYlASWG2PCJ HySYTfo06SDoZV/tFcBehg3lY0IilnsvPp/F+CKfSvz7a5PB2WKLWJGt7tftUVMkBhpBvwyUpX7xh D7Imj8EPHDaqHEwoG5Yxcw==; Received: from [87.69.77.57] (port=3101 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 1nd5cR-0005Hb-0Z; Sat, 09 Apr 2022 03:34:53 -0400 Date: Sat, 09 Apr 2022 10:34:44 +0300 Message-Id: <831qy6aewb.fsf@gnu.org> From: Eli Zaretskii To: Christoph Arenz In-Reply-To: <4a0319d6-b533-b3d8-bf52-bb18d74757e1@web.de> (message from Christoph Arenz on Fri, 8 Apr 2022 21:44:38 +0200) Subject: Re: bug#54800: 28.1; calc: Cursor positioned at weird position in calc stack References: <4a0319d6-b533-b3d8-bf52-bb18d74757e1@web.de> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54800 Cc: 54800@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Fri, 8 Apr 2022 21:44:38 +0200 > From: Christoph Arenz > > When the content of the calc stack inclusive top-of-stack symbol `.' > gets larger in height than the calc window, the cursor is positioned at > a weird position in the upper half of the stack window. When > line-numbering is on, the cursor is positioned at the beginning of the > line at the line number. Calling `calc-realign' does not change the > cursor postion. > > How to reproduce: > 1. emacs -Q > 2. C-x * * (to start calc) > 3. enter a number and RET > 4. repeat No. 3 until the stacks grows and the symptom appears > > Expected behavior for the cursor is to be placed on the `.' symbol, > representing the top of the stack. > > 5. After pressing `o' [calc-realign], the expected behavior would also > be for the cursor to be positioned at the top of the calc stack. > > Debugging the function calc-align-stack-window with edebug, the symptom > goes away when placing a breakpoint at the line > (calc-cursor-stack-index 0) just after the set-window-start call, and > then continuing from there. > > The following patch fixes the problem for me, but I do not fully > understand the NOFORCE option of the set-window-start function. Thanks, but I think using NOFORCE is not the best solution here, because that causes Emacs to recenter the stack window, thus showing fewer stack entries than possible. I think the bug is actually off-by-one error, because the vertical-motion call doesn't take the header-line into account. So I suggest the following patch instead, please see if it solves the problem: diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index 81677d7..900940d 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -1815,8 +1815,8 @@ calc-align-stack-window (if win (progn (calc-cursor-stack-index 0) - (vertical-motion (- 2 (window-height win))) - (set-window-start win (point))))) + (vertical-motion (- 3 (window-height win))) + (set-window-start win (point) 'noforce)))) (calc-cursor-stack-index 0) (if (looking-at " *\\.$") (goto-char (1- (match-end 0))))) From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 09 06:19:57 2022 Received: (at control) by debbugs.gnu.org; 9 Apr 2022 10:19:57 +0000 Received: from localhost ([127.0.0.1]:36783 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nd8CD-0005yj-A4 for submit@debbugs.gnu.org; Sat, 09 Apr 2022 06:19:57 -0400 Received: from quimby.gnus.org ([95.216.78.240]:40930) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nd8CB-0005yT-Ft for control@debbugs.gnu.org; Sat, 09 Apr 2022 06:19:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=FAwdOchxHfSoTlVJ04rdjpdZQ5RehXSbzYGPMIC20Ps=; b=Bkf8tAi/bQ6zCxT36Q2KnQsqkp J7yyOtBE0ECc4ycpyiLx5Gkp98p6qH5S/WPK4gyNO5ukihNZ1U3h0QGcGt3Ju1WmcF7+mh+AIc2cK uOsCet+oQfn/by/ZEs+6xOAA9spAG+U2nykTUDRiIRyQT2b7mnUhjfCnfNeqD/iJSOOQ=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nd8C3-0000dE-O5 for control@debbugs.gnu.org; Sat, 09 Apr 2022 12:19:49 +0200 Date: Sat, 09 Apr 2022 12:19:46 +0200 Message-Id: <87o81a4kzh.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #54800 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 54800 + moreinfo quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) tags 54800 + moreinfo quit From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 09 08:31:17 2022 Received: (at 54800) by debbugs.gnu.org; 9 Apr 2022 12:31:17 +0000 Received: from localhost ([127.0.0.1]:36938 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ndAFI-0007V1-Vp for submit@debbugs.gnu.org; Sat, 09 Apr 2022 08:31:17 -0400 Received: from mout.web.de ([212.227.17.11]:36277) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ndAFG-0007Um-5c for 54800@debbugs.gnu.org; Sat, 09 Apr 2022 08:31:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1649507467; bh=kz6FQd9RUkNyRhLmDzDGyG7IeUDJp1EFfa5YJpjnqMo=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=mlUoPpJA83HQIaKRsoQGM6AY6wy9cypfx6eKArU8ITGLGwQK6s/OVxk+EFdFxnVJ9 LbTTPIebU5A5XH3M171WpEmIvUcSm7HFDJne/8zuIFFS1/ObZC+FvJEYlDY/BrQ+mN PXSxuXzFFhOJvYgoX+Tl9lIa2SHxFs94h8dJeYyA= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from [192.168.188.20] ([5.83.184.164]) by smtp.web.de (mrweb106 [213.165.67.124]) with ESMTPSA (Nemesis) id 1My6lR-1ntyoG1lLL-00zKQr; Sat, 09 Apr 2022 14:31:07 +0200 Message-ID: <3e3b4386-9720-60bb-1e54-fa7326191b7a@web.de> Date: Sat, 9 Apr 2022 14:31:06 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: bug#54800: 28.1; calc: Cursor positioned at weird position in calc stack Content-Language: en-US To: Eli Zaretskii References: <4a0319d6-b533-b3d8-bf52-bb18d74757e1@web.de> <831qy6aewb.fsf@gnu.org> From: Christoph Arenz In-Reply-To: <831qy6aewb.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:zoIatV9I7tHrtjqfNJMsUbLzMQL8fwygfoFOc+BF7y4yZKL7Qi/ TA3HLXgSOWmY9X/XmbGDRhBBRg5zOS1PjvvXlMU1vdfB5ItNbfqW067bHCT0nYWSXnrzMSW G2hvadAklkiUSn/kAPTLfcF2h3oft2vJcvcya8eKZkSP3yrYFV6ETIZOr6VjZ4N2SF+ssnH yb884DCODP4p8hO9eRgOA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:SLIW6eZAQCg=:Vtq/DGVPYNmQRr2QUkqm2/ UwKHMSoaxxkxtSMlFph+AI8W374tJg9jreveq9Z9Y7W5WRkOUkR2EHXhcmgfSFp1gHoS4p9eH x8VBrfkuEeEzoHdMrHid/i5FfFZLxFVvPiN2sCKldUMho1Zfd5l3fNPhw3z/OIjLbywW1SnI4 7lHpW/3Jd2HM4+4ncGgPZSAmYKoXaUfuNcOvvGkQANKkbvkIUYwwMRu/rUL5yZLtAjSwixMHs 1E4EEFfsauYDjsLnTZNWICkos6ilewdvvsJUuoHTgcWPyDV5BfHeIbrvG/7QO5axfsIFRITkK Bz9iMz98v2Q319/cTMJB4vtzIagDPWWP2wmFm4h9L5XxNHxkL/xKyvaFGdilmN6cN3kRDdCcc 7eUY4vw8shgi+XtJZvSUR15RUzNKPpUbnfmSF7u5MXYs/Pj4zIN3ymGEn55S+wgW0KHwY+I5V 05IOlLqSD/bNipsIS5bLOw/czIhYAtO3i9JAWJymRISsuDpMCLGZHhG6ROK0TlPfyLJJaJ+qT FK2h5aiOgaGIOsakfiJN1ixzr2GsxM8py4nVzhjW0X8xoavOknVYM6iML9rHSA0R4Z9ISKbYL UeSaKq3esB1u5e8Cm0qtGL7cUxpkjjqEb4NvBB+6v7riQ0czZwDXK4KGNYHJAnXMFtt5Hnc87 PjcXTBakkzKitp4uTr6XKJb8mvTzNL01v3+17rAHfgybG3YKmzQzWhOY5qdmEGoPIMEFRLfNr cdlXbC3zk/ogUPm77MN702i1CcLvtkH3HE8rPvQH+TOeS/hX6iZwifEM6Q2Qa1UO5dez0bpln n3yzWrVxo9YafMJBdHkC6MHh1d9efXfUtFT/908eaBANqJ4JQi1rvF6UXWPmJxymaZRiu0sp4 PpYLdcckERQQ63APWV+kBLNw/0wRc8fouBNWHdRVEgb+GX13gR+Jsn2T2eQkkdkd6CL7uCEFS icGjukbwGlj3RtSc+fRhc7wSf3o6cyFuW4ZZbMAfNewTCiikjVHX75Qf7zRNRA3PnPggKFXMN Iq5Iqbs1KRorwhDRnOZueua4HFhXEJRhO3oB+7CX6c66IhyLqzpecL9FZuafBF0fnSQjJ03bK CGp7tAWGNtWraA= X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 54800 Cc: 54800@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 09.04.22 09:34, Eli Zaretskii wrote: >> Date: Fri, 8 Apr 2022 21:44:38 +0200 >> From: Christoph Arenz >> >> When the content of the calc stack inclusive top-of-stack symbol `.' >> gets larger in height than the calc window, the cursor is positioned at >> a weird position in the upper half of the stack window. When >> line-numbering is on, the cursor is positioned at the beginning of the >> line at the line number. Calling `calc-realign' does not change the >> cursor postion. >> >> How to reproduce: >> 1. emacs -Q >> 2. C-x * * (to start calc) >> 3. enter a number and RET >> 4. repeat No. 3 until the stacks grows and the symptom appears >> >> Expected behavior for the cursor is to be placed on the `.' symbol, >> representing the top of the stack. >> >> 5. After pressing `o' [calc-realign], the expected behavior would also >> be for the cursor to be positioned at the top of the calc stack. >> >> Debugging the function calc-align-stack-window with edebug, the symptom >> goes away when placing a breakpoint at the line >> (calc-cursor-stack-index 0) just after the set-window-start call, and >> then continuing from there. >> >> The following patch fixes the problem for me, but I do not fully >> understand the NOFORCE option of the set-window-start function. > Thanks, but I think using NOFORCE is not the best solution here, > because that causes Emacs to recenter the stack window, thus showing > fewer stack entries than possible. > > I think the bug is actually off-by-one error, because the > vertical-motion call doesn't take the header-line into account. So I > suggest the following patch instead, please see if it solves the > problem: Your patch solves the problem and shows maximum content of the stack in the window. Note that it still contains the NOFORCE while the off-by-one fix also works without it. > diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el > index 81677d7..900940d 100644 > --- a/lisp/calc/calc.el > +++ b/lisp/calc/calc.el > @@ -1815,8 +1815,8 @@ calc-align-stack-window > (if win > (progn > (calc-cursor-stack-index 0) > - (vertical-motion (- 2 (window-height win))) > - (set-window-start win (point))))) > + (vertical-motion (- 3 (window-height win))) > + (set-window-start win (point) 'noforce)))) > (calc-cursor-stack-index 0) > (if (looking-at " *\\.$") > (goto-char (1- (match-end 0))))) From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 09 09:32:09 2022 Received: (at 54800-done) by debbugs.gnu.org; 9 Apr 2022 13:32:09 +0000 Received: from localhost ([127.0.0.1]:36996 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ndBCC-0000Z4-R7 for submit@debbugs.gnu.org; Sat, 09 Apr 2022 09:32:09 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38152) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ndBCA-0000Yk-FS for 54800-done@debbugs.gnu.org; Sat, 09 Apr 2022 09:32:07 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:50028) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ndBC5-0002Al-0p; Sat, 09 Apr 2022 09:32:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=E5e3BqDSulcKpfAMLKf65cfsu1lt2W0xEFbZFk4BccQ=; b=QA+VeoonXWvb AUeIDNuvTZ++ISf30gNdgvUJIaI4YbxC/NezXcIxgh4voT66GmAOiH7e1EbY3DZfW4VvxHBwOnY3t yhAiAKqbbfb9F0tHCxsSZwTRDH2zx+3haeNqmyOXaEX/P8f/AupJ0PwOSL/wHjIeDapZcMxTHcjVf UiJ/YH60UXl26+FpUwFTbMEVo8FM1v77EuT5caSgY4dZE7TSSQ68Vhhh+q5ghyLWk5Gq9H7ZPeJfj O+2ZvgW+eaEfkLWHrHuIIHb/JWQ+hTlQSEBC5YsnTtg6Jna3qs4k1sZXRxc6bjmGfuHzv0NE1fkG0 DX9ix9VcRMMrVlqTDCYVMQ==; Received: from [87.69.77.57] (port=1923 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 1ndBC4-0004mN-LJ; Sat, 09 Apr 2022 09:32:00 -0400 Date: Sat, 09 Apr 2022 16:32:15 +0300 Message-Id: <83k0by8js0.fsf@gnu.org> From: Eli Zaretskii To: Christoph Arenz In-Reply-To: <3e3b4386-9720-60bb-1e54-fa7326191b7a@web.de> (message from Christoph Arenz on Sat, 9 Apr 2022 14:31:06 +0200) Subject: Re: bug#54800: 28.1; calc: Cursor positioned at weird position in calc stack References: <4a0319d6-b533-b3d8-bf52-bb18d74757e1@web.de> <831qy6aewb.fsf@gnu.org> <3e3b4386-9720-60bb-1e54-fa7326191b7a@web.de> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54800-done Cc: 54800-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sat, 9 Apr 2022 14:31:06 +0200 > Cc: 54800@debbugs.gnu.org > From: Christoph Arenz > > > I think the bug is actually off-by-one error, because the > > vertical-motion call doesn't take the header-line into account. So I > > suggest the following patch instead, please see if it solves the > > problem: > > Your patch solves the problem and shows maximum content of the stack > in the window. Thanks, I installed the fix on the emacs-28 branch. > Note that it still contains the NOFORCE while the off-by-one fix also > works without it. Right, I removed it before committing. Thanks for pointing that out. And with that, I'm closing this bug report. From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 11 06:25:34 2022 Received: (at 54800) by debbugs.gnu.org; 11 Apr 2022 10:25:34 +0000 Received: from localhost ([127.0.0.1]:42614 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ndrEk-0001NW-77 for submit@debbugs.gnu.org; Mon, 11 Apr 2022 06:25:34 -0400 Received: from mout.web.de ([212.227.17.12]:34083) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ndrEh-0001NI-M6 for 54800@debbugs.gnu.org; Mon, 11 Apr 2022 06:25:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1649672725; bh=e00s/VVmQB9PmmMItyrG/dch1+rqoZJu0Mf89BlWrSA=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=Jx3T0AQpglvPjWD7M9c9t8Yanvagou5Su06WmrZih4IEbWDQlhfX4RUlxdumLGq31 igc14gPNO7SZxqBBBij8skob0orkTPbs3l4DxR1Hikfpv3GcBcN09HtoW9Q5bgzEOG lLtnON6B2ODxRyNIbnqYLpjphWjnrPawfFR0HEvs= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from [192.168.188.20] ([5.83.186.215]) by smtp.web.de (mrweb105 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MyNwk-1nsOTZ1Rxk-00yiic; Mon, 11 Apr 2022 12:25:25 +0200 Message-ID: <4792caf2-0ef7-d768-6b0a-c87f38cde558@web.de> Date: Mon, 11 Apr 2022 12:25:24 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: bug#54800: 28.1; calc: Cursor positioned at weird position in calc stack Content-Language: en-US To: Eli Zaretskii References: <4a0319d6-b533-b3d8-bf52-bb18d74757e1@web.de> <831qy6aewb.fsf@gnu.org> <3e3b4386-9720-60bb-1e54-fa7326191b7a@web.de> <83k0by8js0.fsf@gnu.org> From: Christoph Arenz In-Reply-To: <83k0by8js0.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:xDySZ9dNFPu/mDeb3Ln0dkhSMQPecNv4f+sFqiuzW8pyKIhlG2y 2DYWn8fWJhBM47hWfYxnq2j981vVW91voCzGJesqORiCth4I6oFD97zYbhqv34MBV/0NW9r xvTmKiJpTMSHFP1uWcZw9lWhuj8lwKx/wBS1mGLJr2XwbO7VPxoeZaWob6HNONxkO6bTAvc 615KDfMpcFdGDrr474Ktw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:pEng3eu6aTs=:0cGPRwOaazcVbjcFcZfCjM IWy8XFeBB0MDWlCtSNiIK06Qvii4gfRkZF8Q3ec9G1ZZxeBC4yiOtsAmfbEvG2DWTr6ZsOSNi XHPTkMKk4Ft+gwuxTElmPGEM7IDF97Ra4Fd/Ojpg2HI2sQiMc2vtr7gRiRzTaDt17TmaQ4xbO DkJ6LSHrUorXY4a4HQAfPtmD+H/Vo6NKxdB15eyvHpOuG+Q/nu4SBsEbDZGDDZy9NsbpH/Km+ P0IeK6oy3w45/gu4mMYmAZTa40JUyY2Dvc+69X6fFjaKKjVX7S3ka83k4n2zT2aHU9DOMVOhJ trYj8PQ60Lh+F3GeapfY8SrBk5/DWFin+lBJLakPStMKPUbSeq7YW5jCbDeS48wsT5jUd7kuu G6yEVWp+jXt1VL8frSy0RAi6zPiheP398SMofU8CAhOHhNR9td9EDth7RzIn2H/231DFS4aoJ Wg5KlDJyjx4LVUzK8Kanf3B2/YOAL8n1MmBqzhYsS0H0LXQLIDkG4WFInrDEPvACGcMXyrSC/ Dn2CFcgKWEbwBd37veKIbZneRWfKuLzGC83JY3fZT5L6LaYjBZnkibhZGu7q6Aj6eOeegAAwO +Q0dY5VcSnSxENG9HCF/DHQVw6Wnwyb35EOmtXFKfxHBOQ2NGkqxVvrIJ2+uBRp7M4Q/J+9Y0 15YsSZjpd38p35i8TjoxFq4hpiqquldsFLjnHWkrZdVdODGmiuYqUUVqtSyc35jybUl90xeAd J+nntsPuF/M5SYKB0pgxrgft5mfslsgOcidupFGoEjiLUPfeymG0KHF0BgfbqyHS1uHnBwCjO IL22rnN2HCwCH9V7yDNbAUoB3nAwGs88gNE3WO82Ey8uvJiPVA18Edw6WDq5nMzDd4hIDIhJN X7kyFcw+9EcjaYvohHJKFK+lbVcQsSlL0yKmRkgkJM51yvNPCQVGDVetcC0Gwy+iWBVwEQFmo JmcIkF6ua+F0Q/xBQGfE/QX+6ZNAe5rOChCLAW993aA7UDRSuZDD68mNGxsUgfR4fWAkkEvRA Okica59QBzmo/ydAWqBXh5+aySpaZ5LmJSppWqJpm2UvpdAlPhYcMtuM9i6guVVFh6uIKlnc5 MVnZdxp4tt8KgA= X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 54800 Cc: 54800@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 09.04.22 15:32, Eli Zaretskii wrote: >> Date: Sat, 9 Apr 2022 14:31:06 +0200 >> Cc: 54800@debbugs.gnu.org >> From: Christoph Arenz >> >>> I think the bug is actually off-by-one error, because the >>> vertical-motion call doesn't take the header-line into account. So I >>> suggest the following patch instead, please see if it solves the >>> problem: >> Your patch solves the problem and shows maximum content of the stack >> in the window. > Thanks, I installed the fix on the emacs-28 branch. > I noticed that while the patch fixes the problem in most cases, depending on the height of the calc stack window, there can be the case that the cursor is not positioned on the top-of-stack symbol `.' but one line above, at the beginning of the line with the first stack entry. This can be changed by using the number 4 instead of 3 in the patch. Not sure if this is the best fix. (vertical-motion (- 4 (window-height win))) From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 11 07:27:42 2022 Received: (at 54800) by debbugs.gnu.org; 11 Apr 2022 11:27:42 +0000 Received: from localhost ([127.0.0.1]:42796 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ndsCr-0007Qr-Ot for submit@debbugs.gnu.org; Mon, 11 Apr 2022 07:27:42 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47798) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ndsCq-0007Qc-OZ for 54800@debbugs.gnu.org; Mon, 11 Apr 2022 07:27:41 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:35396) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ndsCl-0001gh-DW; Mon, 11 Apr 2022 07:27:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=N7Fx5GVRTUSC/3HUw8bw5uHtbk7Ml8qlsZknqZe0/Vg=; b=A3LP86OWQLsQ bQkf5FAl3w/ayV+5q5S3EDf7tgwtJEPsdS/BJHGwVyes+VYYG25oYp2QTTN7JEAVzBfCyCImSKW5S gpqShUMajlSPo+E6uek48fQItOt6JnhkMLJ0/EXpEvwcoQwFPN1SvPArZl9YnDC528d1ZKY+KrSJ5 u35dPitELWI0oFPHBFP8gDexs8r3MubPJ7rici7+KhlTkEfVC5Iw/470MV0y3Xuwx8kRr7m2WY7xF DeKzBeC+CxyfP2Tea5n5Wj0pUtN82eZuc7ZH13hAseGSaealibpC/SVKXrkzF0wlbwb7htm/vgur6 hRqlw+xM2/9eOWDrnMtxyg==; Received: from [87.69.77.57] (port=4416 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 1ndsCi-0003Y9-NW; Mon, 11 Apr 2022 07:27:35 -0400 Date: Mon, 11 Apr 2022 14:27:35 +0300 Message-Id: <83y20b6es8.fsf@gnu.org> From: Eli Zaretskii To: Christoph Arenz In-Reply-To: <4792caf2-0ef7-d768-6b0a-c87f38cde558@web.de> (message from Christoph Arenz on Mon, 11 Apr 2022 12:25:24 +0200) Subject: Re: bug#54800: 28.1; calc: Cursor positioned at weird position in calc stack References: <4a0319d6-b533-b3d8-bf52-bb18d74757e1@web.de> <831qy6aewb.fsf@gnu.org> <3e3b4386-9720-60bb-1e54-fa7326191b7a@web.de> <83k0by8js0.fsf@gnu.org> <4792caf2-0ef7-d768-6b0a-c87f38cde558@web.de> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54800 Cc: 54800@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Mon, 11 Apr 2022 12:25:24 +0200 > Cc: 54800@debbugs.gnu.org > From: Christoph Arenz > > On 09.04.22 15:32, Eli Zaretskii wrote: > >> Date: Sat, 9 Apr 2022 14:31:06 +0200 > >> Cc: 54800@debbugs.gnu.org > >> From: Christoph Arenz > >> > >>> I think the bug is actually off-by-one error, because the > >>> vertical-motion call doesn't take the header-line into account. So I > >>> suggest the following patch instead, please see if it solves the > >>> problem: > >> Your patch solves the problem and shows maximum content of the stack > >> in the window. > > Thanks, I installed the fix on the emacs-28 branch. > > > I noticed that while the patch fixes the problem in most cases, > depending on the height of the calc stack window, there can be the case > that the cursor is not positioned on the top-of-stack symbol `.' but one > line > above, at the beginning of the line with the first stack entry. > > This can be changed by using the number 4 instead of 3 in the patch. > Not sure if this is the best fix. > > (vertical-motion (- 4 (window-height win))) Can you show a reproducible recipe starting from "emacs -Q", so I could investigate? Thanks. From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 11 07:46:00 2022 Received: (at 54800) by debbugs.gnu.org; 11 Apr 2022 11:46:00 +0000 Received: from localhost ([127.0.0.1]:42868 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ndsUa-0001gF-Lt for submit@debbugs.gnu.org; Mon, 11 Apr 2022 07:46:00 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51466) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ndsUZ-0001g0-Bm for 54800@debbugs.gnu.org; Mon, 11 Apr 2022 07:45:59 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:35582) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ndsUT-0004i6-UQ; Mon, 11 Apr 2022 07:45:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=KUVccT6MwOCvfbtNZVfWlQM+kY6JZZItZ20o87pSxJ0=; b=V2XyKF8aAE9D VV07/PLBayX25rh7gJFyJB6CWa/3Ah0JNz1j1UaXoDSh1UKIkrj+28JW65BRYH3OdDPfuHUuhDoNF +S1sqZsSO98MHOk3wZ+XGa7ln0/SnGoSSvhduHLCcQtLiGHiPPj3qGu+aR8dP1/l7PhQHCHteJeeY VMJIEiwtI5b/nOF926o7YK5ghLUi9SCDf3xb+4T883x7qi/2u1kVssG10nhEBzJWCz226Qb4aOKmS Ao8GFu5LOmLtVRsBB+Vr0OO4JJgFEkxNfwy/u6QmhTZ2S0HoiBdJlFFH47KaJpwT2ETKUelGo6ZBm yoAPUKa9z0dwzFdpiqmu0A==; Received: from [87.69.77.57] (port=1587 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 1ndsUT-0000iW-De; Mon, 11 Apr 2022 07:45:53 -0400 Date: Mon, 11 Apr 2022 14:45:56 +0300 Message-Id: <83sfqj6dxn.fsf@gnu.org> From: Eli Zaretskii To: tiga.arenz@web.de In-Reply-To: <83y20b6es8.fsf@gnu.org> (message from Eli Zaretskii on Mon, 11 Apr 2022 14:27:35 +0300) Subject: Re: bug#54800: 28.1; calc: Cursor positioned at weird position in calc stack References: <4a0319d6-b533-b3d8-bf52-bb18d74757e1@web.de> <831qy6aewb.fsf@gnu.org> <3e3b4386-9720-60bb-1e54-fa7326191b7a@web.de> <83k0by8js0.fsf@gnu.org> <4792caf2-0ef7-d768-6b0a-c87f38cde558@web.de> <83y20b6es8.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54800 Cc: 54800@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Mon, 11 Apr 2022 14:27:35 +0300 > From: Eli Zaretskii > Cc: 54800@debbugs.gnu.org > > > I noticed that while the patch fixes the problem in most cases, > > depending on the height of the calc stack window, there can be the case > > that the cursor is not positioned on the top-of-stack symbol `.' but one > > line > > above, at the beginning of the line with the first stack entry. > > > > This can be changed by using the number 4 instead of 3 in the patch. > > Not sure if this is the best fix. > > > > (vertical-motion (- 4 (window-height win))) > > Can you show a reproducible recipe starting from "emacs -Q", so I > could investigate? And while at that, would the below fix the problem in the rare cases where you saw them? (vertical-motion (- 3 (window-height win 'ceiling))) That is, ask window-height to produce the smallest integer number greater than the window's height (in case the height in line units is not integer)? From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 11 10:54:01 2022 Received: (at 54800) by debbugs.gnu.org; 11 Apr 2022 14:54:01 +0000 Received: from localhost ([127.0.0.1]:44938 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ndvQX-00014I-8V for submit@debbugs.gnu.org; Mon, 11 Apr 2022 10:54:01 -0400 Received: from mout.web.de ([212.227.17.11]:37539) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ndvQU-000144-Ft for 54800@debbugs.gnu.org; Mon, 11 Apr 2022 10:53:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1649688832; bh=h++Bjdkt1R9bnfkhxZ4qTraDFNk952S2yoSt2SkFlwg=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=pM204PrSIdEHmWZQYMtcJvn795T4lbtmCyT9zb2sZUmEiDa2Xluk2q2kyi/XfQ+Jx oWFDRRjUR27wiZuZzqhHzd6mpQ/YOY0xV3AWZbculU9jDPK/KmMZ6+wag85q2NDzH8 DvIyRe+EKiqoScnxirF8s16EtAl8WlS//9QZbdTk= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from [192.168.188.20] ([5.83.186.215]) by smtp.web.de (mrweb105 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MXoYQ-1nRoyR3qiS-00YDZN; Mon, 11 Apr 2022 16:53:52 +0200 Message-ID: <3bd62f12-0d8b-314a-b812-4467e1f6ba43@web.de> Date: Mon, 11 Apr 2022 16:53:50 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: bug#54800: 28.1; calc: Cursor positioned at weird position in calc stack Content-Language: en-US To: Eli Zaretskii References: <4a0319d6-b533-b3d8-bf52-bb18d74757e1@web.de> <831qy6aewb.fsf@gnu.org> <3e3b4386-9720-60bb-1e54-fa7326191b7a@web.de> <83k0by8js0.fsf@gnu.org> <4792caf2-0ef7-d768-6b0a-c87f38cde558@web.de> <83y20b6es8.fsf@gnu.org> <83sfqj6dxn.fsf@gnu.org> From: Christoph Arenz In-Reply-To: <83sfqj6dxn.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:+QGj7VlFL2XQh0oRLGvvK8mSOiNW2SFnNF+lPmjZEGdp1M9NaZm gN9QnmW9uglxRZHKy1BGYYlfjht0tnDoHFyw0BW/Xp3UsjZqWuig+ZZjFguAPVvrUesn7fK 1FHDQy0iR8epNpC+afXHFbfcJ8Vu8VnEz3GqhY/PwxFXws2dMrOwElzgWyPxwCgYl8nE5xy Wtw72qOp6EdKixl0ZCtfA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:C8o06pSbMfY=:b3Cmo1hKYcwDaUM1mEYWMj c5jJ2AG0GyPcd4LM+Iixgh7Df4qXRl6I6fBTObgQ/6P59d3nH876Q6eeU2O1v/cqRh3h2W/Ul WWjx50ISZwUXNpwNjhWTfzoum9mCbPc3wT/HatU8OF6ekmcpKzuUt7JeRbGJtn+08nhOtVAa0 8+i7Fzas+5kJg9HMrcDk/eghCrmgxsRQFPQkxdsuv87TyB8anabL6R8K3hQzbBPO1XpfSuPmS hAQKRtxL3hjV5vy9O07dM5QCyP44yxiSlqI6DJQWaE3wubDaX3zX53mEetKQiWNevwQeJcerE JssapfDWQ3MtRl3JyfC+/sSR4kp780Egl8I1VXuFarGoGOJRBxYtk3TuVf3fdrhFAgyidWf/a +oEKWByDvZVI3Y1wI0b9s2A3HLcc/t+Zd8j2NdGAElIEahwoKvMlrHz1JtZ+c3IBGKpavyahU hZNIfxRS8Ys5Z5pV9A54XiRREeIJ1I0maDkt9nw5r0eTZ6jgY2UVr5sAfr4QlwQ+fF/P9cyC1 7vHQNr2hN5dB+BggWKMW3xyolhg3pNgTLeCKnQogOeJ4pUClTdYN3rD5Rqd0BzfotE38SfIOB 0lTcE+IOsoaFWeXQITgUbRNa33/LxiLrDI8elYPnDf42FqiDa38gLgBWTf7bFxC/LURyTMKaF 6ewGuy3bEo7ry1C8UmGgJV121KIIrud41bkM3fJ3nsmIXjUTaLoDf6Ui9DGAZuweaUUV3AVSb M6p2gA2W1CCOXitjKt5E9qvKmx2jgaTzgX/NW2igD28gHNuwvrlrLQrin2gn0nvtpPJlqU6kj fTWDTdCyuODueFKHFG4Jf3rg9eir69fIOUlgEJDe41Z2ydWLGK2aQLwl2uwVkUVgj5Qkn5Iml g40pnRQAw4z1ahQ0x8oAzP/bXmgjQ0vlL5ZcAJFF/tBwGb0qZfcJATNitsgdLp5RLjwRka5vf 0Qtg6gRyGpBs00FQReerwQ0nZJtspa5MCJyAeUNQxwDefKgvK5Vl+VJnU4ygJ+YSrA7aicSIr XLx8ZmBBe3V+Ep1khN1wSh85752o8W8tcgOD3R9/v7hpkje/XHOOQzuwLb5N6eiLhL/t7AjVm 8mUWKPNGlcImoQ= X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 54800 Cc: 54800@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 11.04.22 13:45, Eli Zaretskii wrote: >>> I noticed that while the patch fixes the problem in most cases, >>> depending on the height of the calc stack window, there can be the case >>> that the cursor is not positioned on the top-of-stack symbol `.' but one >>> line >>> above, at the beginning of the line with the first stack entry. >>> >>> This can be changed by using the number 4 instead of 3 in the patch. >>> Not sure if this is the best fix. >>> >>> (vertical-motion (- 4 (window-height win))) >> Can you show a reproducible recipe starting from "emacs -Q", so I >> could investigate? > And while at that, would the below fix the problem in the rare cases > where you saw them? > > (vertical-motion (- 3 (window-height win 'ceiling))) > > That is, ask window-height to produce the smallest integer number > greater than the window's height (in case the height in line units is > not integer)? Seems 'ceiling does not fix it, but 'floor does, like so: (vertical-motion (- 3 (window-height win 'floor))) How to reproduce -- I could not find a way to do so automatically, here is for a manual way: 1. emacs -Q 2. C-x * * 3. enter some numbers to fill calc stack window, and some more 4. o (calc-realign) 5. watch where the cursor is placed: on the top-of-stack symbol, or on the beginning of the line with the first stack entry. 6. increase the stack window height by minimally moving the mode line above the stack window with the mouse; only increase height by sub-line-height amount 7. repeat 4. to 6. until you can observe the symptom From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 12 11:45:52 2022 Received: (at 54800) by debbugs.gnu.org; 12 Apr 2022 15:45:52 +0000 Received: from localhost ([127.0.0.1]:49453 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1neIiF-0005KA-KP for submit@debbugs.gnu.org; Tue, 12 Apr 2022 11:45:51 -0400 Received: from mout.web.de ([212.227.15.3]:56637) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1neIiD-0005Jx-KN for 54800@debbugs.gnu.org; Tue, 12 Apr 2022 11:45:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1649778343; bh=ppTyMUioQf56KawvgsHPjmU9ze2i1MFTspJj4/fW5eA=; h=X-UI-Sender-Class:Date:Subject:From:To:Cc:References:In-Reply-To; b=jV8OyouFfg2YujUEOPblz7kU2Jv/drz9rQXz1SHCE8Do96t6gTC5hUuUcPt8e7xce HXjjfGd0TrOxosXo/GZdQST6IDez2Ggy2DUnsjA7UpVAd+1oprcwVZ3VZ6Kx2KfXIS sP5qh8qIbNC1ZuZpwe16m831ei+2OiX7xDzCFso8= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from [192.168.188.20] ([5.83.184.164]) by smtp.web.de (mrweb006 [213.165.67.108]) with ESMTPSA (Nemesis) id 1M4KJR-1ne1jC0Uy1-0009FL; Tue, 12 Apr 2022 17:45:43 +0200 Message-ID: <064785f3-5e77-ae50-aaa5-e590a7eafe4e@web.de> Date: Tue, 12 Apr 2022 17:45:42 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: bug#54800: 28.1; calc: Cursor positioned at weird position in calc stack Content-Language: en-US From: Christoph Arenz To: Eli Zaretskii References: <4a0319d6-b533-b3d8-bf52-bb18d74757e1@web.de> <831qy6aewb.fsf@gnu.org> <3e3b4386-9720-60bb-1e54-fa7326191b7a@web.de> <83k0by8js0.fsf@gnu.org> <4792caf2-0ef7-d768-6b0a-c87f38cde558@web.de> <83y20b6es8.fsf@gnu.org> <83sfqj6dxn.fsf@gnu.org> <3bd62f12-0d8b-314a-b812-4467e1f6ba43@web.de> In-Reply-To: <3bd62f12-0d8b-314a-b812-4467e1f6ba43@web.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:+jDwqhI/pAF2PFIHHEdTVTKtA8KoXFjo7fLUvYD99VmkOd7hb5+ smOgkgxSU5qMdXzsh8kaVu//3+dggfQH3bbOgdYeKkv/cHCK3U0AjUKtlJdFG7MJapymBql yt/WzTY0TRrtGcAlBe0DHZ7OOQTn6QMIa21cmTTHo/gTl7hzED9KebmV03C3BkbagqAzQAa KTXgaJhdfEny7SVVZqnUA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:ATUNwx/dClg=:b9JmVe6phSUMbDzBkueYtR z8zcUu2IXEQvU0OCAUexOypiR0BIbNsUuFtGBR9sPSvKKIrbSepUC+tAbP/h+9gihpqOZCTYX Vn0dkdWiMoTkd+9S4BSg9Y+WymWFLXh1CIDscgIsCIkyvL7IT/IHKXYUfoIldnCgUS5yPGBkV vUPCS0AtmCtgBCnqeZGK5WzSHTADFOlcHT6d5tXqMZqZZAcCKLUPij6RUjukxkVQEulWT2iP6 SkBMxCwjnnGvlvDQlSSb2wCh8mm34oDip+STDIuFGhv5sYB41ltY7YwEhpeVxXHqU4d7s9u30 ieZRrYGl6sDEm8lG5uoQ6fo/T+QgAJbIuNxdicjug+8nn3XQwu80yVPW5LxEWClQZ8PTRaaSq bujs5NRFIzrACYEaK5kT9REGWcTeXHcp/4fovBVn5H5jv9sV/O25nCrmIDlrK7vGpv45VQTUM KwynsaocB+Wsu53AzHERIHmCh+8HliWEJzK+EZeyq+mD/cR8KvQPaw7Qy4UMt1aWtiBGzBivC bx5CimbLnxvplxVkzy3p3R2phbWRrky/MCShO+0p3KXP7WXow3mLr6gi5qDR1SXgK6Pb/J5v4 XWjoS1AP4J7NyqQs0PtguPcpPiHZKmkCBzhHTiPiASaIawVwcJPmOn7DRigBqemJYE1Ascv7X n0jWG5uoix8D7fr7Qm5BsOcIwwffwTtYgDvp0zDtVBh4B5fGThWHpqcRLsh+NHlcghu91c4tS AI8chaEIZ/s6wN5uA40E3Ys5mYZ1rG2xnZsiWIq7TytnbJvNdVUVabcPxJl+wlYgBuG1DilHw Lx/LB1mR6cPdW+K0CD0GGkUM/tBvYHvh9+hbZUsuPlSaTkGWzTePTg5IuEcQuuE6g0QjJ+Otk EtHnHBu93JFab3xFh1FN2PndAIVBRujodmwWi6jX2AYyiG5L/0kOVPiTnB5eLomdlO9KwwTVM 8cZpfKougtNWAO/ZDn/y1v+Ydy9bbj4IRacGFy2iHnMAO5g+hGbyu5cu0/EkcyE41rGRevneV IFbzE05GLvAo1meAoZERCU6gm46xl0rsNRcyYHN7u1Uwo3PsYh6B0xNBS6peiBlmhYnsjAXrZ 2bcLnJGrMFmmNk= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 54800 Cc: 54800@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 11.04.22 16:53, Christoph Arenz wrote: > > On 11.04.22 13:45, Eli Zaretskii wrote: >>>> I noticed that while the patch fixes the problem in most cases, >>>> depending on the height of the calc stack window, there can be the >>>> case >>>> that the cursor is not positioned on the top-of-stack symbol `.' >>>> but one >>>> line >>>> above, at the beginning of the line with the first stack entry. >>>> >>>> This can be changed by using the number 4 instead of 3 in the patch. >>>> Not sure if this is the best fix. >>>> >>>> (vertical-motion (- 4 (window-height win))) >>> Can you show a reproducible recipe starting from "emacs -Q", so I >>> could investigate? >> And while at that, would the below fix the problem in the rare cases >> where you saw them? >> >> =C2=A0=C2=A0 (vertical-motion (- 3 (window-height win 'ceiling))) >> >> That is, ask window-height to produce the smallest integer number >> greater than the window's height (in case the height in line units is >> not integer)? > > Seems 'ceiling does not fix it, but 'floor does, like so: > > =C2=A0 (vertical-motion (- 3 (window-height win 'floor))) And there are still cases where above does not work correctly. E.g. when using a theme which has different line heights for header line and mode line than for text lines, say M-x load-theme leuven . Approaching it differently seems to cover those cases as well: =C2=A0=C2=A0=C2=A0 (vertical-motion (- 1 (window-body-height))) > > How to reproduce -- I could not find a way to do so automatically, > here is for a manual way: > > 1. emacs -Q > 2. C-x * * > 3. enter some numbers to fill calc stack window, and some more 3a. Even finer-grained risizing and watching the effects can be achieved b= y M-: (setq window-resize-pixelwise t) > 4. o (calc-realign) > 5. watch where the cursor is placed: on the top-of-stack symbol, or > on the beginning of the line with the first stack entry. > 6. increase the stack window height by minimally moving the mode line > above the stack window with the mouse; only increase height by > sub-line-height amount > 7. repeat 4. to 6. until you can observe the symptom > > From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 12 16:44:25 2022 Received: (at 54800) by debbugs.gnu.org; 12 Apr 2022 20:44:25 +0000 Received: from localhost ([127.0.0.1]:50201 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1neNNB-0001s8-15 for submit@debbugs.gnu.org; Tue, 12 Apr 2022 16:44:25 -0400 Received: from mout.web.de ([212.227.15.14]:60259) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1neNN9-0001rs-Bu for 54800@debbugs.gnu.org; Tue, 12 Apr 2022 16:44:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1649796257; bh=4zW+PS14DHN6ImvWx0x41ziwlZsfWqrfFdP4l2KaeWY=; h=X-UI-Sender-Class:Date:Subject:From:To:Cc:References:In-Reply-To; b=mBATaSkCjrUFZ0T5+guD4cxuDmfDzGMzOisyzK8GOUKZto6FlnMMri36OVy2wFYsJ 3BHNCUMebpZ7sDd4yVuIhDPxsrvZikjZUFvk/q0Nq3oVCl2zhrZHT0CDyRkIs5njgh 6PUj3v4tB+qVXltEGjYcSyNsE6ikA37cfADZbuIE= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from [192.168.188.20] ([5.83.184.164]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MqIFD-1oI62E1AEl-00nHUV; Tue, 12 Apr 2022 22:44:17 +0200 Message-ID: <44113a6c-9ff6-41e6-cf91-bbb3fea5da78@web.de> Date: Tue, 12 Apr 2022 22:44:16 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: bug#54800: 28.1; calc: Cursor positioned at weird position in calc stack Content-Language: en-US From: Christoph Arenz To: Eli Zaretskii References: <4a0319d6-b533-b3d8-bf52-bb18d74757e1@web.de> <831qy6aewb.fsf@gnu.org> <3e3b4386-9720-60bb-1e54-fa7326191b7a@web.de> <83k0by8js0.fsf@gnu.org> <4792caf2-0ef7-d768-6b0a-c87f38cde558@web.de> <83y20b6es8.fsf@gnu.org> <83sfqj6dxn.fsf@gnu.org> <3bd62f12-0d8b-314a-b812-4467e1f6ba43@web.de> <064785f3-5e77-ae50-aaa5-e590a7eafe4e@web.de> In-Reply-To: <064785f3-5e77-ae50-aaa5-e590a7eafe4e@web.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:tv14PDIhgHmO6aws0E7KRvU6xV7pgQy1yEekoAfx0vvdQEWT6OM iPOpnV4SxkNzPi0xha1jTPOMB+1Fc4jyY2ixa6D9TOUgIYDDepi+bolEgQy2Bei7LAtOIxh +7Y23SKlOGd87fxvXi+RKyW1Hs0kGApuR7BqkxD3SUMhZzu375teJPBlAfilKTVtAOiGN15 ITwpEgY4US2IXG7zxoE2w== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:zepLqt95zv4=:1SWH1b1iCz6WR82Z8kV+DW nbavL67tt5rhfvMqzJjEeHAgpwGO56VuiytTGoz35AYKf5+5fCdj6okQoFqyA3G/+wo+KsWFf Jrjc7k5i0/2JzwXnVFO0kIQ9OIJU8A4AdbODbiBs3XO8K3KT4CQv1+k5evTATzaJRK+8eAz6k GL3b5AreCBtIKFNMk/z8EReT+QRK7wR2BJ1Eb8MUVdr072c08jnDsZaXeaaLBG5oggZcewFWw s0CHDMDgYY8nV4BkYMkwCzWh6j3wgUsFZGD2WUWQKRFdTbUZ3ixdu53/QclI1VW6dcWnl939X 9kxngWs6Zug5+V5Bv44t5h4YWdr3fMwawP4rE3ByfYRBRvQgGB1SjNbSvwwOieD5i7lSWYojd tbq1E+WCEC4lizs3c21Z/vHYEdX9u2PogoOgd6ng84IK72zCaBpckFRtVlFHinTv+g+hZL1oK gtorO/SWAvE4uwc5BdDIECLePVKKUzHz4/azgHPZNOo5A6LOxlgHVJKHTGfQSYPMhQicgGQRQ G8uN49C89JaX17dWUfftFN9iiZeqUeGP1AFsDsyvsOCD1h+98u3wL/oGkrgoc9jlPosp39w88 EdTQ/2MmPCx1tT0LNFHC40cQSkwVlS2ZKSqOKgZqfeFoHN7h2KWx7D8H7Je0fEz8VYcJLA/6M UIFQZ7vU9mfa+6LjYNi72xZC3nMScpTy3+s6V0+A9YDHa/gq7TOaGZVqshuyw4LAS9SGmseHX TS0laLcfdUw0pUDj00Q6TGAJAuoqPeGi6cgMWMyPZ7RVkUuJRQB64MdJSwNLpUWMYi2IKccvq jwZjjK9W3Snk9hRZf8PwYjH/Ci+CdU43V7fBsAmtSVRmAaXuTxFbUyA4DRAoRa/M6PO1OAado Dvznh2GuxyvinJcKkGS58XQ9BDlblHdNUYySjvyipCn48C+i2h2CWlqwLkwNB3MW+LkVbmUuO wiPqtOHQFgNXxroqymBt+qRvAdnxCPVbNVfFkxruYu/oD0MN4PZ6GTHMrggp40HDbm9dChN+f nxXILShwo6DjQsmahm0GySOTRWG0GEx8HRAk8zS9aCp+CtZH73pPSeiG+MgMy3OvydYPE/6rg 3kDOXTZNnqbzmQ= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 54800 Cc: 54800@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > And there are still cases where above does not work correctly. > E.g. when using a theme which has different line heights for header > line and mode line than for text lines, > say M-x load-theme leuven . > > Approaching it differently seems to cover those cases as well: > > =C2=A0=C2=A0=C2=A0 (vertical-motion (- 1 (window-body-height))) N.B. This works for me as long as line-spacing is nil. For non-nil there seems to be a bug in window-body-height. I have opened bug report #54894 for that. From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 13 09:11:13 2022 Received: (at 54800-done) by debbugs.gnu.org; 13 Apr 2022 13:11:13 +0000 Received: from localhost ([127.0.0.1]:52065 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1necm9-0001tQ-C3 for submit@debbugs.gnu.org; Wed, 13 Apr 2022 09:11:13 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54938) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1necm6-0001t9-I3 for 54800-done@debbugs.gnu.org; Wed, 13 Apr 2022 09:11:12 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:33294) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1necm1-0006Et-5Z; Wed, 13 Apr 2022 09:11:05 -0400 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=mGg22FUnnwtt98DVHttOVnF8Su8o43y0s1N9g0NESq0=; b=kCiPQgUpBd2G+2zvyDow QWIicmJHLg+urxbv7iIcqJf//ePFO2h8++jmSliIwhnZ7WaJE1+n5ZIZKU4okIUmDrqnvAiSSm3tY AuRsEniqRNYtJTWIYf4qonvyilUpPN8K57/BN0wDsCIPF+MEndprP4v0J3+Xx7+s78QSYIOHZECpy +F3o1DSkB5QWOd8Q6ejjFWvLilJX7IE/26pvxSah+kYwVkpoZGBkro1Fw/jAyR+VaVVOpm2jaPCL9 O52sf0GbievJdcRnaNmTVFsczQprWSt2qpiJfmtqh+961tVpHHtf+/9EaWJbsgIYyfhHKU9QkzN7J oMuMutmaPpT0BA==; Received: from [87.69.77.57] (port=4716 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 1neclu-0008FF-TR; Wed, 13 Apr 2022 09:11:00 -0400 Date: Wed, 13 Apr 2022 16:11:04 +0300 Message-Id: <83czhl3z87.fsf@gnu.org> From: Eli Zaretskii To: Christoph Arenz In-Reply-To: <44113a6c-9ff6-41e6-cf91-bbb3fea5da78@web.de> (message from Christoph Arenz on Tue, 12 Apr 2022 22:44:16 +0200) Subject: Re: bug#54800: 28.1; calc: Cursor positioned at weird position in calc stack References: <4a0319d6-b533-b3d8-bf52-bb18d74757e1@web.de> <831qy6aewb.fsf@gnu.org> <3e3b4386-9720-60bb-1e54-fa7326191b7a@web.de> <83k0by8js0.fsf@gnu.org> <4792caf2-0ef7-d768-6b0a-c87f38cde558@web.de> <83y20b6es8.fsf@gnu.org> <83sfqj6dxn.fsf@gnu.org> <3bd62f12-0d8b-314a-b812-4467e1f6ba43@web.de> <064785f3-5e77-ae50-aaa5-e590a7eafe4e@web.de> <44113a6c-9ff6-41e6-cf91-bbb3fea5da78@web.de> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54800-done Cc: 54800-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Tue, 12 Apr 2022 22:44:16 +0200 > From: Christoph Arenz > Cc: 54800@debbugs.gnu.org > > > > And there are still cases where above does not work correctly. > > E.g. when using a theme which has different line heights for header > > line and mode line than for text lines, > > say M-x load-theme leuven . > > > > Approaching it differently seems to cover those cases as well: > > > >     (vertical-motion (- 1 (window-body-height))) > > N.B. > This works for me as long as line-spacing is nil. > For non-nil there seems to be a bug in window-body-height. > I have opened bug report #54894 for that. Thanks, I think people who use line-spacing in Calc stack window, or otherwise change the default height of a window-line, should know what they are doing and what would be the result. I installed the change to use the 'floor' argument to window-height, and I think this works well enough in the "usual" use cases; everything else would be a non-trivial enhancement. So I'm closing this bug. From unknown Fri Sep 05 09:30:12 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 12 May 2022 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator