From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id CCsDC+2a9l6CZAAA0tVLHw (envelope-from ) for ; Sat, 27 Jun 2020 01:03:41 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id AFydBu2a9l7bagAAbx9fmQ (envelope-from ) for ; Sat, 27 Jun 2020 01:03:41 +0000 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 2764A9400B1 for ; Sat, 27 Jun 2020 01:03:40 +0000 (UTC) Received: from localhost ([::1]:51618 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jozFp-0006ER-IF for larch@yhetil.org; Fri, 26 Jun 2020 21:03:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39502) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jozFO-0006EE-RL for emacs-orgmode@gnu.org; Fri, 26 Jun 2020 21:03:10 -0400 Received: from pb-smtp1.pobox.com ([64.147.108.70]:52923) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jozFM-0003gS-DQ for emacs-orgmode@gnu.org; Fri, 26 Jun 2020 21:03:10 -0400 Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id E245E6ED99; Fri, 26 Jun 2020 21:03:04 -0400 (EDT) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:in-reply-to:references:date:message-id:mime-version :content-type; s=sasl; bh=ytDq7Bz9yeV5Zx6TIziwaQlQ+bg=; b=AGJ8bW qfxDNqVOgFQXUiCjYz8lqDksfZL+rN/vazBTRFqEqPmckV/5l1uDsNhU008s59/t H9DDQa6PZHD9RE2BPfEikZxXRmoeatdOSEpmZxuIOVLNeNVSO+7smBsnIJzW2/v2 wko2pfASjm02qSxjCI2xdkT2RhtFl2XctWcV0= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id D1AB76ED98; Fri, 26 Jun 2020 21:03:04 -0400 (EDT) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=kyleam.com; h=from:to:cc:subject:in-reply-to:references:date:message-id:mime-version:content-type; s=mesmtp; bh=88wtWjAeKLtFA4nxj28Vt/eChZ92vo/2YOO2GLBDxnk=; b=foOKTQ6spPkQTkAt86Le1eB25wPQEpbZ1RnuZCacS6IEOx0FYAYDVyVbDmj4r6UXjVG0TZi1q7Sstz9rsoIoynQrMYTjZHeRZf2aOAIXwFbF6Wam4C1esDJ6Eyq6IMlBFB5ds6Zr3eZInu0Tl1hd5MQy5GIX1ICoUvp3GPLdy0I= Received: from localhost (unknown [45.33.91.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id 75E596ED97; Fri, 26 Jun 2020 21:03:03 -0400 (EDT) (envelope-from kyle@kyleam.com) From: Kyle Meyer To: Gustavo Barros Subject: [PATCH] ox: Prevent dispatcher from starting in scrolled window In-Reply-To: <87sgf4bgu8.fsf@gmail.com> References: <87tv3a56vv.fsf@gmail.com> <874krtvifh.fsf@gmail.com> <87y2owetey.fsf@kyleam.com> <87sgf4bgu8.fsf@gmail.com> Date: Sat, 27 Jun 2020 01:03:02 +0000 Message-ID: <87d05l722h.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: F3F867DC-B811-11EA-B5FE-C28CBED8090B-24757444!pb-smtp1.pobox.com Received-SPF: pass client-ip=64.147.108.70; envelope-from=kyle@kyleam.com; helo=pb-smtp1.pobox.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/26 21:03:05 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=pobox.com header.s=sasl header.b=AGJ8bW q; dkim=pass header.d=kyleam.com header.s=mesmtp header.b=foOKTQ6s; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -1.21 X-TUID: /jV1gQY5zLqQ Gustavo Barros writes: > On Tue, Jun 09 2020 at 01:48, Kyle Meyer wrote: > >> I've tried to trigger it with your minimal configuration and haven't >> observed the displacement you describe, even when making my frame >> height >> very small. > > I was afraid there might be things in the environment which could affect > this (DE? distro? monitor size? Emacs configure options? I don't know), > but it does reproduce every single time for me with the recipe I > provided. I've managed to trigger it now. Your picture gave me the hint that maybe my "making my frame height very small" wasn't the thing to do. Plus I should have realized that the default-frame-alist in your minimal configuration probably isn't going to matter on my end because I use a tiling window manager. So here's what I could trigger it: (setq scroll-margin 1) ; or anything > 0 (setq display-buffer-base-action '(display-buffer-at-bottom)) For reasons I don't really understand, if I make my frame height small (say half my computer screen) the issue goes away. Anyway, I'm able to resolve the issues I see with this patch. Can you confirm that it fixes things on your end? -- >8 -- Subject: [PATCH] ox: Prevent dispatcher from starting in scrolled window * lisp/ox.el (org-export--dispatch-ui): Restore buffer position after inserting text to avoid auto-scrolling at start. When filling in the dispatch buffer, point ends up at the end of the buffer, which can cause the buffer to be re-centered on point when org-fit-window-to-buffer is called, in particular if scroll-margin is above zero and there is a vertical split. Avoid this by putting point where it was before the buffer was refreshed. Reported-by: Gustavo Barros https://orgmode.org/list/87tv3a56vv.fsf@gmail.com --- lisp/ox.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/ox.el b/lisp/ox.el index 869164737..456dd9bef 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -6878,10 +6878,12 @@ (defun org-export--dispatch-ui (options first-key expertp) (with-current-buffer "*Org Export Dispatcher*" ;; Refresh help. Maintain display continuity by re-visiting ;; previous window position. - (let ((pos (window-start))) + (let ((pt (point)) + (wstart (window-start))) (erase-buffer) (insert help) - (set-window-start nil pos))) + (goto-char pt) + (set-window-start nil wstart))) (org-fit-window-to-buffer) (org-export--dispatch-action standard-prompt allowed-keys entries options first-key expertp)))) base-commit: f471768a54d8921ff383516af6a605adc061af30 -- 2.26.2