bug-gnu-emacs
[Top][All Lists]
Advanced

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

select-window doesn't always make that window's buffer current


From: Don Bashford
Subject: select-window doesn't always make that window's buffer current
Date: 02 Jun 2004 11:25:33 -0500


In GNU Emacs 21.2.1 (i386-redhat-linux-gnu, X toolkit, Xaw3d scroll
bars)
 of 2002-04-08 on porky.devel.redhat.com
configured using `configure  i386-redhat-linux --prefix=/usr
--exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin
--sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include
--libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/var
--sharedstatedir=/usr/com --mandir=/usr/share/man
--infodir=/usr/share/info --with-gcc --with-pop --with-sound'
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.iso885915
  locale-coding-system: iso-latin-9
  default-enable-multibyte-characters: t

;; select-window doesn't set the current buffer as expected if
;; current buffer is not the one displayed in the selected window.

(setq a (get-buffer-create "A"))
(setq b (get-buffer-create "B"))

;; Now arrange the frame so A is in one window and B is in another
;; and select B.  Then M-: eval the following:

(progn 
  (set-buffer a) 
  (select-window (get-buffer-window b))
  (current-buffer))

;; the result is #<buffer A>. But the documentation says

;; - Function: select-window window
;;     This function makes WINDOW the selected window.  The cursor then
;;     appears in WINDOW (on redisplay).  The buffer being displayed in
;;     WINDOW is immediately designated the current buffer.

;; so one would expect the return value to be #<buffer B>

;; The initial (set-buffer a), which gets the current-buffer and the
;; selected-window out of sync seems to be needed to trigger this
;; effect.

Emacs 21.3 has the same problem.

-Don







reply via email to

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