From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 0G2nCyt1g2cPrAAA62LTzQ:P1 (envelope-from ) for ; Sun, 12 Jan 2025 07:54:19 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id 0G2nCyt1g2cPrAAA62LTzQ (envelope-from ) for ; Sun, 12 Jan 2025 08:54:19 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=BsnvDkit; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1736668459; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=OXQjk8HhYcHzbYGgu/X2XfsvgcPIHDgNHzBHTGZtnFE=; b=j+XFV8+5oXSyvxAz24FDTHfGSOb+lrHsVIfeTL9RFXg4R9Xo7WQOvgGZY+6nF3c0ryRsVB XXtAfvdt8e6ziBBl72vOLrW8SFMzmgsER2cHlP1D4VzhJoHacx4X2jLvE3bR505bymMu2m 1qVmlRQA7IuqZTfZNvyxLVYiHI31pY1VLIWqWBkxtIxxbpd5ib5aH+M5PIPWS7btqHutPh U79rjw5nhyCH9NQ/wANgRujM2Ib7SzU7wd8+6wnXcJhcaKrkoDpJiZc/vTHcx+RmsbTQT8 x2gCekaAxmF6c/O6WFipESEOenTujUqfRzd9I1Dg1hgAP2ffVVjfcHh+4CYwug== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=BsnvDkit; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1736668459; a=rsa-sha256; cv=none; b=iOLSOp96v0MuG/g330G32LgD7bNngM3Ps1F8tAp22A0cFxaom8dUOw97qe9FPVmf1h1Xbz PVO/XBo8ZTCiYct9eJnNil5pyMQ+NgR69BTw81SnE2alV/RxV6YfJBVytRLPsPzF3Kuwul NuADPd8LJ/FPj3MOxt0bDXHfJcB3afD/Bd0z76Fmmc0IHR4RJUA6zcKDqGhcjHGU3tsagr 5sIahXbn2PbN4i5LHTZDFAqlRDn49VA/NzXMF7rDSlopPJotrbMnm2QIDffPVAvv23CYP8 W3WZw96fcddLE5Mz92tvjydTVls3iwm6YCyCTVdgRQLVkXzYk9H9SCiYc59v8A== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 1123B2659 for ; Sun, 12 Jan 2025 08:54:19 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tWsmf-0007KM-3R; Sun, 12 Jan 2025 02:53:21 -0500 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 1tWsmZ-0007KB-Jo for emacs-orgmode@gnu.org; Sun, 12 Jan 2025 02:53:15 -0500 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tWsmW-0004LE-TV for emacs-orgmode@gnu.org; Sun, 12 Jan 2025 02:53:15 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 277FA240028 for ; Sun, 12 Jan 2025 08:53:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1736668390; bh=ap7gaGTaAw7dKZl8XEowCn78RrnGctrPF3Ebs/R/DrY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=BsnvDkit8C/Yue14dW2NXdr8R/C/vDIui1H2T5kBkGn/2ICjt/3In/6mVCJXpQXCf ZleHQ7/MNQmuqIRAEYUz5VUh5+bbfAJfn3RdWcLk5eCoImSVbV5Nto9ChYmJ2EE85r I/iG3t34wTgTj40XT8JSNrroTlgoAghZ1A3nr3mG8TLr5AZd5qIq9Wjw40CJtgh8OC w6XZGB1SuswfhndXyLHlt9dUxmaX8SHNN4KT6vzvSsTteqVHbmwHzDm909rmr58OlM 7vA1zTKnlhute8tiRjm3LiVHJMsZ/8hek75EXL/Y4hg3ShiBENzxcf6bj3Uoh2EEi2 T647+ag7LJsbA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4YW7111CZ2z9rxK; Sun, 12 Jan 2025 08:53:09 +0100 (CET) From: Ihor Radchenko To: Michael Heerdegen Cc: emacs-orgmode@gnu.org Subject: Re: [BUG] org-agenda-later sometimes creates a void display [9.7.11 (release_9.7.11 @ /usr/local/share/emacs/31.0.50/lisp/org/)] In-Reply-To: <878qrgzxv1.fsf@web.de> References: <874j2e14sz.fsf@web.de> <87v7utprqe.fsf@localhost> <87y0zpqg44.fsf@web.de> <87ttadnmcv.fsf@localhost> <87ttadqati.fsf@web.de> <8734hp1kjk.fsf@localhost> <878qrgzxv1.fsf@web.de> Date: Sun, 12 Jan 2025 07:55:25 +0000 Message-ID: <87a5bw79g2.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Queue-Id: 1123B2659 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: 0.05 X-Spam-Score: 0.05 X-TUID: fyFmeU3nIbNm --=-=-= Content-Type: text/plain Michael Heerdegen writes: > Ihor Radchenko writes: > >> + (unless (< (point) wstart) ; do no scroll past the point >> + (set-window-start nil wstart)))) > > Thanks. > > Hmmm - don't we have the same problem when (point) > (window-end)? And > this case is nastier, since exact window-end calculation needs a > redisplay. We might introduce a flicker when trying to fix it. Right. What about the attached patch? > Since line lengths differ, we are currently setting window-start to a > random line, to some degree. (And I think window-start should better be > set to the beginning of line). I believe that Emacs redisplay should take care about this automatically. > One step back: What problem does this hack solve? Org already remembers > the unit number of the time period point is in, and restores that: with > point in a Wednesday, the new view will have point set to the beginning > of the next Wednesday. The display engine ensures that point is > made visible. https://orgmode.org/list/87lfh2hk4k.fsf@gmail.com/ > How about something like this? > > - If point is at bob, we ensure that point is restored at bob - and > likewise for eob. > > - When bob was visible in the prior view, we use window-start = 1 > for the new view, too > > - But when bob was not visible in the last view, we try to restore the > visible line number containing the window point, so that hitting f > will show the cursor at the same vertical position as in the last > view. Or maybe better: restore the vertical position of the > beginning of the weekday point was in. I hope that my idea in the patch is good enough and that we do not need to go into redisplay complications. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=v2-0001-org-agenda-later-Avoid-scrolling-the-window-past-.patch >From 3a4eb4837aecd924a355645473d8d335dfec6caa Mon Sep 17 00:00:00 2001 Message-ID: <3a4eb4837aecd924a355645473d8d335dfec6caa.1736668180.git.yantar92@posteo.net> From: Ihor Radchenko Date: Sat, 11 Jan 2025 15:33:31 +0100 Subject: [PATCH v2] org-agenda-later: Avoid scrolling the window past point * lisp/org-agenda.el (org-agenda-later): When previous agenda buffer is larger and its scroll position puts point outside the screen, do not try to restore scroll state. (Doing otherwise, scrolls past the point, leading to unpredictable results - depending on `scroll-conservatively'. Reported-by: Michael Heerdegen Link: https://orgmode.org/list/87ttadqati.fsf@web.de --- lisp/org-agenda.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 884b9de782..8143fd97a7 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -8789,7 +8789,7 @@ (defun org-agenda-later (arg) (list (car args) sd span))) (org-agenda-redo) (org-agenda-find-same-or-today-or-agenda cnt)) - (set-window-start nil wstart))) + (set-window-start nil wstart 'noforce))) (defun org-agenda-earlier (arg) "Go backward in time by the current span in the agenda buffer. -- 2.47.1 --=-=-= Content-Type: text/plain -- Ihor Radchenko // yantar92, Org mode maintainer, Learn more about Org mode at . Support Org development at , or support my work at --=-=-=--