all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Jorgen Schäfer" <jorgen.schaefer@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 23098@debbugs.gnu.org
Subject: bug#23098: 25.0.92; (recenter -1) can leave point in the middle of the window
Date: Wed, 23 Mar 2016 19:40:50 +0000	[thread overview]
Message-ID: <CALqDrSe7GUay_h0q9aKzfrwgP6OVU_QzS_tVhCHn5DV8a+CoUw@mail.gmail.com> (raw)
In-Reply-To: <83d1ql2ebx.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1947 bytes --]

Hello!
The use case here are buffers like comint or IRC chat buffers. It's nice to
keep the last line of the buffer flush with the last line of the window, to
show the maximum amount of data. (recenter -1) at the end of a buffer is
supposed to do just that. In this case, it does not, but instead leaves
point in the *middle* of the window.

If it is not possible to display that line halfway (which sounds like a
missing feature to begin with), I would expect Emacs to least try to leave
point as low in the window as possible, instead of in the middle of the
window. C-l likewise won't move point any further down, for example.

Regards,
Jorgen

On Wed, Mar 23, 2016 at 8:18 PM Eli Zaretskii <eliz@gnu.org> wrote:

> > From: Jorgen Schaefer <jorgen.schaefer@gmail.com>
> > Date: Wed, 23 Mar 2016 19:40:27 +0100
> >
> > Evaluating the following code in "emacs -Q" leaves point in the middle
> > of the window, instead of at the end of the window as expected. Certain
> > modes (IRC) want to keep the buffer flushed at the end of the window,
> > this problem interferes with that behavior and causes very weird jumpy
> > scrolling.
> >
> >
> > (require 'cl)
> > (let* ((b (get-buffer-create "*Bug Repro*"))
> >        (w (selected-window))
> >        (l (window-height w))
> >        o)
> >   (set-window-buffer w b)
> >   (select-window w)
> >   (set-buffer b)
> >   (erase-buffer)
> >   (cl-dotimes (i (* l 2))
> >               (insert "foo\n"))
> >   (goto-char (point-min))
> >   (forward-line (+ l 2))
> >   (setq o (make-overlay (point) (point)))
> >   (overlay-put o 'after-string "\n")
> >   (goto-char (point-max))
> >   (recenter -1))
> >
> >
> > That is, if there is a multi-line overlay that would be shown only
> > halfway.
>
> I'm not sure I understand: are you trying to display a window whose
> start point is in the middle of an overlay string?  That's not
> possible, AFAIK.  The window-start point must be a buffer position.
>

[-- Attachment #2: Type: text/html, Size: 2623 bytes --]

  reply	other threads:[~2016-03-23 19:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-23 18:40 bug#23098: 25.0.92; (recenter -1) can leave point in the middle of the window Jorgen Schaefer
2016-03-23 19:18 ` Eli Zaretskii
2016-03-23 19:40   ` Jorgen Schäfer [this message]
2016-03-23 20:22     ` Eli Zaretskii
2016-03-24  8:12       ` Jorgen Schäfer
2016-03-24 15:47         ` Eli Zaretskii
2016-03-24 16:27           ` Jorgen Schäfer
2016-03-24 16:38             ` Eli Zaretskii
2016-03-26 23:27     ` John Wiegley
2016-03-27  8:35       ` Andreas Schwab
2016-03-27 15:07         ` Drew Adams
2016-03-28 13:10       ` Jorgen Schäfer
2016-03-28 17:28         ` Eli Zaretskii
2016-03-28 17:41           ` Jorgen Schäfer
2016-03-28 17:59             ` Eli Zaretskii

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=CALqDrSe7GUay_h0q9aKzfrwgP6OVU_QzS_tVhCHn5DV8a+CoUw@mail.gmail.com \
    --to=jorgen.schaefer@gmail.com \
    --cc=23098@debbugs.gnu.org \
    --cc=eliz@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 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.