Article View: gnu.emacs.bug
Article #87217comint.el file name completion
From: Joerg-Martin Schwarz
Date: Tue, 04 Oct 1994 14:35
Date: Tue, 04 Oct 1994 14:35
72 lines
4765 bytes
4765 bytes
In GNU Emacs 19.25.1 of Fri Jun 10 1994 on hal1 (rs6000-ibm-aix3.2)
1. When I press TAB in a comint shell buffer (comint-dynamic-complete),
comint should find a completion from all really existing files;
not from pathnames that are handled by file-name-handlers.
e.g. typing "cd /so" TAB "em" TAB should complete to
"cd /software/emacs-19.25"; without parsing my ~/.netrc and trying to offer
ange-ftp/efs completions to "/some.remote.host:"
A patch is appended below.
2. I also wonder if it is worth supporting completion of filenames containing
a '=' character. This way I cannot complete lines like
configure --srcdir=/soTABemTAB
One might consider support \-escaping instead. (e.g. \$\ \=\*\; )
3. typing cd /soTAB , I found in the debugger's backtrace a call to
file-name-completion with argument "software/".
I guess this is not correct, but I am not sure what the
programmer wanted to do here.
efs-root-handler-function(file-name-completion "software/" "/")
file-name-completion("software/" "/")
apply(file-name-completion ("software/" "/"))
dired-handler-fn(file-name-completion "software/" "/")
file-name-completion("software/" "/")
(symbolp (file-name-completion completion directory))
(cond ((symbolp ...) (if comint-completion-addsuffix ...) (message "Completed")) ((and comint-completion-recexact comint-completion-addsuffix ... ...) (insert ...) (message "Completed shortest")) ((or comint-completion-autolist ...) (comint-dynamic-list-filename-completions)) (t (message "Partially completed")))
(let ((file ...)) (insert (substring ... ...)) (cond (... ... ...) (... ... ...) (... ...) (t ...)))
(cond ((null completion) (message "No completions of %s" filename) (setq success nil)) ((eq completion t) (if comint-completion-addsuffix ...) (message "Sole completion")) ((string-equal completion "") (comint-dynamic-list-filename-completions)) (t (let ... ... ...)))
(let* ((completion-ignore-case nil) (completion-ignored-extensions comint-completion-fignore) (success t) (filename ...) (pathdir ...) (pathnondir ...) (directory ...) (completion ...)) (cond (... ... ...) (... ... ...) (... ...) (t ...)) success)
comint-dynamic-complete-as-filename()
(prog2 (message "Completing file name...") (comint-dynamic-complete-as-filename))
(if (comint-match-partial-filename) (prog2 (message "Completing file name...") (comint-dynamic-complete-as-filename)))
comint-dynamic-complete-filename()
funcall(comint-dynamic-complete-filename)
(null (funcall (car functions)))
(and functions (null (funcall ...)))
(while (and functions (null ...)) (setq functions (cdr functions)))
(let ((functions comint-dynamic-complete-functions)) (while (and functions ...) (setq functions ...)))
comint-dynamic-complete()
* call-interactively(comint-dynamic-complete)
--- /software/emacs-19.25/lisp/comint.el Fri Sep 16 20:25:58 1994
+++ /var/tmp/comint.el Fri Sep 16 20:25:58 1994
@@ -1851,7 +1851,8 @@
(pathdir (file-name-directory filename))
(pathnondir (file-name-nondirectory filename))
(directory (if pathdir (comint-directory pathdir) default-directory))
- (completion (file-name-completion pathnondir directory)))
+ (completion (let (file-name-handler-alist)
+ (file-name-completion pathnondir directory))))
(cond ((null completion)
(message "No completions of %s" filename)
(setq success nil))
@@ -1953,7 +1954,8 @@
(pathdir (file-name-directory filename))
(pathnondir (file-name-nondirectory filename))
(directory (if pathdir (comint-directory pathdir) default-directory))
- (completions (file-name-all-completions pathnondir directory)))
+ (completions (let (file-name-handler-alist)
+ (file-name-all-completions pathnondir directory))))
(if completions
(comint-dynamic-list-completions completions)
(message "No completions of %s" filename))))
Technical Details
Message-ID:
<9410031907.AA15806@hal1.physik.uni-dortmund.de>Path:
arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!redstone.interpath.net!ddsw1!news.kei.com!uhog.mit.edu!europa.eng.gtefsd.com!howland.reston.ans.net!math.ohio-state.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!hal1.physik.uni-dortmund.de!schwarzShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fb2f1,dad9706362cda41e,start X-Google-Attributes: gidfb2f1,public X-Google-ArrivalTime: 1994-10-04 07:43:05 PST Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!redstone.interpath.net!ddsw1!news.kei.com!uhog.mit.edu!europa.eng.gtefsd.com!howland.reston.ans.net!math.ohio-state.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!hal1.physik.uni-dortmund.de!schwarz From: schwarz@hal1.physik.uni-dortmund.de (Joerg-Martin Schwarz) Newsgroups: gnu.emacs.bug Subject: comint.el file name completion Date: 4 Oct 1994 10:35:58 -0400 Organization: GNUs Not Usenet Lines: 72 Sender: daemon@cis.ohio-state.edu Approved: bug-gnu-emacs@prep.ai.mit.edu Distribution: gnu Message-ID: <9410031907.AA15806@hal1.physik.uni-dortmund.de>