diff options
| author | Karoly Lorentey | 2003-12-30 17:05:05 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2003-12-30 17:05:05 +0000 |
| commit | 7c3a26158711d76ee77b0bd75fa9df56db5eb57d (patch) | |
| tree | f808bf77a5b47ce2c8aec0a31187626860d566b6 /lisp/shell.el | |
| parent | c1c63edb7907e35085f2d61507e1047db85d52c7 (diff) | |
| parent | 8a37230a70acc8943ba45f52504179ddcc1a5468 (diff) | |
| download | emacs-7c3a26158711d76ee77b0bd75fa9df56db5eb57d.tar.gz emacs-7c3a26158711d76ee77b0bd75fa9df56db5eb57d.zip | |
Merged in changes from CVS head
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-5
Add =cvs-sync-make-log script
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-6
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-7
Use absolute tla-tools filenames in =cvs-sync-make-log
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-8
Use proper arch-tag: syntax for lispintro/texinfo.tex
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-9
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-24
Diffstat (limited to 'lisp/shell.el')
| -rw-r--r-- | lisp/shell.el | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/lisp/shell.el b/lisp/shell.el index cc83dcf1429..1817a1fd3b4 100644 --- a/lisp/shell.el +++ b/lisp/shell.el | |||
| @@ -167,7 +167,7 @@ This is a fine thing to set in your `.emacs' file.") | |||
| 167 | (defvar shell-file-name-chars | 167 | (defvar shell-file-name-chars |
| 168 | (if (memq system-type '(ms-dos windows-nt cygwin)) | 168 | (if (memq system-type '(ms-dos windows-nt cygwin)) |
| 169 | "~/A-Za-z0-9_^$!#%&{}@`'.,:()-" | 169 | "~/A-Za-z0-9_^$!#%&{}@`'.,:()-" |
| 170 | "~/A-Za-z0-9+@:_.$#%,={}-") | 170 | "[]~/A-Za-z0-9+@:_.$#%,={}-") |
| 171 | "String of characters valid in a file name. | 171 | "String of characters valid in a file name. |
| 172 | This variable is used to initialize `comint-file-name-chars' in the | 172 | This variable is used to initialize `comint-file-name-chars' in the |
| 173 | shell buffer. The value may depend on the operating system or shell. | 173 | shell buffer. The value may depend on the operating system or shell. |
| @@ -941,36 +941,37 @@ Returns t if successful." | |||
| 941 | "Dynamically complete at point as a command. | 941 | "Dynamically complete at point as a command. |
| 942 | See `shell-dynamic-complete-filename'. Returns t if successful." | 942 | See `shell-dynamic-complete-filename'. Returns t if successful." |
| 943 | (let* ((filename (or (comint-match-partial-filename) "")) | 943 | (let* ((filename (or (comint-match-partial-filename) "")) |
| 944 | (pathnondir (file-name-nondirectory filename)) | 944 | (filenondir (file-name-nondirectory filename)) |
| 945 | (paths (cdr (reverse exec-path))) | 945 | (path-dirs (cdr (reverse exec-path))) |
| 946 | (cwd (file-name-as-directory (expand-file-name default-directory))) | 946 | (cwd (file-name-as-directory (expand-file-name default-directory))) |
| 947 | (ignored-extensions | 947 | (ignored-extensions |
| 948 | (and comint-completion-fignore | 948 | (and comint-completion-fignore |
| 949 | (mapconcat (function (lambda (x) (concat (regexp-quote x) "$"))) | 949 | (mapconcat (function (lambda (x) (concat (regexp-quote x) "$"))) |
| 950 | comint-completion-fignore "\\|"))) | 950 | comint-completion-fignore "\\|"))) |
| 951 | (path "") (comps-in-path ()) (file "") (filepath "") (completions ())) | 951 | (dir "") (comps-in-dir ()) |
| 952 | ;; Go thru each path in the search path, finding completions. | 952 | (file "") (abs-file-name "") (completions ())) |
| 953 | (while paths | 953 | ;; Go thru each dir in the search path, finding completions. |
| 954 | (setq path (file-name-as-directory (comint-directory (or (car paths) "."))) | 954 | (while path-dirs |
| 955 | comps-in-path (and (file-accessible-directory-p path) | 955 | (setq dir (file-name-as-directory (comint-directory (or (car path-dirs) "."))) |
| 956 | (file-name-all-completions pathnondir path))) | 956 | comps-in-dir (and (file-accessible-directory-p dir) |
| 957 | (file-name-all-completions filenondir dir))) | ||
| 957 | ;; Go thru each completion found, to see whether it should be used. | 958 | ;; Go thru each completion found, to see whether it should be used. |
| 958 | (while comps-in-path | 959 | (while comps-in-dir |
| 959 | (setq file (car comps-in-path) | 960 | (setq file (car comps-in-dir) |
| 960 | filepath (concat path file)) | 961 | abs-file-name (concat dir file)) |
| 961 | (if (and (not (member file completions)) | 962 | (if (and (not (member file completions)) |
| 962 | (not (and ignored-extensions | 963 | (not (and ignored-extensions |
| 963 | (string-match ignored-extensions file))) | 964 | (string-match ignored-extensions file))) |
| 964 | (or (string-equal path cwd) | 965 | (or (string-equal dir cwd) |
| 965 | (not (file-directory-p filepath))) | 966 | (not (file-directory-p abs-file-name))) |
| 966 | (or (null shell-completion-execonly) | 967 | (or (null shell-completion-execonly) |
| 967 | (file-executable-p filepath))) | 968 | (file-executable-p abs-file-name))) |
| 968 | (setq completions (cons file completions))) | 969 | (setq completions (cons file completions))) |
| 969 | (setq comps-in-path (cdr comps-in-path))) | 970 | (setq comps-in-dir (cdr comps-in-dir))) |
| 970 | (setq paths (cdr paths))) | 971 | (setq path-dirs (cdr path-dirs))) |
| 971 | ;; OK, we've got a list of completions. | 972 | ;; OK, we've got a list of completions. |
| 972 | (let ((success (let ((comint-completion-addsuffix nil)) | 973 | (let ((success (let ((comint-completion-addsuffix nil)) |
| 973 | (comint-dynamic-simple-complete pathnondir completions)))) | 974 | (comint-dynamic-simple-complete filenondir completions)))) |
| 974 | (if (and (memq success '(sole shortest)) comint-completion-addsuffix | 975 | (if (and (memq success '(sole shortest)) comint-completion-addsuffix |
| 975 | (not (file-directory-p (comint-match-partial-filename)))) | 976 | (not (file-directory-p (comint-match-partial-filename)))) |
| 976 | (insert " ")) | 977 | (insert " ")) |