Subject: 23.1; emacsclient -t FILE -vs- server-window

From: Tom Tromey <[email-masked]>
Date: Wed, 09 Sep 2009 14:37:59 -0600

Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.

Your bug report will be posted to the [email-masked] mailing list,
and to the gnu.emacs.bug news group.

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

I set server-window in my .emacs:

    (server-start)
    (setq server-window (selected-frame))

Recently I decided to try emacsclient -t.  So I changed my shell
environment to have:

    EDITOR='emacsclient -t'

Then I did a "git commit" in a shell.  This brought up emacsclient in
the terminal, as expected.  However, the commit message buffer was not
displayed.

I looked, and the buffer was shown in server-window.

I wish it was shown in the terminal instead.

I tried setting server-window to a function:

    (setq saved-server-window server-window)
    (setq server-window
          (lambda (buffer)
            (if window-system
                saved-server-window
              (selected-frame))))

However, this did not work either.
(I did not check but I assume that the terminal is not selected when
this is invoked?)

If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
If you would like to further debug the crash, please read the file
/usr/share/emacs/23.1/etc/DEBUG for instructions.

In GNU Emacs 23.1.1 (i386-redhat-linux-gnu, GTK+ Version 2.16.5)
 of 2009-08-26 on x86-2.fedora.phx.redhat.com
Windowing system distributor `The X.Org Foundation', version 11.0.10601901
configured using `configure  '--build=i386-redhat-linux-gnu' '--host=i386-redhat-linux-gnu' '--target=i586-redhat-linux-gnu' '--program-prefix=' '--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=/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=gtk' 'build_alias=i386-redhat-linux-gnu' 'host_alias=i386-redhat-linux-gnu' 'target_alias=i586-redhat-linux-gnu' 'CFLAGS=-DMAIL_USE_LOCKF -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i586 -mtune=generic -fasynchronous-unwind-tables''

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.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Fundamental

Minor modes in effect:
  server-buffer-clients: (server <4>)
  shell-dirtrack-mode: t
  erc-list-mode: t
  erc-menu-mode: t
  erc-autojoin-mode: t
  erc-ring-mode: t
  erc-pcomplete-mode: t
  erc-track-mode: t
  erc-track-minor-mode: t
  erc-match-mode: t
  erc-button-mode: t
  erc-fill-mode: t
  erc-stamp-mode: t
  erc-netsplit-mode: t
  erc-spelling-mode: t
  erc-truncate-mode: t
  diff-auto-refine-mode: t
  erc-status-mode: t
  erc-services-mode: t
  erc-networks-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
. SPC t h a t ' s SPC p r e t t y SPC g o o d <return> 
<f10> C-c b <f10> <f10> <f10> <f10> <f10> <f10> C-z 
n n 2 K i SPC SPC SPC n SPC SPC SPC SPC SPC SPC n C-u 
<return> <return> <return> <return> <return> <return> 
<return> <return> <return> <return> <return> <return> 
C-z o <f10> <f10> <f10> C-z n <switch-frame> <switch-frame> 
C-z o f C-v C-v C-v M-< C-x k <return> d f C-v C-v 
C-v C-v C-v C-x k <return> C-u C-n C-u C-n C-u C-n 
p p f C-v C-x k <return> d C-x b * c o m <tab> <return> 
C-c c M-p <return> n C-c c M-p <return> n M-> <f10> 
<f10> <f10> <f10> <f10> <f10> <f10> <f10> <f10> <f10> 
<f10> M-v M-v M-v M-v M-> C-z n <switch-frame> <help-echo> 
<help-echo> <switch-frame> <help-echo> C-z n <f10> 
<f10> <f10> <f10> <f10> <f10> <f10> M-v C-x b <return> 
C-r s l y C-r C-r C-g C-c b C-v C-v C-v M-> M-< M-> 
C-z o SPC SPC SPC C-z o C-x C-f ~ / g n <tab> b a s 
e <tab> s r <tab> g d <tab> g d b . 1 <tab> <return> 
C-v C-v C-v C-v C-v C-v C-v C-v C-v C-v C-v C-x k <return> 
C-z o SPC SPC SPC > M S-SPC SPC = M-v M-v M-v C-v C-u 
C-n C-u C-n SPC C-z o M-> <f10> <f10> <f10> <f10> <f10> 
<switch-frame> <switch-frame> C-z n ESC [ > 1 ; 2 0 
0 5 ; 0 c <switch-frame> C-x C-b C-x o C-x 1 C-n C-n 
1 C-o I n t r o d u c e SPC <switch-frame> C-x 1 M-x 
r e p o r t - e m <tab> b <tab> <return>

Recent messages:
Mark set
call-interactively: Beginning of buffer [2 times]
Mark set
Quit
Mark set [3 times]
call-interactively: End of buffer
Opening nntp server on news.gmane.org...done
Mark set
Compilation finished
When done with a buffer, type C-x #

Tom