all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#31276: 27.0.50; "Spurious" empty first line from before-string
@ 2018-04-26 20:11 Stefan Monnier
  2018-04-28  9:40 ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2018-04-26 20:11 UTC (permalink / raw)
  To: 31276

Package: Emacs
Version: 27.0.50


Try the following:

    % src/emacs -Q etc/NEWS --eval '(let ((ol (make-overlay (+ (point) 10) (+ (point) 10)))) (overlay-put ol (quote before-string) "\nhello\n"))'
    C-u 1 C-v

You should see that the "scroll by 1 line" didn't actually scroll: it just
removed the "GNU Emacs " from your sight and left an empty line instead.

Arguably, this is right: `window-start` has to be one of the buffer's
positions, so it has to be either before or after the overlay, and the
overlay's string starts with a line-feed, so if window-start is placed
there, the window will start with an empty line.

But arguably this is also wrong: there is no empty-line at that position
in the buffer's normal rendering.

Whether you consider this as a bug report or a feature request, my point
is that when the window starts with a before/after-string and that
string starts with a line-feed, we should skip that line-feed rather
than waste a perfectly good line.


        Stefan





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-04-28 14:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-26 20:11 bug#31276: 27.0.50; "Spurious" empty first line from before-string Stefan Monnier
2018-04-28  9:40 ` Eli Zaretskii
2018-04-28 13:13   ` Stefan Monnier
2018-04-28 14:04     ` Eli Zaretskii
2018-04-28 14:07       ` Eli Zaretskii

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.