X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fwinnt.el;h=5fe8b40c8475715c35c1033143db40f78f6daa84;hb=cc952c87134f98975102ee428e3c3a9cdb012a7b;hp=9ce0750874e014d793fa3de533fb7859d5728824;hpb=4c0c5d1d054e60fb9ffa3dd9ec1c1d7bb8eedef0;p=chise%2Fxemacs-chise.git- diff --git a/lisp/winnt.el b/lisp/winnt.el index 9ce0750..5fe8b40 100644 --- a/lisp/winnt.el +++ b/lisp/winnt.el @@ -1,4 +1,4 @@ -;;; winnt.el --- Lisp routines for Windows NT. +;;; winnt.el --- Lisp routines for MS Windows. ;; Copyright (C) 1994 Free Software Foundation, Inc. @@ -39,11 +39,14 @@ ;; #### Oh if we had an alist of shells and their command switches. (setq shell-command-switch "/c") -;; For appending suffixes to directories and files in shell completions. -(defun nt-shell-mode-hook () - (setq comint-completion-addsuffix '("\\" . " ") - comint-process-echoes t)) -(add-hook 'shell-mode-hook 'nt-shell-mode-hook) +;; For appending suffixes to directories and files in shell +;; completions. This screws up cygwin users so we leave it out for +;; now. Uncomment this if you only ever want to use cmd. + +;(defun nt-shell-mode-hook () +; (setq comint-completion-addsuffix '("\\" . " ") +; comint-process-echoes t)) +;(add-hook 'shell-mode-hook 'nt-shell-mode-hook) ;; Use ";" instead of ":" as a path separator (from files.el). (setq path-separator ";") @@ -82,56 +85,4 @@ See also `auto-save-file-name-p'." (setq start (1+ (match-end 0)))) name)) -;;---------------------------------------------------------------------- -;; Quoting process args -;;-------------------- - -(defun nt-quote-args-verbatim (args) - "Copy ARG list verbatim, separating each arg with space." - (mapconcat #'identity args " ")) - -(defun nt-quote-args-prefix-quote (prefix args) - (mapconcat (lambda (str) - (concat "\"" - (mapconcat (lambda (ch) - (concat (if (eq ch ?\") prefix) - (char-to-string ch))) - str nil) - "\"")) - args " ")) - -(defun nt-quote-args-backslash-quote (args) - "Place ARG list in quotes, prefixing quotes in args with backslashes." - (nt-quote-args-prefix-quote "\\" args)) - -(defun nt-quote-args-double-quote (args) - "Place ARG list in quotes, doubling quotes in args." - (nt-quote-args-prefix-quote "\"" args)) - -(defvar nt-quote-args-functions-alist - '(("^.?.?sh\\." . nt-quote-args-double-quote)) - "An alist for determining proper argument quoting given executable file name. -Car of each cons must be a string, a regexp against which a file name sans -directory is matched. Cdr is a function symbol. The list is mathced in -forward order, and mathcing entry cdr's funcrion is called with a list of -strings, process arguments. It must return a string which is passed to -the newly created process. - -If not found, then `nt-quote-args-verbatim' is called on the argument list.") - -(defun nt-quote-process-args (args) - ;;Properly quote process ARGS for executing (car ARGS). - (let ((fname (file-name-nondirectory (car args))) - (alist nt-quote-args-functions-alist) - (case-fold-search nil) - (return-me nil) - (assoc nil)) - (while (and alist - (null return-me)) - (setq assoc (pop alist)) - (if (string-match (car assoc) fname) - (setq return-me (funcall (cdr assoc) (cdr args))))) - (or return-me - (nt-quote-args-verbatim (cdr args))))) - ;;; winnt.el ends here