Hello, Ed!
Spaces in file names make LOTS of troubles for current shell support in XEmacs.
May be you would be pleased to know that GNU Emacs is in trouble too :))
XEmacs tries to simulate changes of directory in shell by parsing shell
commands and trying to predict the new directory and directory stack. The
working engine is `shell-directory-tracker' that uses `comint-arguments' to
parse.
The patch below is a quick-wrong patch that solves the problem with TAB
completion for `cd' command. Still lots of problems with spaces in
file names remain.
Another problem is with quotes around directory name. For example,
c:
cd \
cd "Program Files"
XEmacs does not understand that after the last command the working directory is
c:\Program Files\. Reason is that `comint-arguments' does not strip quotes
from extracted arguments.
Nick.
--- /c/Program Files/XEmacs/xemacs-packages/lisp/xemacs-base/shell.el 2003-07-30
18:41:42.000000000 +0400
+++ /c/tmp/shell.el 2003-07-30 18:59:19.000000000 +0400
@@ -684,7 +684,12 @@
((string-match (concat "\\`\\(" shell-cd-regexp
"\\)\\($\\|[ \t]\\)")
cmd)
- (shell-process-cd (comint-substitute-in-file-name arg1)))
+ (shell-process-cd
+ (if (not (eq system-type 'windows-nt))
+ (comint-substitute-in-file-name arg1)
+ ;; On Windows-NT CHDIR does not treat spaces as delimiters
+ (setq arg1 (comint-arguments (substring str start end) 1 nil))
+ )))
((and shell-chdrive-regexp
(string-match (concat "\\`\\(" shell-chdrive-regexp
"\\)\\($\\|[ \t]\\)")
intro: "EA" == Ed Avis <Ed.Avis(a)kbcfp.com> writes:
EA> ================================================================ Dear Bug
EA> Team!
EA> I installed a prebuilt binary of XEmacs for Windows using the Net
EA> Installer (linked from the
xemacs.org site) and installed all packages.
EA> I can start M-x shell to create a shell buffer running the Windows
EA> command prompt cmd.exe. In that buffer pressing Tab normally completes a
EA> filename. But this does not work when the directory name before Tab
EA> contains spaces.
EA> To reproduce:
EA> - Install XEmacs in c:\program files\xemacs
EA> - Start XEmacs
EA> - M-x shell
EA> - c : RET
EA> - c d \ RET
EA> - (Prompt now says 'C:\>'.)
EA> - c d SPC p r o TAB
EA> - (Filename completes to 'program Files\'.)
EA> - RET
EA> - (Prompt now says 'C:\Program Files>'.)
EA> - c d SPC x e m TAB
EA> - (Status line says 'No completions of xem'.)
EA> Expected behaviour: 'xem' would be completed to 'xemacs\' since
the
EA> directory c:\program files\xemacs exists.
EA> Tab completion seems to work as normal inside directories which do not
EA> have spaces in their names.
EA> A similar completion problem happens outside shell buffers, when trying
EA> to visit a file with C-x C-f. I can tab-complete successfully only
EA> inside directories which do not have spaces in the name.
EA> ================================================================
EA> System Info to help track down your bug:
EA> ---------------------------------------
EA> OS version:
EA> Microsoft Windows 2000 [Version 5.00.2195] OS: Windows_NT
EA> XEmacs 21.4.13 "Rational FORTRAN" configured for `i586-pc-win32'.
EA> Building XEmacs in "d:\\xemacs\\xemacs-21.4-release\\nt". Using
compiler
EA> "cl -nologo -W3 -O2 -G5 -ML". Installing XEmacs in "c:\\Program
EA> Files\\XEmacs\\XEmacs-21.4.13". Package path is
"~\\.xemacs;;c:\\Program
EA> Files\\XEmacs\\site-packages;c:\\Program Files\\XEmacs\\xemacs-packages".
EA> Compiling in support for Microsoft Windows native GUI. Compiling in
EA> support for XPM images. Compiling in support for GIF images. Compiling
EA> in support for PNG images. Compiling in support for TIFF images.
EA> Compiling in support for JPEG images. Compiling in support for X-Face
EA> message headers. Compiling in support for toolbars. Compiling in
EA> support for dialogs. Compiling in support for widgets. Compiling in
EA> support for native sounds. Compiling in fast dired implementation.
EA> Using portable dumper.
EA> Load-Path Lisp Shadows: ---------------------- (c:\Program
EA> Files\XEmacs\xemacs-packages\lisp\build\build-report c:\Program
EA> Files\XEmacs\XEmacs-21.4.13\lisp\build-report)
EA> Installed XEmacs Packages: -------------------------
EA> ((zenirc:version 1.13 :type regular) (xslt-process :version 1.11 :type
EA> regular) (xslide :version 1.07 :type regular) (xemacs-devel :version 1.55
EA> :type single-file) (xemacs-base :version 1.78 :type regular) (x-symbol
EA> :version 1.05 :type regular) (w3 :version 1.28 :type regular) (vm
EA> :version 7.14 :type regular) (viper :version 1.36 :type regular)
EA> (view-process :version 1.12 :type regular) (vhdl :version 1.17 :type
EA> regular) (vc-cc :version 1.21 :type regular) (vc :version 1.37 :type
EA> regular) (tramp :version 1.15 :type regular) (tpu :version 1.12 :type
EA> regular) (tooltalk :version 1.13 :type regular) (tm :version 1.36 :type
EA> regular) (time :version 1.13 :type regular) (textools :version 1.14 :type
EA> regular) (text-modes :version 1.61 :type single-file) (texinfo :version
EA> 1.24 :type regular) (supercite :version 1.19 :type regular) (strokes
EA> :version 1.08 :type regular) (speedbar :version 1.26 :type regular)
EA> (sounds-wav :version 1.1 :type regular) (sounds-au :version 1.1 :type
EA> regular) (sml-mode :version 0.09 :type regular) (slider :version 1.13
EA> :type regular) (sieve :version 1.13 :type regular) (sh-script :version
EA> 1.17 :type regular) (sgml :version 1.08 :type regular) (semantic :version
EA> 1.17 :type regular) (scheme :version 1.13 :type regular) (sasl :version
EA> 1.13 :type regular) (ruby-modes :version 1.01 :type regular) (rmail
EA> :version 1.13 :type regular) (reftex :version 1.28 :type regular)
EA> (python-modes :version 1.02 :type single-file) (psgml-dtds :version 1.02
EA> :type regular) (psgml :version 1.4 :type regular) (ps-print :version 1.08
EA> :type regular) (prog-modes :version 1 .79 :type single-file) (pgg
EA> :version 1.03 :type regular) (perl-modes :version 1.04 :type single-file)
EA> (pcomplete :version 1.02 :type regular) (pcl-cvs :version 1.64 :type
EA> regular) (pc :version 1.25 :type single-file) (os-utils :version 1.31
EA> :type single-file) (ocaml :version 0.04 :type regular) (net-utils
EA> :version 1.32 :type single-file) (mmm-mode :version 1.0 :type regular)
EA> (misc-games :version 1.16 :type single-file) (mine :version 1.14 :type
EA> regular) (mh-e :version 1.23 :type regular) (mew :version 1.17 :type
EA> regular) (mailcrypt :version 2.12 :type regular) (mail-lib :version 1.59
EA> :type regular) (liece :version 1.12 :type regular) (jde :version 1.45
EA> :type regular) (ispell :version 1.24 :type regular) (ilisp :version 1.32
EA> :type regular) (igrep :version 1.1 :type regular) (idlwave :version 1.28
EA> :type regular) (ibuffer :version 1.08 :type regular) (hm--html-menus
EA> :version 1.21 :type regular) (haskell-mode :version 1.05 :type regular)
EA> (gnus :version 1.71 :type regular) (gnats :version 1.15 :type regular)
EA> (games :version 1.14 :type regular) (fsf-compat :version 1.12 :type
EA> single-file) (frame-icon :version 1.09 :type regular) (fortran-modes
EA> :version 1.02 :type single-file) (forms :version 1.14 :type regular)
EA> (footnote :version 1.15 :type regular) (eudc :version 1.38 :type regular)
EA> (eterm :version 1.13 :type regular) (ess :version 1.04 :type regular)
EA> (eshell :version 1.05 :type regular) (emerge :version 1.09 :type regular)
EA> (elib :version 1.1 :type single-file) (eieio :version 1.04 :type regular)
EA> (efs :version 1.29 :type regular) (edt :version 1.12 :type regular)
EA> (edit-utils :version 2.02 :type single-file) (ediff :version 1.47 :type
EA> regular) (edebug :version 1.18 :type regular) (ecrypto :version 0.13
EA> :type regular) (ecb :version 1.08 :type regular) (docbookide :version
EA> 0.06 :type regular) (dired :version 1.13 :type regular) (dictionary
EA> :version 1.12 :type regular) (debug :version 1.16 :type regular) (crisp
EA> :version 1.12 :type regular) (cookie :version 1.14 :type regular)
EA> (clearcase :version 1.06 :type regular) (cc-mode :version 1.33 :type
EA> regular) (calendar :version 1.19 :type regular) (calc :version 1.23 :type
EA> regular) (c-support :version 1.16 :type single-file) (build :version 1.1
EA> :type regular) (bbdb :version 1.23 :type regular) (auctex :version 1.35
EA> :type regular) (apel :version 1.26 :type regular) (ada :version 1.13
EA> :type regular) (Sun :version 1.13 :type regular))
EA> Features: --------
EA> (mail-abbrevs info xemacsbug shadow sendmail rfc822 efs-cu shell comint
EA> ring cus-face zenirc-autoloads xslt-process-autoloads xslide-autoloads
EA> xemacs-devel-autoloads xemacs-base-autoloads x-symbol-autoloads
EA> w3-autoloads vm-autoloads viper-autoloads view-process-autoloads
EA> vhdl-autoloads vc-cc-autoloads vc-autoloads tramp-autoloads tpu-autoloads
EA> tooltalk-autoloads tm-autoloads time-autoloads textools-autoloads
EA> text-modes-autoloads texinfo-autoloads supercite-autoloads
EA> strokes-autoloads speedbar-autoloads sounds-wav-autoloads
EA> sounds-au-autoloads sml-mode-autoloads slider-autoloads sieve-autoloads
EA> sh-script-autoloads sgml-autoloads semantic-autoloads scheme-autoloads
EA> sasl-autoloads ruby-modes-autoloads rmail-autoloads reftex-autoloads
EA> python-modes-autoloads psgml-dtds-autoloads psgml-autoloads
EA> ps-print-autoloads prog-modes-autoloads pgg-autoloads
EA> perl-modes-autoloads pcomplete-autoloads pcl-cvs-autoloads pc-autoloads
EA> os-utils-autoloads ocaml-autoloads net-utils-autoloads mmm-mode-autoloads
EA> misc-games-autoloads mine-autoloads mh-e-autoloads mew-autoloads
EA> mailcrypt-autoloads mail-lib-autoloads liece-autoloads jde-autoloads
EA> ispell-autoloads ilisp-autoloads igrep-autoloads idlwave-autoloads
EA> ibuffer-autoloads hm--html-menus-autoloads haskell-mode-autoloads
EA> gnus-autoloads gnats-autoloads games-autoloads fsf-compat-autoloads
EA> frame-icon-autoloads fortran-modes-autoloads forms-autoloads
EA> footnote-autoloads eudc-autoloads eterm-autoloads ess-autoloads
EA> eshell-autoloads emerge-autoloads elib-autoloads eieio-autoloads
EA> efs-autoloads edt-autoloads edit-utils-autoloads ediff-autoloads
EA> edebug-autoloads ecrypto-autoloads ecb-autoloads docbookide-autoloads
EA> dired-autoloads dictionary-autoloads debug-autoloads crisp-autoloads
EA> cookie-autoloads clearcase-autoloads cc-mode-autoloads calendar-autoloads
EA> calc-autoloads c-support-autoloads build-autoloads bbdb-autoloads
EA> auctex-autoloads apel-autoloads ada-autoloads Sun-autoloads
EA> lisp-autoloads loadhist auto-show fontl-hooks code-cmds gutter-items
EA> menubar-items x-menubar dragdrop mode-motion mouse itimer auto-save
EA> lisp-mode easymenu iso8859-1 page buff-menu lib-complete help-nomule
EA> cus-file derived frame text-props obsolete cus-start custom widget
EA> cl-extra mini-cl cl cl-19 packages backquote very-early-lisp file-coding
EA> mswindows-scrollbars mswindows toolbar native-sound scrollbar
EA> network-streams subprocesses menu-accelerator-support menubar md5 xemacs
EA> gutter tiff png gif jpeg xface xpm xbm lisp-float-type windows-nt
EA> dragdrop-api dialog devices window-system base64)
EA> Recent keystrokes: -----------------
EA> \ P r o g TAB TAB X e TAB TAB TAB TAB BS TAB TAB BS x e TAB TAB TAB C-a
EA> C-k c d SPC BS BS BS M-x r e p
EA> o r t - x e SPC b SPC C-g M-x r e p o SPC t BS r t
EA> SPC SPC x SPC SPC SPC RET C-x k RET M-x up BS BS BS BS SPC RET C-v M-x e
EA> m a c s SPC v SPC RET C-g M-x r e p r BS o r t SPC SPC x e SPC SPC RET
EA> Recent messages (most recent first): -----------------------------------
EA> Making completion list... Quit XEmacs 21.4 (patch 13) "Rational
FORTRAN"
EA> [Lucid] (i586-pc-win32) of Sun May 25 2003 on TSUNAMI Loading info...done
EA> Loading info... Making completion list... Making completion list...
EA> Quit No completions of Files\xe Completing file name... No completions
EA> of Files\xe Completing file name... No completions of Files\xe
EA> Completing file name... No completions of Files\X Completing file
EA> name... No completions of Files\X Completing file name... No
EA> completions of Files\Xe Completing file name...