all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: martin rudalics <rudalics@gmx.at>
Cc: 35860@debbugs.gnu.org
Subject: bug#35860: Delayed window positioning after buffer display
Date: Wed, 19 Jun 2019 00:02:42 +0300	[thread overview]
Message-ID: <87fto61ua5.fsf@mail.linkov.net> (raw)
In-Reply-To: <4465efef-794f-de5d-ed5d-04403680a622@gmx.at> (martin rudalics's message of "Tue, 18 Jun 2019 10:19:21 +0200")

>> +(defvar delayed-window-point nil
>
> Name space conventions would recommend 'window-delayed-point'.

Then 'window-delayed-start' would be too ambiguous.  Maybe then
'window-start-delayed' and 'window-point-delayed'.

>> +  "Marker to override default `window-point' in all windows.
>
> Why "marker" and why "all windows"?  As for the former, I think it
> makes sense because then one can specify an insertion type as well.
> But IIRC you earlier wanted to allow plain integers here too?

Yes, plain integers should be allowed as well.

>> +`delayed-window-point' is a buffer-local marker you can move to a valid
>> +position of the buffer shown in the window in order to override the standard
>> +positioning mechanism (`point-min') chosen by window displaying functions.")
>
> IIUC there is no such "mechanism" except for buffers just created.
> And what about 'switch-to-buffer-preserve-window-point'?  "window ???
> displaying functions" implicitly hints at the fact that the mechanism
> works only when the buffer is shown by 'display-buffer'.  But are we
> sure that this restriction always applies?

Maybe the same should be allowed for 'switch-to-buffer' as well,
and even for buffers displayed by set-window-configuration.

>> I see no reason to use macros here.
>> We need to replace these macros with the elegant solution that we already
>> have of using action alists.
>
> Macros are useful in as much as they allow to specify the evaluation
> order of their arguments.  Action alists are dumb in this regard.

The problem is that currently the whole cycle of buffer displaying
doesn't allow executing arbitrary code at different stages:
there are no pre-display-buffer and post-display-buffer hooks.

Adding such hooks would allow to get rid of macros easily.
For example, instead of using two variables 'window-point-delayed'
and 'window-start-delayed', a pre-display hook in 'view-lossage'
will be able just to set a buffer-local run-once post-display hook
that will adjust the window positions after the buffer is displayed
in the window.

Another candidate that can be placed into such post-display hook is
fit-window-to-buffer for cases when adding an action alist
as an arg of display-buffer call is not possible.

And vice versa, pre/post-display actions could be specified
in an action alist of display-buffer, when using hooks is not possible.





  reply	other threads:[~2019-06-18 21:02 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-22 20:32 bug#35860: Delayed window positioning after buffer display Juri Linkov
2019-05-23  4:34 ` Eli Zaretskii
2019-05-23 20:56   ` Juri Linkov
2019-05-24  6:32     ` Eli Zaretskii
2019-05-24 18:34       ` Juri Linkov
2019-05-25  7:58         ` martin rudalics
2019-05-27 19:49           ` Juri Linkov
2019-06-11 20:53           ` Juri Linkov
2019-06-13  8:44             ` martin rudalics
2019-06-13 20:24               ` Juri Linkov
2019-06-14 19:14                 ` Juri Linkov
2019-06-15  8:17                   ` martin rudalics
2019-06-15 22:44                     ` Juri Linkov
2019-06-16  8:16                       ` martin rudalics
2019-06-16 19:32                         ` Juri Linkov
2019-06-17  8:23                           ` martin rudalics
2019-06-17 20:33                             ` Juri Linkov
2019-06-18  8:19                               ` martin rudalics
2019-06-18 21:02                                 ` Juri Linkov [this message]
2019-06-19  9:14                                   ` martin rudalics
2019-06-19 21:34                                 ` Juri Linkov
2019-06-20  7:41                                   ` martin rudalics
2019-06-15  8:17                 ` martin rudalics

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

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

  git send-email \
    --in-reply-to=87fto61ua5.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=35860@debbugs.gnu.org \
    --cc=rudalics@gmx.at \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.