emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

shell-mode does not like square brackets in file names


From: Gaute B Strokkenes
Subject: shell-mode does not like square brackets in file names
Date: Mon, 27 Oct 2003 09:25:28 +0100
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)

This bug report will be sent to the Free Software Foundation,
not to your local site managers!
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 address@hidden mailing list.

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


In a shell buffer, say:

  address@hidden:~$ touch frob[a]
  address@hidden:~$ touch frob[b]

Now say

  address@hidden:~$ ls -l frob

_without_ hitting <RET>, and hit <TAB> to have shell-mode
autocomplete for you.  You get:

  address@hidden:~$ ls -l frob[

Now type `a' and then hit <TAB>.  The expected behaviour would be for
emacs to complete that to:

  address@hidden:~$ ls -l frob[a]

But that doesn't happen.  Instead, I get a completion buffer with a
list of all the files in the current directory that start with an `a'.

The interesting thing is that if I go back and escape the `[':

  address@hidden:~$ ls -l frob\[a

Then emacs has no trouble autocompleting this to:

  address@hidden:~$ ls -l frob\[a]
  -rw-r--r--    1 gs234    gs234           0 2003-10-27 09:07 frob[a]

Note that the shell:

  address@hidden:~$ bash --version
  GNU bash, version 2.05b.0(1)-release (i386-pc-linux-gnu)
  Copyright (C) 2002 Free Software Foundation, Inc.

has not problem dealing with square brackets, unescaped or not (as the
above stanza shows).

When I try to complete

  address@hidden:~$ ls -l frob

in an xterm, bash will expand that to:

  address@hidden:~$ ls -l frob\[

and when I hit <TAB> again bash correctly gives me the choice between
frob[a] and frob[b].

Thus I think that shell-mode should escape square brackets as it
inserts them as part of completed filenames, and preferably it should
be smarter about unescaped square brackets in the portion that was
type by the user before hitting <TAB>.

In GNU Emacs 21.3.50.6 (i686-pc-linux-gnu, GTK+ Version 2.2.4)
 of 2003-10-26 on belldandy
configured using `configure '--prefix' '/usr/local/sandbox/emacs/' '--with-gtk''

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: no_NO.UTF-8
  locale-coding-system: utf-8
  default-enable-multibyte-characters: t

Major mode: Shell

Minor modes in effect:
  display-time-mode: t
  auto-compression-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  unify-8859-on-decoding-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  line-number-mode: t

Recent input:
r m <return> <C-up> <left> <backspace> a <return> t 
o u c h SPC X X [ a ] <return> t o u c h SPC X X [ 
b ] <return> l SPC X X <tab> <tab> a <tab> <tab> <left> 
<left> \ C-e <tab> C-a C-k C-x 1 C-d C-x k <return> 
M-x s h e l l <return> c d <return> M-x e m a c s - 
b u g <return> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> r e p <tab> o <tab> r <tab> 
e m <backspace> <tab> <backspace> <tab> <return>

Recent messages:
Completing file name...
Partially completed
Completing file name...
Type space to flush; repeat completion command to scroll
Completing file name... [2 times]
Completed
~ 
call-interactively: Text is read-only
Making completion list... [2 times]
Loading emacsbug...done

-- 
Gaute Strokkenes                        http://www.srcf.ucam.org/~gs234/
All this time I've been VIEWING a RUSSIAN MIDGET SODOMIZE a HOUSECAT!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]