all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Chong Yidong <cyd@stupidchicken.com>,
	Harald Hanche-Olsen <hanche@math.ntnu.no>,
	emacs-devel@gnu.org
Subject: Re: window-point oddity
Date: Tue, 08 Feb 2011 09:03:07 +0100	[thread overview]
Message-ID: <4D50F8BB.5050703@gmx.at> (raw)
In-Reply-To: <jwvsjw5yc0n.fsf-monnier+emacs@gnu.org>

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

 > You probably activated some code that ended up triggering this
 > anomalous behavior.  But without more info, it's difficult to guess what
 > that might be.

With a one-window frame showing a buffer containing at least one
character do M-x foo with the following function:

(defun foo ()
   (interactive)
   (let ((window (split-window)))
     (set-window-point window (point-max)))
   (set-window-point (selected-window) (point-min))
   (save-window-excursion
     (set-window-buffer
      (selected-window) (get-buffer-create "*foo*"))))

It moves the cursor in _both_ windows to `point-max' while it should
remain at `point-min' in the upper window.  This is due to the recent
inhibit point swapping "fix" which fails when the selected window does
not change.  A fix like the attached works here and should be installed
on Emacs 23 before the release.

martin

[-- Attachment #2: window.c.diff --]
[-- Type: text/plain, Size: 461 bytes --]

*** c:/window-old.c	2011-02-08 08:47:28.000000000 +0100
--- c:/window-new.c	2011-02-08 08:48:40.234375000 +0100
***************
*** 3517,3523 ****
        record_buffer (w->buffer);
      }
  
!   if (EQ (window, selected_window))
      return window;
  
    sf = SELECTED_FRAME ();
--- 3517,3523 ----
        record_buffer (w->buffer);
      }
  
!   if (EQ (window, selected_window) && !inhibit_point_swap)
      return window;
  
    sf = SELECTED_FRAME ();

  reply	other threads:[~2011-02-08  8:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-02 22:34 window-point oddity Harald Hanche-Olsen
2011-02-02 23:22 ` Dan Davison
2011-02-03  6:29   ` Harald Hanche-Olsen
2011-02-03 10:39     ` Harald Hanche-Olsen
2011-02-03  4:22 ` Michael Welsh Duggan
2011-02-03  4:32 ` Stefan Monnier
2011-02-08  8:03   ` martin rudalics [this message]
2011-02-08 19:46     ` Stefan Monnier
2011-02-09  0:11       ` Chong Yidong

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=4D50F8BB.5050703@gmx.at \
    --to=rudalics@gmx.at \
    --cc=cyd@stupidchicken.com \
    --cc=emacs-devel@gnu.org \
    --cc=hanche@math.ntnu.no \
    --cc=monnier@iro.umontreal.ca \
    /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.