(comint-dynamic-complete-as-filename): Simplify.
This commit is contained in:
parent
69eaf10d03
commit
f79f58bc29
1 changed files with 5 additions and 9 deletions
|
@ -1836,14 +1836,11 @@ See `comint-dynamic-complete-filename'. Returns t if successful."
|
||||||
(let* ((completion-ignore-case nil)
|
(let* ((completion-ignore-case nil)
|
||||||
(completion-ignored-extensions comint-completion-fignore)
|
(completion-ignored-extensions comint-completion-fignore)
|
||||||
(success t)
|
(success t)
|
||||||
(filename (comint-match-partial-filename))
|
(filename (or (comint-match-partial-filename) ""))
|
||||||
endpos pathdir pathnondir directory completion)
|
(pathdir (file-name-directory filename))
|
||||||
(setq endpos (if filename (match-end 0) (point)))
|
(pathnondir (file-name-nondirectory filename))
|
||||||
(or filename (setq filename ""))
|
(directory (if pathdir (comint-directory pathdir) default-directory))
|
||||||
(setq pathdir (file-name-directory filename)
|
(completion (file-name-completion pathnondir directory)))
|
||||||
pathnondir (file-name-nondirectory filename)
|
|
||||||
directory (if pathdir (comint-directory pathdir) default-directory)
|
|
||||||
completion (file-name-completion pathnondir directory))
|
|
||||||
(cond ((null completion)
|
(cond ((null completion)
|
||||||
(message "No completions of %s" filename)
|
(message "No completions of %s" filename)
|
||||||
(setq success nil))
|
(setq success nil))
|
||||||
|
@ -1854,7 +1851,6 @@ See `comint-dynamic-complete-filename'. Returns t if successful."
|
||||||
(comint-dynamic-list-filename-completions))
|
(comint-dynamic-list-filename-completions))
|
||||||
(t ; Completion string returned.
|
(t ; Completion string returned.
|
||||||
(let ((file (concat (file-name-as-directory directory) completion)))
|
(let ((file (concat (file-name-as-directory directory) completion)))
|
||||||
(goto-char endpos)
|
|
||||||
(insert (substring (directory-file-name completion)
|
(insert (substring (directory-file-name completion)
|
||||||
(length pathnondir)))
|
(length pathnondir)))
|
||||||
(cond ((symbolp (file-name-completion completion directory))
|
(cond ((symbolp (file-name-completion completion directory))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue