# HG changeset patch # User Karl Heuer # Date 858126229 0 # Node ID 2824e1f84717a020e75e9deaf2abc7455fd579ef # Parent b8536e42d4eff850102b86fef57dea0cbea5c155 (term-completion-addsuffix): Doc fix. (term-dynamic-complete-as-filename): Support the case where term-completion-addsuffix is a (DIRSUFFIX . FILESUFFIX) cons pair. diff -r b8536e42d4ef -r 2824e1f84717 lisp/term.el --- a/lisp/term.el Tue Mar 11 23:55:24 1997 +0000 +++ b/lisp/term.el Wed Mar 12 00:23:49 1997 +0000 @@ -2943,7 +2943,9 @@ (defvar term-completion-addsuffix t "*If non-nil, add a `/' to completed directories, ` ' to file names. -This mirrors the optional behavior of tcsh.") +If a cons pair, it should be of the form (DIRSUFFIX . FILESUFFIX) where +DIRSUFFIX and FILESUFFIX are strings added on unambiguous or exact +completion. This mirrors the optional behavior of tcsh.") (defvar term-completion-recexact nil "*If non-nil, use shortest completion if characters cannot be added. @@ -3031,6 +3033,12 @@ (let* ((completion-ignore-case nil) (completion-ignored-extensions term-completion-fignore) (success t) + (dirsuffix (cond ((not term-completion-addsuffix) "") + ((not (consp term-completion-addsuffix)) "/") + (t (car term-completion-addsuffix)))) + (filesuffix (cond ((not term-completion-addsuffix) "") + ((not (consp term-completion-addsuffix)) " ") + (t (cdr term-completion-addsuffix)))) (filename (or (term-match-partial-filename) "")) (pathdir (file-name-directory filename)) (pathnondir (file-name-nondirectory filename)) @@ -3051,14 +3059,13 @@ (length pathnondir))) (cond ((symbolp (file-name-completion completion directory)) ;; We inserted a unique completion. - (if term-completion-addsuffix - (insert (if (file-directory-p file) "/" " "))) + (insert (if (file-directory-p file) dirsuffix filesuffix)) (or mini-flag (message "Completed"))) ((and term-completion-recexact term-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) "/" " ")) + (insert (if (file-directory-p file) dirsuffix filesuffix)) (or mini-flag (message "Completed shortest"))) ((or term-completion-autolist (string-equal pathnondir completion))