emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: window-point oddity


From: martin rudalics
Subject: Re: window-point oddity
Date: Tue, 08 Feb 2011 09:03:07 +0100
User-agent: Thunderbird 2.0.0.21 (Windows/20090302)

> 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
*** 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 via email to

[Prev in Thread] Current Thread [Next in Thread]