Subject: bug#22221: 25.0.50; shell cmd with >8 lines complains not-this-window is void

From: Mike Kupfer <[email-masked]>
Date: Mon, 21 Dec 2015 18:15:24 -0800

>From "emacs -Q", if I set debug-on-error to t and then do

  M-! head -9 ~/.profile RET

I get

Debugger entered--Lisp error: (void-variable not-this-window)
  display-message-or-buffer(#<buffer *Shell Command Output*>)
  #[0 "r\302q\210\301\242\204
\305\202(\301\242;\203\306\307\301\242\"\202(\301\242\310\232?\205(\306\311\301\242\")r\302q\210deV)\2039\312\302!\207\300\203Y\310\313\314\300!8W\203Y\306\315\f\203T\306\316\f\"\202U\317\"\202Z\320\301\242\204e\321\322!\202\207\301\242\310\232\203s\321\323\"\202\207\301\242;\203\201\321\324\301\242\"\202\207\321\325\301\242#\207" [nil (0) #<buffer *Shell Command Output*> mode-line-process shell-command-default-error-buffer " - Error" format " - Signal [%s]" 0 " - Exit [%d]" display-message-or-buffer 7 file-attributes "some error output%s" " to the \"%s\" buffer" "" "no output" message "(Shell command failed with error)" "(Shell command succeeded with %s)" "(Shell command killed by signal %s)" "(Shell command failed with code %d and %s)"] 5]()
  shell-command-on-region(192 192 "head -9 ~/.profile" nil nil nil)
  shell-command("head -9 ~/.profile" nil nil)
  funcall-interactively(shell-command "head -9 ~/.profile" nil nil)
  call-interactively(shell-command nil nil)
  command-execute(shell-command)

If I use -8 instead of -9, I get the output that I expect.

In GNU Emacs 25.0.50.4 (x86_64-unknown-linux-gnu, X toolkit, Xaw scroll bars)
 of 2015-12-21
Repository revision: 33efb6d60614131e1504b29885bf8b82f7c1b3cb
Windowing system distributor 'The X.Org Foundation', version 11.0.11604000
System Description:	Debian GNU/Linux 8.2 (jessie)

Configured using:
 'configure --prefix=/usr/new/upstream'

Configured features:
XPM JPEG TIFF GIF PNG SOUND NOTIFY LIBXML2 FREETYPE XFT ZLIB
TOOLKIT_SCROLL_BARS LUCID X11

Important settings:
  value of $LC_TIME: C
  value of $LANG: en_US.utf8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  shell-dirtrack-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-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
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:

HOST=`uname -n`; export HOST

# A short check time is okay, since this should only catch
# locally-generated mail.
MAILCHECK=60
export MAILCHECK
Symbol’s value as variable is void: not-this-window
t
Entering debugger...

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message dired 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 help-fns mail-prsvr mail-utils help-mode easymenu cl-loaddefs
pcase cl-lib debug shell pcomplete comint ansi-color ring time-date
mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel x-win term/common-win x-dnd tool-bar dnd fontset
image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese charscript case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote inotify dynamic-setting
font-render-setting x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 85013 8780)
 (symbols 48 19447 0)
 (miscs 40 56 135)
 (strings 32 14675 4669)
 (string-bytes 1 429748)
 (vectors 16 11465)
 (vector-slots 8 420135 4396)
 (floats 8 144 69)
 (intervals 56 236 0)
 (buffers 976 13)
 (heap 1024 10425 1376))