diff options
author | Chong Yidong <cyd@stupidchicken.com> | 2008-08-27 17:04:34 +0000 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2008-08-27 17:04:34 +0000 |
commit | 629409584924cdca3938e1af548282270518c775 (patch) | |
tree | 2383933904da6742190d199da23af0e6f2646b40 /lisp/comint.el | |
parent | 3ca5dc5b45c08177775530b1fa8b4327edb7631e (diff) | |
download | emacs-629409584924cdca3938e1af548282270518c775.tar.gz |
(comint-dynamic-complete-as-filename): Generalize last change to allow
quoting of characters before point.
Diffstat (limited to 'lisp/comint.el')
-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." (t (cdr comint-completion-addsuffix)))) (filename (comint-match-partial-filename)) - (filename-beg (if filename (match-beginning 0))) - (filename-end (if filename (match-end 0))) + (filename-beg (if filename (match-beginning 0) (point))) + (filename-end (if filename (match-end 0) (point))) (filename (or filename "")) (filedir (file-name-directory filename)) (filenondir (file-name-nondirectory filename)) @@ -2842,19 +2842,12 @@ See `comint-dynamic-complete-filename'. Returns t if successful." (comint-dynamic-list-filename-completions)) (t ; Completion string returned. (let ((file (concat (file-name-as-directory directory) completion))) - (if (or (null read-file-name-completion-ignore-case) - (null filename-beg) - (null filename-end)) - (insert (comint-quote-filename - (substring (directory-file-name completion) - (length filenondir))))) - ;; If read-file-name-completion-ignore-case is non-nil, - ;; the completion string may have a different case than - ;; what's in the prompt. + ;; Insert completion. Note that the completion string + ;; may have a different case than what's in the prompt, + ;; if read-file-name-completion-ignore-case is non-nil, (delete-region filename-beg filename-end) (if filedir (insert filedir)) - (insert (comint-quote-filename - (directory-file-name completion))) + (insert (comint-quote-filename (directory-file-name completion))) (cond ((symbolp (file-name-completion completion directory)) ;; We inserted a unique completion. (insert (if (file-directory-p file) dirsuffix filesuffix)) |