aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1996-06-09 20:31:04 +0000
committerRichard M. Stallman1996-06-09 20:31:04 +0000
commit7a35a067a3fbdafdb683a153a8094f63458a688f (patch)
tree26c54c93d5d899b4aebbea012a1c087262bd0781
parente9bf058bcefafbea5ebe3270f39097d4a8e7416e (diff)
downloademacs-7a35a067a3fbdafdb683a153a8094f63458a688f.tar.gz
emacs-7a35a067a3fbdafdb683a153a8094f63458a688f.zip
(comint-dynamic-complete-as-filename)
(omint-dynamic-simple-complete) (comint-dynamic-list-filename-completions) [ms-dos, windows-nt]: Set completion-ignore-case to t for these systems. (comint-substitute-in-file-name): New function. (comint-match-partial-filename): Use comint-substitute-in-file-name to handle system-specific syntax.
-rw-r--r--lisp/comint.el31
1 files changed, 26 insertions, 5 deletions
diff --git a/lisp/comint.el b/lisp/comint.el
index 8a043d739cc..45ab7e6d4ec 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -1,6 +1,6 @@
1;;; comint.el --- general command interpreter in a window stuff 1;;; comint.el --- general command interpreter in a window stuff
2 2
3;; Copyright (C) 1988, 90, 92, 93, 94, 95 Free Software Foundation, Inc. 3;; Copyright (C) 1988, 90, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
4 4
5;; Author: Olin Shivers <shivers@cs.cmu.edu> 5;; Author: Olin Shivers <shivers@cs.cmu.edu>
6;; Adapted-by: Simon Marshall <simon@gnu.ai.mit.edu> 6;; Adapted-by: Simon Marshall <simon@gnu.ai.mit.edu>
@@ -1854,12 +1854,30 @@ inside of a \"[...]\" (see `skip-chars-forward')."
1854 (progn (store-match-data (list (point) here)) 1854 (progn (store-match-data (list (point) here))
1855 (match-string 0)))))) 1855 (match-string 0))))))
1856 1856
1857(defun comint-substitute-in-file-name (filename)
1858 "Return FILENAME with environment variables substituted.
1859Supports additional environment variable syntax of the command
1860interpreter (e.g., the percent notation of cmd.exe on NT)."
1861 (let ((name (substitute-in-file-name filename)))
1862 (if (memq system-type '(ms-dos windows-nt))
1863 (let (env-var-name
1864 env-var-val)
1865 (save-match-data
1866 (while (string-match "%\\([^\\\\/]*\\)%" name)
1867 (setq env-var-name
1868 (substring name (match-beginning 1) (match-end 1)))
1869 (setq env-var-val (if (getenv env-var-name)
1870 (getenv env-var-name)
1871 ""))
1872 (setq name (replace-match env-var-val nil nil name))))))
1873 name))
1857 1874
1858(defun comint-match-partial-filename () 1875(defun comint-match-partial-filename ()
1859 "Return the filename at point, or nil if non is found. 1876 "Return the filename at point, or nil if non is found.
1860Environment variables are substituted. See `comint-word'." 1877Environment variables are substituted. See `comint-word'."
1861 (let ((filename (comint-word "~/A-Za-z0-9+@:_.$#%,={}-"))) 1878 (let ((filename (comint-word "~/A-Za-z0-9+@:_.$#%,={}-")))
1862 (and filename (substitute-in-file-name (comint-unquote-filename filename))))) 1879 (and filename (comint-substitute-in-file-name
1880 (comint-unquote-filename filename)))))
1863 1881
1864 1882
1865(defun comint-quote-filename (filename) 1883(defun comint-quote-filename (filename)
@@ -1923,7 +1941,8 @@ Returns t if successful."
1923(defun comint-dynamic-complete-as-filename () 1941(defun comint-dynamic-complete-as-filename ()
1924 "Dynamically complete at point as a filename. 1942 "Dynamically complete at point as a filename.
1925See `comint-dynamic-complete-filename'. Returns t if successful." 1943See `comint-dynamic-complete-filename'. Returns t if successful."
1926 (let* ((completion-ignore-case nil) 1944 (let* ((completion-ignore-case
1945 (if (memq system-type '(ms-dos windows-nt)) t nil))
1927 (completion-ignored-extensions comint-completion-fignore) 1946 (completion-ignored-extensions comint-completion-fignore)
1928 (file-name-handler-alist nil) 1947 (file-name-handler-alist nil)
1929 (minibuffer-p (window-minibuffer-p (selected-window))) 1948 (minibuffer-p (window-minibuffer-p (selected-window)))
@@ -1997,7 +2016,8 @@ Returns `partial' if completed as far as possible with the completion matches.
1997Returns `listed' if a completion listing was shown. 2016Returns `listed' if a completion listing was shown.
1998 2017
1999See also `comint-dynamic-complete-filename'." 2018See also `comint-dynamic-complete-filename'."
2000 (let* ((completion-ignore-case nil) 2019 (let* ((completion-ignore-case
2020 (if (memq system-type '(ms-dos windows-nt)) t nil))
2001 (suffix (cond ((not comint-completion-addsuffix) "") 2021 (suffix (cond ((not comint-completion-addsuffix) "")
2002 ((not (consp comint-completion-addsuffix)) " ") 2022 ((not (consp comint-completion-addsuffix)) " ")
2003 (t (cdr comint-completion-addsuffix)))) 2023 (t (cdr comint-completion-addsuffix))))
@@ -2038,7 +2058,8 @@ See also `comint-dynamic-complete-filename'."
2038(defun comint-dynamic-list-filename-completions () 2058(defun comint-dynamic-list-filename-completions ()
2039 "List in help buffer possible completions of the filename at point." 2059 "List in help buffer possible completions of the filename at point."
2040 (interactive) 2060 (interactive)
2041 (let* ((completion-ignore-case nil) 2061 (let* ((completion-ignore-case
2062 (if (memq system-type '(ms-dos windows-nt)) t nil))
2042 (file-name-handler-alist nil) 2063 (file-name-handler-alist nil)
2043 (filename (or (comint-match-partial-filename) "")) 2064 (filename (or (comint-match-partial-filename) ""))
2044 (pathdir (file-name-directory filename)) 2065 (pathdir (file-name-directory filename))