Subject: 24.4; shell-mode: tab completion adds /. to directory, which is not helpful

From: Ed Avis <[email-masked]>
Date: Tue, 30 Jun 2015 13:38:47 +0000

M-x shell
mkdir foo
rmdir foo <TAB> <TAB>

The argument to rmdir is completed to 'foo/.' (which is the initial
substring of 'foo/.' and 'foo/..').

There are not many cases when you really want to include the trailing /.
on a directory name.  Usually just giving the directory is sufficient,
and giving it with a trailing slash is okay.  Emacs could complete the
filename to include the trailing slash, but should not go further to
add the '.' character when the directory is empty.

In particular, 'rmdir foo/.' is an error; see GNU coreutils bug #20835.

Please change the tab completion in shell mode so that directories are
completed to the trailing slash, as foo/, but the special '.' and '..'
subdirectories are not considered for further completion.

In GNU Emacs 24.4.1 (x86_64-redhat-linux-gnu, GTK+ Version 3.10.9)
 of 2014-11-03 on wcl-linux04.wcl.local
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_COLLATE: C
  value of $LC_CTYPE: en_GB.UTF-8
  value of $LC_MESSAGES: en_GB.UTF-8
  value of $LC_MONETARY: en_GB.UTF-8
  value of $LC_NUMERIC: en_GB.UTF-8
  value of $LC_TIME: en_GB.UTF-8
  value of $LANG: en_GB.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Shell

Minor modes in effect:
  diff-auto-refine-mode: t
  shell-dirtrack-mode: t
  tooltip-mode: t
  mouse-wheel-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:
e r ; RET d r o p SPC t a b l e SPC C-x o C-x C-f ~ 
/ t DEL DEL t r a TAB d TAB C-g C-x C-f / h o m TAB 
t r a d i TAB b TAB g h o TAB DEL DEL DEL h o TAB 2 
0 1 5 0 6 0 3 0 1 3 TAB t b d a t a s t r e a m a s 
TAB C-g C-x o t b d a t a s t r e a m a s r e l e a 
s e d ; RET C-x o ESC > g i t SPC C-a C-k r p m SPC 
= - q DEL DEL DEL - q i SPC s q s h RET c d SPC . C-a 
C-k p e r l SPC - E SPC ' $ s t r SPC = SPC " a : b 
" ; SPC p u s h SPC s p l i t ( " : " , SPC $ s t r 
) , SPC 5 ; DEL ' RET ESC p ESC b ESC b ESC b DEL DEL 
DEL DEL DEL C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f 
C-f C-f C-f C-f C-f C-f SPC DEL = SPC DEL SPC DEL DEL 
SPC = ( 5 C-d C-d C-f ) C-e RET g i t SPC p u l l RET 
c d RET l s SPC f o o RET r m d i r SPC f o TAB TAB 
TAB C-a C-k ESC x r e p o r t SPC - e m DEL DEL DEL 
e m a c s SPC b u SPC RET

Recent messages:
Wrote /home/eda/git_working/repos/.git/COMMIT_EDITMSG
Mark set
Quit
Mark set [2 times]
No match
Quit [2 times]
Mark set
~ 
Making completion list...
Complete, but not unique

Load-path shadows:
None found.

Features:
(shadow sort emacsbug sendmail pcmpl-x novice sgml-mode smerge-mode
mail-extr mule-util sql view pcmpl-gnu dired-aux dired etags rect python
json edmacro kmacro log-view help-mode sh-script smie executable
pcmpl-rpm tabify imenu man vc-bzr vc-sccs vc-svn vc-cvs vc-rcs dabbrev
ffap thingatpt url-parse auth-source eieio eieio-core gnus-util
password-cache url-vars cus-edit wid-edit cus-start cus-load perl-mode
diff-mode vc vc-dispatcher vc-git nxml-uchnm rng-xsd xsd-regexp
rng-cmpct rng-nxml rng-valid rng-loc rng-uri rng-parse nxml-parse
rng-match rng-dt rng-util rng-pttrn nxml-ns nxml-mode nxml-outln
nxml-rap nxml-util nxml-glyph nxml-enc xmltok misearch multi-isearch
pcmpl-unix xterm time-date log-edit easy-mmode message format-spec
rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mailabbrev mail-utils
gmm-utils mailheader pcvs-util add-log warnings server csharp-mode
advice help-fns byte-opt bytecomp byte-compile cconv cc-langs cc-mode
cc-fonts easymenu cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine
cc-vars cc-defs zoom-frm frame-cmds frame-fns cl-macs avoid cl gv
cl-loaddefs cl-lib compile shell pcomplete comint ring ansi-color
tooltip electric uniquify 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 prog-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 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 make-network-process
dbusbind gfilenotify dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)

Memory information:
((conses 16 2149314 163635)
 (symbols 48 30430 0)
 (miscs 40 1390 5624)
 (strings 32 72023 17226)
 (string-bytes 1 2507383)
 (vectors 16 37490)
 (vector-slots 8 1568020 210072)
 (floats 8 915 1009)
 (intervals 56 312569 2362)
 (buffers 960 189)
 (heap 1024 95997 7056))

Please ignore autogenerated disclaimer after this point.

This email is intended only for the person to whom it is addressed and may contain confidential information. Any retransmission, copying, disclosure or other use of, this information by persons other than the intended recipient is prohibited. If you received this email in error, please contact the sender and delete the material. This email is for information only and is not intended as an offer or solicitation for the purchase or sale of any financial instrument. Wadhwani Asset Management LLP is a Limited Liability Partnership registered in England (OC303168) with registered office at 40 Berkeley Square, 3rd Floor, London, W1J 5AL. It is authorised and regulated by the Financial Conduct Authority.