Index: ChangeLog =================================================================== RCS file: /cygdrive/K/data/version-control/cvsroot/emacs/gnu-emacs/lisp/ChangeLog,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -u -IId: -b -w -r1.1.1.1 -r1.1.1.1.2.1 --- ChangeLog 2000/12/10 19:53:54 1.1.1.1 +++ ChangeLog 2000/12/13 23:27:35 1.1.1.1.2.1 @@ -1,3 +1,21 @@ +2000-12-14 Thu Jari Aalto + + * dirtrack.el (dirtrack): Call `dirtrack-path-to-standard' + (dirtrack-path-to-standard): New. When running Cygwin inside + NTEmacs, the ptah name can be //c/temp or /cygdrive/d/temp. This + function converts them to understandable c:/temp which can + be tested with `file-accessible-directory-p' in function + `dirtrack' + + * comint.el (comint-directory-sep-char): New. + Added w32 support for completing directorynames with \ + in the comint shell buffer when `comint-completion-addsuffix' + was set to true. + (comint-dynamic-complete-as-filename): Call ´comint-directory-sep-char' + to find out the + (comint-dos-shell-file-name-regexp): New. Regexp to match + sos based shell named like cmd.*\\.exe + 2000-02-26 Gerd Moellmann * Version 20.6 released. Index: comint.el =================================================================== RCS file: /cygdrive/K/data/version-control/cvsroot/emacs/gnu-emacs/lisp/comint.el,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -u -IId: -b -w -r1.1.1.1 -r1.1.1.1.2.1 --- comint.el 2000/12/10 19:53:54 1.1.1.1 +++ comint.el 2000/12/13 23:27:35 1.1.1.1.2.1 @@ -361,6 +361,10 @@ (defvar comint-mode-map nil) +(defvar comint-dos-shell-file-name-regexp "cmd.*\\.exe$" + "*Regexp to match a dos based shell filename in `shell-file-name'. +This affects the choice between \ and / in the directory completions.") + (defvar comint-ptyp t "Non-nil if communications via pty; false if by pipe. Buffer local. This is to work around a bug in Emacs process signaling.") @@ -2131,6 +2135,18 @@ (message "Completing file name...")) (comint-dynamic-complete-as-filename))) +(defun comint-directory-sep-char () + "Return appropriate `directory-sep-char' which see. +The value depends on the current value of `shell-file-name'. +If this is cmd.*exe, then suppose w32 type dos shell." + ;; The shel may also be Vygwin based bash.exe, but for + ;; cmd.exe, cmdproxy.exe and the like, the separatr must be \ + (if (string-match comint-dos-shell-file-name-regexp + (or shell-file-name "")) + ?\\ + ?/)) + + (defun comint-dynamic-complete-as-filename () "Dynamically complete at point as a filename. See `comint-dynamic-complete-filename'. Returns t if successful." @@ -2145,7 +2161,7 @@ (dirsuffix (cond ((not comint-completion-addsuffix) "") ((not (consp comint-completion-addsuffix)) - (char-to-string directory-sep-char)) + (char-to-string (comint-directory-sep-char))) (t (car comint-completion-addsuffix)))) (filesuffix (cond ((not comint-completion-addsuffix) Index: dirtrack.el =================================================================== RCS file: /cygdrive/K/data/version-control/cvsroot/emacs/gnu-emacs/lisp/dirtrack.el,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -u -IId: -b -w -r1.1.1.1 -r1.1.1.1.2.1 --- dirtrack.el 2000/12/10 19:53:54 1.1.1.1 +++ dirtrack.el 2000/12/13 23:27:35 1.1.1.1.2.1 @@ -256,6 +256,14 @@ (set-buffer buf) )) +(defun dirtrack-path-to-standard (path) + "Convert cygwin-like //c/temp or /cygdrive/d/temp path to +dos notation c:/temp." + (if (or (string-match "//\\(.\\)\\(.*\\)" path) + (string-match "/cygdrive/\\(.\\)\\(.*\\)" path)) + (concat (match-string 1 path) ":" (match-string 2 path)) + path)) + ;;;###autoload (defun dirtrack (input) "Determine the current directory by scanning the process output for a prompt. @@ -271,7 +279,8 @@ " (if (null dirtrackp) nil - (let (prompt-path + (let (prompt-path1 + prompt-path matched (current-dir default-directory) (dirtrack-regexp (nth 0 dirtrack-list)) @@ -298,15 +307,16 @@ (and dirtrack-debug (dirtrack-debug-message "Match is empty string")) ;; Transform prompts into canonical forms - (setq prompt-path (funcall dirtrack-directory-function + (setq prompt-path1 (funcall dirtrack-directory-function prompt-path)) + (setq prompt-path (dirtrack-path-to-standard prompt-path1)) (setq current-dir (funcall dirtrack-canonicalize-function current-dir)) (and dirtrack-debug (dirtrack-debug-message (format - "Prompt is %s\nCurrent directory is %s" - prompt-path current-dir))) + "Prompt is %s -> %s\nCurrent directory is %s" + prompt-path1 prompt-path current-dir))) ;; Compare them (if (or (string= current-dir prompt-path) (string= current-dir