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: Tue, 12 Apr 2022 17:45:42 +0200 Message-ID: <064785f3-5e77-ae50-aaa5-e590a7eafe4e@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> <3bd62f12-0d8b-314a-b812-4467e1f6ba43@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28164"; 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 Tue Apr 12 17:46:59 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 1neIjK-00074m-KZ for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 12 Apr 2022 17:46:58 +0200 Original-Received: from localhost ([::1]:47180 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1neIjJ-0005TO-BG for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 12 Apr 2022 11:46:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43232) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1neIiQ-0005Mq-93 for bug-gnu-emacs@gnu.org; Tue, 12 Apr 2022 11:46:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55556) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1neIiP-0007AZ-UF for bug-gnu-emacs@gnu.org; Tue, 12 Apr 2022 11:46:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1neIiP-0005Kb-Ol for bug-gnu-emacs@gnu.org; Tue, 12 Apr 2022 11:46:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Christoph Arenz Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 12 Apr 2022 15:46:01 +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.164977835220474 (code B ref 54800); Tue, 12 Apr 2022 15:46:01 +0000 Original-Received: (at 54800) by debbugs.gnu.org; 12 Apr 2022 15:45:52 +0000 Original-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 Original-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 Original-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 Content-Language: en-US In-Reply-To: <3bd62f12-0d8b-314a-b812-4467e1f6ba43@web.de> X-Provags-ID: V03:K1:+jDwqhI/pAF2PFIHHEdTVTKtA8KoXFjo7fLUvYD99VmkOd7hb5+ smOgkgxSU5qMdXzsh8kaVu//3+dggfQH3bbOgdYeKkv/cHCK3U0AjUKtlJdFG7MJapymBql yt/WzTY0TRrtGcAlBe0DHZ7OOQTn6QMIa21cmTTHo/gTl7hzED9KebmV03C3BkbagqAzQAa KTXgaJhdfEny7SVVZqnUA== 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+wlYgBuG1DilH 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:229770 Archived-At: 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 > >