Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!decvax!harpo!seismo!hao!hplabs!sri-unix!thomas%UTAH-GR@utah-cs From: thomas%UTAH-GR@utah-cs@sri-unix.UUCP Newsgroups: net.emacs Subject: Emacs pops temp buffers into windows randomly: Fix. Message-ID: <3919@sri-arpa.UUCP> Date: Sat, 6-Aug-83 07:16:00 EDT Article-I.D.: sri-arpa.3919 Posted: Sat Aug 6 07:16:00 1983 Date-Received: Sun, 7-Aug-83 17:35:42 EDT Lines: 40 From: Spencer W. Thomas Do the following, assuming buffer "bar" does not exist: (start-process "loadst 2" "foo") M-x execute-mlisp-line (progn (temp-use-buffer "bar") (get-tty-character)) After a couple of seconds, the buffer "bar" should pop up on the screen. The problem is that stuff_buffer is putting a window on the current buffer if it is invoked "interactively", without checking to see if that buffer was in a window to begin with. Here is a fix (line numbers will be WAY off): *** 374,377 { struct buffer *old_buffer = bf_cur; #ifdef HalfBaked --- 377,381 ----- { struct buffer *old_buffer = bf_cur; + int old_buffer_is_visible = wn_cur->w_buf == bf_cur; #ifdef HalfBaked *************** *** 392,396 DoDsp (1); SetBfp (old_buffer); ! if (interactive) WindowOn (bf_cur); } --- 396,400 ----- DoDsp (1); SetBfp (old_buffer); ! if (interactive && old_buffer_is_visible) WindowOn (bf_cur); } =Spencer