Subject: 24.3; scrolling *Completions* window with tab sometimes chooses a wrong window

From: Lukasz Pawelczyk <[email-masked]>
Date: Fri, 28 Feb 2014 17:41:05 +0100

Hi,

Steps to reproduce (this should be reproducible even on 80x25):
1. Use the attached emacs config file
2. C-x C-f: open a long file (lets say a few screens long)
3. C-x 3: split window right
4. C-x o: move to the right window
5. C-x b *scratch*: display the scratch buffer in the new window
6. C-x 2: split the new window below
7. C-x o: move to the lower-right window (it should display scratch buffer
as well)
8. Type "(g" (without quote ofc) and hit TAB, the auto-complete window
should appear on the lower left
9. Hit tab few more times, the upper left window will be scrolled, not the
*Completions* one.

I've attached a file help.txt describing this graphically.

All of this happens because a window that's chosen for displaying a window
for completion is created with 'display-buffer', while the window that is
scrolled with TAB during completion is choosen with a 'other-window'
('scroll-other-window') function. And as shown here those windows are not
always the same.

Exactly the same thing can happen with semantic completion. The
'display-buffer' and 'scroll-other-window' are also used there to the same
effect in this situation.

The workaround is shown in the emacs.el file, force the other window
scrolling to a *Completions* buffer. But this effectively breaks
other-window scrolling for anything else.

In GNU Emacs 24.3.1 (x86_64-redhat-linux-gnu, GTK+ Version 3.9.10)
 of 2013-08-14 on buildvm-17.phx2.fedoraproject.org
Configured using:
 `configure '--build=x86_64-redhat-linux-gnu'
 '--host=x86_64-redhat-linux-gnu' '--program-prefix='
 '--disable-dependency-tracking' '--prefix=/usr' '--exec-prefix=/usr'
 '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc'
 '--datadir=/usr/share' '--includedir=/usr/include'
 '--libdir=/usr/lib64' '--libexecdir=/usr/libexec'
 '--localstatedir=/var' '--sharedstatedir=/var/lib'
 '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--with-dbus'
 '--with-gif' '--with-jpeg' '--with-png' '--with-rsvg' '--with-tiff'
 '--with-xft' '--with-xpm' '--with-x-toolkit=gtk3' '--with-gpm=no'
 'build_alias=x86_64-redhat-linux-gnu'
 'host_alias=x86_64-redhat-linux-gnu' 'CFLAGS=-DMAIL_USE_LOCKF -O2 -g
 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
 -fstack-protector-strong --param=ssp-buffer-size=4
 -grecord-gcc-switches -m64 -mtune=generic' 'LDFLAGS=-Wl,-z,relro ''

Important settings:
  value of $LC_MONETARY: pl_PL.utf8
  value of $LC_NUMERIC: pl_PL.utf8
  value of $LC_TIME: pl_PL.utf8
  value of $LANG: en_US.utf8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
ESC [ > 1 ; 3 4 0 9 ; 0 c ESC x r e p o TAB r TAB
RET

Recent messages:
("emacs")
Loading /usr/share/emacs/site-lisp/site-start.d/cmake-init.el
(source)...done
Loading /usr/share/emacs/site-lisp/site-start.d/desktop-entry-mode-init.el
(source)...done
For information about GNU Emacs and the GNU system, type C-h C-a.
Making completion list...

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils help-mode easymenu time-date buffer-move-autoloads
color-theme-actress-autoloads color-theme-solarized-autoloads
color-theme-autoloads idle-highlight-mode-autoloads point-undo-autoloads
redo+-autoloads rpm-spec-mode-autoloads smart-tabs-mode-autoloads
windresize-autoloads package tooltip ediff-hook vc-hooks lisp-float-type
mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list newcomment lisp-mode register page menu-bar rfn-eshadow
timer select scroll-bar mouse jit-lock font-lock syntax facemenu
font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan
thai tai-viet lao korean japanese hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
make-network-process dbusbind dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)

-- 
Regards
Havner