Returns t if successful."
(interactive)
(if (comint-match-partial-filename)
- (prog2 (or (eq (selected-window) (minibuffer-window))
+ (prog2 (or (window-minibuffer-p (selected-window))
(message "Completing file name..."))
(comint-dynamic-complete-as-filename))))
See `comint-dynamic-complete-filename'. Returns t if successful."
(let* ((completion-ignore-case nil)
(completion-ignored-extensions comint-completion-fignore)
+ (file-name-handler-alist nil)
+ (minibuffer-p (window-minibuffer-p (selected-window)))
(success t)
(filename (or (comint-match-partial-filename) ""))
(pathdir (file-name-directory filename))
(pathnondir (file-name-nondirectory filename))
(directory (if pathdir (comint-directory pathdir) default-directory))
- (completion (file-name-completion pathnondir directory))
- (mini-flag (eq (selected-window) (minibuffer-window))))
+ (completion (file-name-completion pathnondir directory)))
(cond ((null completion)
(message "No completions of %s" filename)
(setq success nil))
((eq completion t) ; Means already completed "file".
(if comint-completion-addsuffix (insert " "))
- (or mini-flag (message "Sole completion")))
+ (or minibuffer-p (message "Sole completion")))
((string-equal completion "") ; Means completion on "directory/".
(comint-dynamic-list-filename-completions))
(t ; Completion string returned.
;; We inserted a unique completion.
(if comint-completion-addsuffix
(insert (if (file-directory-p file) "/" " ")))
- (or mini-flag (message "Completed")))
+ (or minibuffer-p (message "Completed")))
((and comint-completion-recexact comint-completion-addsuffix
(string-equal pathnondir completion)
(file-exists-p file))
;; It's not unique, but user wants shortest match.
(insert (if (file-directory-p file) "/" " "))
- (or mini-flag (message "Completed shortest")))
+ (or minibuffer-p (message "Completed shortest")))
((or comint-completion-autolist
(string-equal pathnondir completion))
;; It's not unique, list possible completions.
(comint-dynamic-list-filename-completions))
(t
- (or mini-flag (message "Partially completed")))))))
+ (or minibuffer-p (message "Partially completed")))))))
success))
"List in help buffer possible completions of the filename at point."
(interactive)
(let* ((completion-ignore-case nil)
+ (file-name-handler-alist nil)
(filename (or (comint-match-partial-filename) ""))
(pathdir (file-name-directory filename))
(pathnondir (file-name-nondirectory filename))