diff options
| author | Chong Yidong | 2008-08-27 17:04:34 +0000 |
|---|---|---|
| committer | Chong Yidong | 2008-08-27 17:04:34 +0000 |
| commit | 629409584924cdca3938e1af548282270518c775 (patch) | |
| tree | 2383933904da6742190d199da23af0e6f2646b40 | |
| parent | 3ca5dc5b45c08177775530b1fa8b4327edb7631e (diff) | |
| download | emacs-629409584924cdca3938e1af548282270518c775.tar.gz emacs-629409584924cdca3938e1af548282270518c775.zip | |
(comint-dynamic-complete-as-filename): Generalize last change to allow
quoting of characters before point.
| -rw-r--r-- | lisp/comint.el | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/lisp/comint.el b/lisp/comint.el index b8e73cb6b78..1a70e8ca107 100644 --- a/lisp/comint.el +++ b/lisp/comint.el | |||
| @@ -2822,8 +2822,8 @@ See `comint-dynamic-complete-filename'. Returns t if successful." | |||
| 2822 | (t | 2822 | (t |
| 2823 | (cdr comint-completion-addsuffix)))) | 2823 | (cdr comint-completion-addsuffix)))) |
| 2824 | (filename (comint-match-partial-filename)) | 2824 | (filename (comint-match-partial-filename)) |
| 2825 | (filename-beg (if filename (match-beginning 0))) | 2825 | (filename-beg (if filename (match-beginning 0) (point))) |
| 2826 | (filename-end (if filename (match-end 0))) | 2826 | (filename-end (if filename (match-end 0) (point))) |
| 2827 | (filename (or filename "")) | 2827 | (filename (or filename "")) |
| 2828 | (filedir (file-name-directory filename)) | 2828 | (filedir (file-name-directory filename)) |
| 2829 | (filenondir (file-name-nondirectory filename)) | 2829 | (filenondir (file-name-nondirectory filename)) |
| @@ -2842,19 +2842,12 @@ See `comint-dynamic-complete-filename'. Returns t if successful." | |||
| 2842 | (comint-dynamic-list-filename-completions)) | 2842 | (comint-dynamic-list-filename-completions)) |
| 2843 | (t ; Completion string returned. | 2843 | (t ; Completion string returned. |
| 2844 | (let ((file (concat (file-name-as-directory directory) completion))) | 2844 | (let ((file (concat (file-name-as-directory directory) completion))) |
| 2845 | (if (or (null read-file-name-completion-ignore-case) | 2845 | ;; Insert completion. Note that the completion string |
| 2846 | (null filename-beg) | 2846 | ;; may have a different case than what's in the prompt, |
| 2847 | (null filename-end)) | 2847 | ;; if read-file-name-completion-ignore-case is non-nil, |
| 2848 | (insert (comint-quote-filename | ||
| 2849 | (substring (directory-file-name completion) | ||
| 2850 | (length filenondir))))) | ||
| 2851 | ;; If read-file-name-completion-ignore-case is non-nil, | ||
| 2852 | ;; the completion string may have a different case than | ||
| 2853 | ;; what's in the prompt. | ||
| 2854 | (delete-region filename-beg filename-end) | 2848 | (delete-region filename-beg filename-end) |
| 2855 | (if filedir (insert filedir)) | 2849 | (if filedir (insert filedir)) |
| 2856 | (insert (comint-quote-filename | 2850 | (insert (comint-quote-filename (directory-file-name completion))) |
| 2857 | (directory-file-name completion))) | ||
| 2858 | (cond ((symbolp (file-name-completion completion directory)) | 2851 | (cond ((symbolp (file-name-completion completion directory)) |
| 2859 | ;; We inserted a unique completion. | 2852 | ;; We inserted a unique completion. |
| 2860 | (insert (if (file-directory-p file) dirsuffix filesuffix)) | 2853 | (insert (if (file-directory-p file) dirsuffix filesuffix)) |