Subject: bug#1438: 23.0.60; Wrong file/directory completion in *shell* buffers

From: Tassilo Horn <[email-masked]>
Date: Thu, 27 Nov 2008 09:24:38 +0100

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.

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

With ZSH (and maybe some option I'm not aware of) you can go up one
directory by typing ".." as a shorthand for "cd ..".  Now I have this
directory tree.

foo/
foo/bar/
foo/baz/
foo/baz/one/
foo/baz/two/

I invoke `shell' and change to foo/baz/.  Now I type

  cd TAB

and the completion shows one/ and two/.  Now I go up one directory with
"..".  Another

  cd TAB

shows again the completions one/ and two/, but I'm in foo/ (as `pwd'
says) now and the correct completions would be bar/ and baz/.

So it seems `default-directory' is only updated with "cd ..", but not
for the shorthand "..".

The same applies if I have an alias xxx="cd foo/bar/baz".  Then

  xxx RET
  cd TAB

will print the completions for the directory I was before.

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.0.60/etc/DEBUG for instructions.

In GNU Emacs 23.0.60.1 (x86_64-pc-linux-gnu, GTK+ Version 2.14.4)
 of 2008-11-25 on thinkpad
Windowing system distributor `The X.Org Foundation', version 11.0.10502000
configured using `configure  '--prefix=/usr' '--host=x86_64-pc-linux-gnu' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--datadir=/usr/share' '--sysconfdir=/etc' '--localstatedir=/var/lib' '--libdir=/usr/lib64' '--program-suffix=-emacs-23' '--infodir=/usr/share/info/emacs-23' '--with-sound' '--with-x' '--with-toolkit-scroll-bars' '--with-gif' '--with-jpeg' '--with-png' '--with-rsvg' '--with-tiff' '--with-xpm' '--with-freetype' '--with-xft' '--with-libotf' '--with-m17n-flt' '--with-x-toolkit=gtk' '--without-hesiod' '--without-kerberos' '--without-kerberos5' '--with-gpm' '--with-dbus' '--build=x86_64-pc-linux-gnu' 'build_alias=x86_64-pc-linux-gnu' 'host_alias=x86_64-pc-linux-gnu' 'CFLAGS=-g -ggdb -O1 -pipe' 'LDFLAGS=''

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: Group

Minor modes in effect:
  gnus-topic-mode: t
  gnus-undo-mode: t
  rcirc-track-minor-mode: t
  yas/minor-mode: t
  shell-dirtrack-mode: t
  recentf-mode: t
  iswitchb-mode: t
  window-number-meta-mode: t
  window-number-mode: t
  savehist-mode: t
  exec-abbrev-cmd-mode: t
  show-paren-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<backspace> <backspace> <backspace> <backspace> b r 
i c h t SPC s i e SPC d a n n SPC w i e d e r SPC i 
m <backspace> <backspace> u m . . . <up> <up> <up> 
<up> <up> C-k C-k C-k C-k C-k C-k C-k C-k <return> 
g <tab> C-c C-c q <return> c <return> c <return> SPC 
SPC SPC SPC SPC c <return> <return> B <backspace> y 
q l s 1 g C-c s . . <return> . . <return> c d SPC j 
g r <tab> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> p w d <return> 
l s <return> c d SPC j g <tab> <tab> <tab> r <tab> 
<tab> <tab> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> . . <return> c d SPC <tab> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> p w d <return> 
~ <return> c d SPC u n <tab> <tab> <tab> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <tab> 
<tab> c d SPC <tab> <tab> <tab> <tab> <tab> <tab> . 
<tab> <return> C-x k <return> C-c s c d SPC u n <tab> 
r <tab> j g r <tab> <return> <escape> <escape> <escape> 
. . <return> c d SPC <tab> <tab> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> c d SPC j g r a l a b <return> 
c d SPC <tab> <tab> <tab> <tab> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> l s <return> <escape> <escape> <escape> 
c d SPC <tab> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> a n t <return> 
<switch-frame> M-x r e b <return> r p o r <tab> <backspace> 
<backspace> <backspace> e p o <tab> <return>

Recent messages:
Completed [2 times]
Partially completed
~/uni/repos/jgralab 
Type space to flush; repeat completion command to scroll
call-interactively: Text is read-only [6 times]
Type space to flush; repeat completion command to scroll
call-interactively: Text is read-only [5 times]
Type space to flush; repeat completion command to scroll
call-interactively: Text is read-only [4 times]
call-interactively: End of buffer [8 times]

-- 
No person,  no idea, and no  religion deserves to be  illegal to insult,
not even the Church of Emacs. (Richard M. Stallman)