From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: show-enclosing-scopes Date: Thu, 17 May 2018 10:31:44 -0400 Message-ID: References: <5cb3e5a6-310f-1f2a-ceb8-01b929158ebb@gmail.com> <594F9BDF-F041-4B8D-8425-0BE2AABAA448@gnu.org> <258be7dd-0bf6-f5b1-20d1-08ea65a177e8@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1526567404 811 195.159.176.226 (17 May 2018 14:30:04 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 17 May 2018 14:30:04 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 17 16:30:00 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fJJup-0008WD-84 for ged-emacs-devel@m.gmane.org; Thu, 17 May 2018 16:29:59 +0200 Original-Received: from localhost ([::1]:58566 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fJJwv-0008Em-Vo for ged-emacs-devel@m.gmane.org; Thu, 17 May 2018 10:32:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:32890) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fJJwl-0008Ea-2J for emacs-devel@gnu.org; Thu, 17 May 2018 10:31:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fJJwh-0008FI-Lj for emacs-devel@gnu.org; Thu, 17 May 2018 10:31:59 -0400 Original-Received: from [195.159.176.226] (port=60137 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fJJwh-0008Eg-De for emacs-devel@gnu.org; Thu, 17 May 2018 10:31:55 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1fJJuW-0008Dh-Bl for emacs-devel@gnu.org; Thu, 17 May 2018 16:29:40 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 32 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:+tn7OyaBYOIYiY7vqovN/on5KjQ= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:225366 Archived-At: > (progn (scroll-up 1) (beginning-of-buffer)) So you have here an ambiguous specification: on the one hand you specified the window-start via scroll-up, on the other you specified point with beginning-of-buffer. Since point needs to be within the visible part of the buffer, the redisplay engine has to choose which of the two requests to override. Now the question is why does your package end up in situations with such ambiguous specifications? Assuming you don't have any control over the scroll-up part and you want to override it via beginning-of-buffer, there is indeed currently no easy way to get that, AFAICT: this is controlled by the `force_start` field in the window which will have been set by scroll-up (and can be set via set-window-start) but can't be "unset" directly. Maybe you can try (defun my-unset-window-force-start () (cl-assert (eq (current-buffer) (window-buffer))) (save-excursion (let ((buf (current-buffer))) (with-temp-buffer (set-window-buffer (selected-window) (current-buffer) 'keep-margins) (set-window-buffer (selected-window) buf 'keep-margins))))) since it seems that set-window-buffer does unset `force-start`. It will also cause undesirable side-effects, but maybe in your case they will be less annoying than those of `redisplay`. Stefan