all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#32863: Unsatisfactory "definition" of "vertical scroll position" in Emacs lisp manual and doc string of window-vscroll
@ 2018-09-28 15:28 Alan Mackenzie
  2018-09-28 21:41 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Alan Mackenzie @ 2018-09-28 15:28 UTC (permalink / raw)
  To: 32863

Hello, Emacs.

In the Emacs-26.1 Emacs Lisp manual, on page "Vertical Scrolling" there
is an ostensible definition for "vertical scroll position".

This "definition" says it "is a number, never less than zero.  It
specifies how far to raise the contents of the window."

What should be doing this raising?  When might it do this?  For what
purpose might the contents of the window be raised?

I find this "definition" totally obscure.  I can not make sense of it at
all.  Without understanding what "vertical scroll position" means, the
entire manual page is meaningless.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

I came to this manual page through not understanding the doc string for
the function window-vscroll.  This says just "Return the amount by which
WINDOW is scrolled vertically.".

_Is_ scrolled vertically.  What on earth does that mean?  What is the
zero point from which this scrolling is measured?  Does this "is" refer
to the current visible scrolling, or the intended scrolling after the
next redisplay?

This doc string needs clarification.

-- 
Alan Mackenzie (Nuremberg, Germany).





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

* bug#32863: Unsatisfactory "definition" of "vertical scroll position" in Emacs lisp manual and doc string of window-vscroll
  2018-09-28 15:28 bug#32863: Unsatisfactory "definition" of "vertical scroll position" in Emacs lisp manual and doc string of window-vscroll Alan Mackenzie
@ 2018-09-28 21:41 ` Eli Zaretskii
  2018-10-15 11:48   ` Alan Mackenzie
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2018-09-28 21:41 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: 32863

> Date: Fri, 28 Sep 2018 15:28:32 +0000
> From: Alan Mackenzie <acm@muc.de>
> 
> In the Emacs-26.1 Emacs Lisp manual, on page "Vertical Scrolling" there
> is an ostensible definition for "vertical scroll position".
> 
> This "definition" says it "is a number, never less than zero.  It
> specifies how far to raise the contents of the window."
> 
> What should be doing this raising?

The call to set-window-vscroll does that.

> When might it do this?

The automatic calls to set-window-vscroll happen when a screen line is
too tall to be completely visible in a window, and Emacs is asked to
scroll.  Try scrolling or vertical motion commands when the window
displays a tall image.

> For what purpose might the contents of the window be raised?

To show the portion of the current line that is not currently visible.

> I find this "definition" totally obscure.  I can not make sense of it at
> all.  Without understanding what "vertical scroll position" means, the
> entire manual page is meaningless.

Do you understand it now?

> I came to this manual page through not understanding the doc string for
> the function window-vscroll.  This says just "Return the amount by which
> WINDOW is scrolled vertically.".
> 
> _Is_ scrolled vertically.  What on earth does that mean?

See above.

> What is the zero point from which this scrolling is measured?

The zero point is when the top pixel of the window's first screen line
is visible.

> Does this "is" refer to the current visible scrolling, or the
> intended scrolling after the next redisplay?

Since redisplay runs when Emacs is idle, the answer should be obvious,
right?

> This doc string needs clarification.

I'm all ears.





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

* bug#32863: Unsatisfactory "definition" of "vertical scroll position" in Emacs lisp manual and doc string of window-vscroll
  2018-09-28 21:41 ` Eli Zaretskii
@ 2018-10-15 11:48   ` Alan Mackenzie
  2018-10-15 15:32     ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Alan Mackenzie @ 2018-10-15 11:48 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 32863

Hello, Eli.

Thanks very much for the explanations.

On Sat, Sep 29, 2018 at 00:41:54 +0300, Eli Zaretskii wrote:
> > Date: Fri, 28 Sep 2018 15:28:32 +0000
> > From: Alan Mackenzie <acm@muc.de>

> > In the Emacs-26.1 Emacs Lisp manual, on page "Vertical Scrolling" there
> > is an ostensible definition for "vertical scroll position".

> > This "definition" says it "is a number, never less than zero.  It
> > specifies how far to raise the contents of the window."

> > What should be doing this raising?

> The call to set-window-vscroll does that.

> > When might it do this?

> The automatic calls to set-window-vscroll happen when a screen line is
> too tall to be completely visible in a window, and Emacs is asked to
> scroll.  Try scrolling or vertical motion commands when the window
> displays a tall image.

> > For what purpose might the contents of the window be raised?

> To show the portion of the current line that is not currently visible.

> > I find this "definition" totally obscure.  I can not make sense of it at
> > all.  Without understanding what "vertical scroll position" means, the
> > entire manual page is meaningless.

> Do you understand it now?

Yes, I do.  :-)

> > I came to this manual page through not understanding the doc string for
> > the function window-vscroll.  This says just "Return the amount by which
> > WINDOW is scrolled vertically.".

> > _Is_ scrolled vertically.  What on earth does that mean?

> See above.

> > What is the zero point from which this scrolling is measured?

> The zero point is when the top pixel of the window's first screen line
> is visible.

> > Does this "is" refer to the current visible scrolling, or the
> > intended scrolling after the next redisplay?

> Since redisplay runs when Emacs is idle, the answer should be obvious,
> right?

> > This doc string needs clarification.

> I'm all ears.

I propose to amend windows.texi, and two doc strings in windows.c in the
emacs-26 branch as follows.  I think that these amendments would have
prevented my initial puzzlement.  Any comments?


diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index 265067146d..32546c544d 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -4200,18 +4200,19 @@ Vertical Scrolling
 @cindex vertical scroll position
 
    @dfn{Vertical fractional scrolling} means shifting text in a window
-up or down by a specified multiple or fraction of a line.  Each window
+up or down by a specified multiple or fraction of a line.  Emacs uses it
+on images and text rows which are taller than the window.  Each window
 has a @dfn{vertical scroll position}, which is a number, never less than
-zero.  It specifies how far to raise the contents of the window.
-Raising the window contents generally makes all or part of some lines
-disappear off the top, and all or part of some other lines appear at the
-bottom.  The usual value is zero.
+zero.  It specifies how far to raise the contents of the window when
+redisplaying it.  Raising the window contents generally makes all or
+part of some lines disappear off the top, and all or part of some other
+lines appear at the bottom.  The usual value is zero.
 
    The vertical scroll position is measured in units of the normal line
 height, which is the height of the default font.  Thus, if the value is
-.5, that means the window contents are scrolled up half the normal line
-height.  If it is 3.3, that means the window contents are scrolled up
-somewhat over three times the normal line height.
+.5, that means the window contents will be scrolled up half the normal
+line height.  If it is 3.3, that means the window contents are scrolled
+up somewhat over three times the normal line height.
 
    What fraction of a line the vertical scrolling covers, or how many
 lines, depends on what the lines contain.  A value of .5 could scroll a
diff --git a/src/window.c b/src/window.c
index 409b01f302..0f784db77f 100644
--- a/src/window.c
+++ b/src/window.c
@@ -7322,6 +7322,8 @@ value.  */)
 
 DEFUN ("window-vscroll", Fwindow_vscroll, Swindow_vscroll, 0, 2, 0,
        doc: /* Return the amount by which WINDOW is scrolled vertically.
+This takes effect when redisplaying tall lines or images.
+
 If WINDOW is omitted or nil, it defaults to the selected window.
 Normally, value is a multiple of the canonical character height of WINDOW;
 optional second arg PIXELS-P means value is measured in pixels.  */)
@@ -7344,6 +7346,8 @@ optional second arg PIXELS-P means value is measured in pixels.  */)
 DEFUN ("set-window-vscroll", Fset_window_vscroll, Sset_window_vscroll,
        2, 3, 0,
        doc: /* Set amount by which WINDOW should be scrolled vertically to VSCROLL.
+This takes effect when redisplaying tall lines or images.
+
 WINDOW nil means use the selected window.  Normally, VSCROLL is a
 non-negative multiple of the canonical character height of WINDOW;
 optional third arg PIXELS-P non-nil means that VSCROLL is in pixels.



-- 
Alan Mackenzie (Nuremberg, Germany).





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

* bug#32863: Unsatisfactory "definition" of "vertical scroll position" in Emacs lisp manual and doc string of window-vscroll
  2018-10-15 11:48   ` Alan Mackenzie
@ 2018-10-15 15:32     ` Eli Zaretskii
  2018-10-15 18:33       ` Alan Mackenzie
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2018-10-15 15:32 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: 32863

> Date: Mon, 15 Oct 2018 11:48:03 +0000
> Cc: 32863@debbugs.gnu.org
> From: Alan Mackenzie <acm@muc.de>
> 
> I propose to amend windows.texi, and two doc strings in windows.c in the
> emacs-26 branch as follows.  I think that these amendments would have
> prevented my initial puzzlement.  Any comments?

The changes to doc strings are fine (but please use "display" instead
of "redisplay", as the latter is a technical term not necessarily
accurate in this context).

As for the changes to windows.texi, I admit that I don't really
understand how such insignificant changes could prevent your
puzzlement.  Are you sure it isn't the result of reading my
explanations, which caused the text to "talk" to you more clearly?

>     @dfn{Vertical fractional scrolling} means shifting text in a window
> -up or down by a specified multiple or fraction of a line.  Each window
> +up or down by a specified multiple or fraction of a line.  Emacs uses it
> +on images and text rows which are taller than the window.  Each window

Here you added a sentence that tells when is this feature used.  (Btw,
nothing prevents Emacs from using it even with lines that are not
taller than the window, and it even does so sometimes.  So this is
just an example, and I'd suggest to say that.  Also, please don't use
"rows" in the manual: that is the terminology of xdisp.c, but Lisp
programmers are unfamiliar with it.  I prefer to use "screen lines".)

>  has a @dfn{vertical scroll position}, which is a number, never less than
> -zero.  It specifies how far to raise the contents of the window.
> -Raising the window contents generally makes all or part of some lines
> -disappear off the top, and all or part of some other lines appear at the
> -bottom.  The usual value is zero.
> +zero.  It specifies how far to raise the contents of the window when
> +redisplaying it.  Raising the window contents generally makes all or
> +part of some lines disappear off the top, and all or part of some other
> +lines appear at the bottom.  The usual value is zero.

Here you just added "when redisplaying it".  If this is such a
crucially important detail, I'm all for it (but again, please say
"displaying").  However, I wonder whether it really is all that
stood between you and the eureka.

>     The vertical scroll position is measured in units of the normal line
>  height, which is the height of the default font.  Thus, if the value is
> -.5, that means the window contents are scrolled up half the normal line
> -height.  If it is 3.3, that means the window contents are scrolled up
> -somewhat over three times the normal line height.
> +.5, that means the window contents will be scrolled up half the normal
> +line height.  If it is 3.3, that means the window contents are scrolled
> +up somewhat over three times the normal line height.

And here, you just replaced "are scrolled" with "will be scrolled"
(only once out of 2 instances).  Again, one wonders whether this is
all that you missed to see the light.

I'm not saying I object to these changes -- I don't -- but I'm a bit
surprised that such minor changes could have such a profound effect on
clarity.

Thanks.





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

* bug#32863: Unsatisfactory "definition" of "vertical scroll position" in Emacs lisp manual and doc string of window-vscroll
  2018-10-15 15:32     ` Eli Zaretskii
@ 2018-10-15 18:33       ` Alan Mackenzie
  2018-10-15 18:47         ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Alan Mackenzie @ 2018-10-15 18:33 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 32863

Hello, Eli.

Thanks for such a rapid review!

On Mon, Oct 15, 2018 at 18:32:05 +0300, Eli Zaretskii wrote:
> > Date: Mon, 15 Oct 2018 11:48:03 +0000
> > Cc: 32863@debbugs.gnu.org
> > From: Alan Mackenzie <acm@muc.de>

> > I propose to amend windows.texi, and two doc strings in windows.c in the
> > emacs-26 branch as follows.  I think that these amendments would have
> > prevented my initial puzzlement.  Any comments?

> The changes to doc strings are fine (but please use "display" instead
> of "redisplay", as the latter is a technical term not necessarily
> accurate in this context).

Done.

> As for the changes to windows.texi, I admit that I don't really
> understand how such insignificant changes could prevent your
> puzzlement.  Are you sure it isn't the result of reading my
> explanations, which caused the text to "talk" to you more clearly?

I've thought of that, and been as careful as I can be to reconstruct my
mental state at the time I raised the bug.  I think my emphasis on "when
displaying it" is sufficient to establish a context for understanding.

> >     @dfn{Vertical fractional scrolling} means shifting text in a window
> > -up or down by a specified multiple or fraction of a line.  Each window
> > +up or down by a specified multiple or fraction of a line.  Emacs uses it
> > +on images and text rows which are taller than the window.  Each window

> Here you added a sentence that tells when is this feature used.  (Btw,
> nothing prevents Emacs from using it even with lines that are not
> taller than the window, and it even does so sometimes.  So this is
> just an example, and I'd suggest to say that.  Also, please don't use
> "rows" in the manual: that is the terminology of xdisp.c, but Lisp
> programmers are unfamiliar with it.  I prefer to use "screen lines".)

Done (both).

> >  has a @dfn{vertical scroll position}, which is a number, never less than
> > -zero.  It specifies how far to raise the contents of the window.
> > -Raising the window contents generally makes all or part of some lines
> > -disappear off the top, and all or part of some other lines appear at the
> > -bottom.  The usual value is zero.
> > +zero.  It specifies how far to raise the contents of the window when
> > +redisplaying it.  Raising the window contents generally makes all or
> > +part of some lines disappear off the top, and all or part of some other
> > +lines appear at the bottom.  The usual value is zero.

> Here you just added "when redisplaying it".  If this is such a
> crucially important detail, I'm all for it (but again, please say
> "displaying").  However, I wonder whether it really is all that
> stood between you and the eureka.

I believe it is.

> >     The vertical scroll position is measured in units of the normal line
> >  height, which is the height of the default font.  Thus, if the value is
> > -.5, that means the window contents are scrolled up half the normal line
> > -height.  If it is 3.3, that means the window contents are scrolled up
> > -somewhat over three times the normal line height.
> > +.5, that means the window contents will be scrolled up half the normal
> > +line height.  If it is 3.3, that means the window contents are scrolled
> > +up somewhat over three times the normal line height.

> And here, you just replaced "are scrolled" with "will be scrolled"
> (only once out of 2 instances).  Again, one wonders whether this is
> all that you missed to see the light.

This attempts to fix a fundamental ambiguity in the use of the words "is"
and "are" with a past participle.  For example, compare these two sentences:

1. Emacs 26.1 is released.
2. Emacs is released every few months.

In the first, "is released" refers to a one-time event in the past.  In
the second, it refers to a habitual action, still happening.  That same
ambiguity with "are" in "...means the window contents are scrolled up"
confused me.  The "will be" helps eliminate the interpretation "have
ALREADY been scrolled up", the 1. above.

> I'm not saying I object to these changes -- I don't -- but I'm a bit
> surprised that such minor changes could have such a profound effect on
> clarity.

When I first read the page I was totally lacking in context.  I think
I've added enough context to have helped me, were I coming to it again
for the first time.

OK, amended (final?) version:


diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index 265067146d..960573d865 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -4200,18 +4200,20 @@ Vertical Scrolling
 @cindex vertical scroll position
 
    @dfn{Vertical fractional scrolling} means shifting text in a window
-up or down by a specified multiple or fraction of a line.  Each window
-has a @dfn{vertical scroll position}, which is a number, never less than
-zero.  It specifies how far to raise the contents of the window.
-Raising the window contents generally makes all or part of some lines
-disappear off the top, and all or part of some other lines appear at the
-bottom.  The usual value is zero.
+up or down by a specified multiple or fraction of a line.  Emacs uses
+it, for example, on images and screen lines which are taller than the
+window.  Each window has a @dfn{vertical scroll position}, which is a
+number, never less than zero.  It specifies how far to raise the
+contents of the window when displaying them.  Raising the window
+contents generally makes all or part of some lines disappear off the
+top, and all or part of some other lines appear at the bottom.  The
+usual value is zero.
 
    The vertical scroll position is measured in units of the normal line
 height, which is the height of the default font.  Thus, if the value is
-.5, that means the window contents are scrolled up half the normal line
-height.  If it is 3.3, that means the window contents are scrolled up
-somewhat over three times the normal line height.
+.5, that means the window contents will be scrolled up half the normal
+line height.  If it is 3.3, that means the window contents are scrolled
+up somewhat over three times the normal line height.
 
    What fraction of a line the vertical scrolling covers, or how many
 lines, depends on what the lines contain.  A value of .5 could scroll a

> Thanks.

-- 
Alan Mackenzie (Nuremberg, Germany).





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

* bug#32863: Unsatisfactory "definition" of "vertical scroll position" in Emacs lisp manual and doc string of window-vscroll
  2018-10-15 18:33       ` Alan Mackenzie
@ 2018-10-15 18:47         ` Eli Zaretskii
  2018-10-15 19:13           ` Alan Mackenzie
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2018-10-15 18:47 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: 32863

> Date: Mon, 15 Oct 2018 18:33:01 +0000
> Cc: 32863@debbugs.gnu.org
> From: Alan Mackenzie <acm@muc.de>
> 
> OK, amended (final?) version:

LGTM, thanks.





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

* bug#32863: Unsatisfactory "definition" of "vertical scroll position" in Emacs lisp manual and doc string of window-vscroll
  2018-10-15 18:47         ` Eli Zaretskii
@ 2018-10-15 19:13           ` Alan Mackenzie
  0 siblings, 0 replies; 7+ messages in thread
From: Alan Mackenzie @ 2018-10-15 19:13 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 32863-done

Hello, Eli.

On Mon, Oct 15, 2018 at 21:47:34 +0300, Eli Zaretskii wrote:
> > Date: Mon, 15 Oct 2018 18:33:01 +0000
> > Cc: 32863@debbugs.gnu.org
> > From: Alan Mackenzie <acm@muc.de>

> > OK, amended (final?) version:

> LGTM, thanks.

I've committed it, and I'm closing the bug.

-- 
Alan Mackenzie (Nuremberg, Germany).





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

end of thread, other threads:[~2018-10-15 19:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-28 15:28 bug#32863: Unsatisfactory "definition" of "vertical scroll position" in Emacs lisp manual and doc string of window-vscroll Alan Mackenzie
2018-09-28 21:41 ` Eli Zaretskii
2018-10-15 11:48   ` Alan Mackenzie
2018-10-15 15:32     ` Eli Zaretskii
2018-10-15 18:33       ` Alan Mackenzie
2018-10-15 18:47         ` Eli Zaretskii
2018-10-15 19:13           ` Alan Mackenzie

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.