unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Subject: Re: show-enclosing-scopes
Date: Thu, 17 May 2018 10:31:44 -0400	[thread overview]
Message-ID: <jwvtvr6749s.fsf-monnier+gmane.emacs.devel@gnu.org> (raw)
In-Reply-To: 258be7dd-0bf6-f5b1-20d1-08ea65a177e8@gmail.com

> (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




  reply	other threads:[~2018-05-17 14:31 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-16  6:41 show-enclosing-scopes Jefferson Carpenter
2018-05-16  8:03 ` show-enclosing-scopes Eli Zaretskii
2018-05-16 21:46   ` show-enclosing-scopes Jefferson Carpenter
2018-05-17 14:31     ` Stefan Monnier [this message]
2018-05-17 15:07       ` show-enclosing-scopes Eli Zaretskii
2018-05-17 17:41         ` show-enclosing-scopes Stefan Monnier
2018-05-17 19:16           ` show-enclosing-scopes Eli Zaretskii
2018-05-17 20:24             ` show-enclosing-scopes Stefan Monnier
2018-05-18  1:13               ` show-enclosing-scopes Jefferson Carpenter
2018-05-18  1:16                 ` show-enclosing-scopes Jefferson Carpenter
2018-05-18  6:15                   ` show-enclosing-scopes Eli Zaretskii
2018-05-18  2:22                 ` show-enclosing-scopes Stefan Monnier
2018-05-18  6:02                   ` show-enclosing-scopes Jefferson Carpenter
2018-05-18  6:18                     ` show-enclosing-scopes Jefferson Carpenter
2018-05-18  6:26                       ` show-enclosing-scopes Jefferson Carpenter
2018-05-18  7:01                       ` show-enclosing-scopes Eli Zaretskii
2018-05-18  8:46                     ` show-enclosing-scopes Eli Zaretskii
2018-05-19  4:17                       ` show-enclosing-scopes Jefferson Carpenter
2018-05-19  8:38                         ` show-enclosing-scopes Eli Zaretskii
2018-05-21  3:31                           ` show-enclosing-scopes Jefferson Carpenter
2018-05-25  7:07                             ` show-enclosing-scopes Jefferson Carpenter
2018-05-18  9:02                     ` show-enclosing-scopes Eli Zaretskii
2018-06-03 18:35                       ` show-enclosing-scopes Jefferson Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2018-05-16  6:40 show-enclosing-scopes Jefferson Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvtvr6749s.fsf-monnier+gmane.emacs.devel@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).