From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Christoph Arenz Newsgroups: gmane.emacs.bugs Subject: bug#54800: 28.1; calc: Cursor positioned at weird position in calc stack Date: Fri, 8 Apr 2022 21:44:38 +0200 Message-ID: <4a0319d6-b533-b3d8-bf52-bb18d74757e1@web.de> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------DoEdFgjKBxYtTz2RW4dX4z0a" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34774"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 To: 54800@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Apr 08 21:45:17 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 1ncuXk-0008nV-Kx for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 08 Apr 2022 21:45:16 +0200 Original-Received: from localhost ([::1]:56762 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ncuXj-0002cc-Io for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 08 Apr 2022 15:45:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57828) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ncuXW-0002bx-Kb for bug-gnu-emacs@gnu.org; Fri, 08 Apr 2022 15:45:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42121) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ncuXW-0005Np-BK for bug-gnu-emacs@gnu.org; Fri, 08 Apr 2022 15:45:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ncuXW-0005hw-AB for bug-gnu-emacs@gnu.org; Fri, 08 Apr 2022 15:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Christoph Arenz Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 08 Apr 2022 19:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 54800 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.164944708721895 (code B ref -1); Fri, 08 Apr 2022 19:45:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 8 Apr 2022 19:44:47 +0000 Original-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 Original-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 Original-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 Original-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 Original-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-Language: en-US X-Provags-ID: V03:K1:J+cV0PtUS55IUm2tmapmR60a+dVwkWQJAVelREuqDeuLEJy5nFL A9rjzJOYFnLQerqXLSOZiZknN/5GNR/49So53l+TkWKzhPBVS86MAw3NQ8cWNg5kPuv/l9m pxZTi2uCMdoHIfQcGRWBaiB5rvKcR/Li2Bc40PQG+WZLrP5EOKeb6y29CvvyzsJ2UsAafSt mizIke3kc+lezz47QXjrg== 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+OjJCjASuBIAnWdCduiD4TUWMRtaJETWXw12YzRT0wwuWlcHH9jLBNJ0 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-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:229589 Archived-At: 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--