unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* set-window-start
@ 2004-07-15  2:02 Luc Teirlinck
  2004-07-15  7:07 ` set-window-start Lars Hansen
  2004-07-16  6:54 ` set-window-start Richard Stallman
  0 siblings, 2 replies; 6+ messages in thread
From: Luc Teirlinck @ 2004-07-15  2:02 UTC (permalink / raw)


There has been an undocumented change in the behavior of
`set-window-start' since Emacs 20.7.

In Emacs 20.7, (set-window-start WINDOW POS) makes POS the window
start, as documented.  In current CVS and in 21.3, it makes the window
start either at the _beginning_ of the line POS is on, _or_ at the
beginning of the _next_ line, according to rules that are not clear.

Is that change intentional (and just needs to be properly documented),
or a bug?

As an illustration, look at the example taken from (elisp)Window Start:

     For example, if point is 1 and you set the start of the window
     to 2, then point would be "above" the top of the window.  The
     display routines will automatically move point if it is still 1
     when redisplay occurs.  Here is an example:

          ;; Here is what `foo' looks like before executing
          ;;   the `set-window-start' expression.

          ---------- Buffer: foo ----------
          -!-This is the contents of buffer foo.
          2
          3
          4
          5
          6
          ---------- Buffer: foo ----------

          (set-window-start
           (selected-window)
           (1+ (window-start)))
          => 2

          ;; Here is what `foo' looks like after executing
          ;;   the `set-window-start' expression.
          ---------- Buffer: foo ----------
          his is the contents of buffer foo.
          2
          3
          -!-4
          5
          6
          ---------- Buffer: foo ----------

This example works as described in Emacs 20.7.  In current CVS (and in
21.3), `set-window-start' still returns 2, but the window still starts at 1
(and point does not move).

The behavior is even weirder in the next example:

This is the contents of buffer foo.
12345
2
3
4
5
6

With point anywhere on the line 12345, _except_ on the "5":

(set-window-start (selected-window) (point))

makes the window start at the beginning of that line, but on the "5",
it makes it start at the beginning of the _next_ line.

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

end of thread, other threads:[~2004-07-18  7:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-15  2:02 set-window-start Luc Teirlinck
2004-07-15  7:07 ` set-window-start Lars Hansen
2004-07-16  6:54 ` set-window-start Richard Stallman
2004-07-16 17:26   ` set-window-start Kevin Rodgers
2004-07-16 20:03     ` set-window-start Luc Teirlinck
2004-07-18  7:18     ` set-window-start Richard Stallman

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).