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: Mon, 11 Apr 2022 16:53:50 +0200 Message-ID: <3bd62f12-0d8b-314a-b812-4467e1f6ba43@web.de> 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> 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="10191"; 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 Cc: 54800@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 11 17:26:23 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 1ndvvr-0002UY-48 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 11 Apr 2022 17:26:23 +0200 Original-Received: from localhost ([::1]:36456 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ndvvp-00039N-TH for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 11 Apr 2022 11:26:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41612) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ndvQY-0001rH-Hz for bug-gnu-emacs@gnu.org; Mon, 11 Apr 2022 10:54:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51041) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ndvQY-0008E5-7W for bug-gnu-emacs@gnu.org; Mon, 11 Apr 2022 10:54:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ndvQY-00014W-2c for bug-gnu-emacs@gnu.org; Mon, 11 Apr 2022 10:54: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: Mon, 11 Apr 2022 14:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54800 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 54800-submit@debbugs.gnu.org id=B54800.16496888414117 (code B ref 54800); Mon, 11 Apr 2022 14:54:02 +0000 Original-Received: (at 54800) by debbugs.gnu.org; 11 Apr 2022 14:54:01 +0000 Original-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 Original-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 Original-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 Content-Language: en-US In-Reply-To: <83sfqj6dxn.fsf@gnu.org> X-Provags-ID: V03:K1:+QGj7VlFL2XQh0oRLGvvK8mSOiNW2SFnNF+lPmjZEGdp1M9NaZm gN9QnmW9uglxRZHKy1BGYYlfjht0tnDoHFyw0BW/Xp3UsjZqWuig+ZZjFguAPVvrUesn7fK 1FHDQy0iR8epNpC+afXHFbfcJ8Vu8VnEz3GqhY/PwxFXws2dMrOwElzgWyPxwCgYl8nE5xy Wtw72qOp6EdKixl0ZCtfA== 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/NW2igD28gHNuwvrlrLQrin2gn0nvtpPJlqU6k 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:229721 Archived-At: 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