Function: pcomplete--entries
pcomplete--entries is a byte-compiled function defined in
pcomplete.el.gz.
Signature
(pcomplete--entries &optional REGEXP PREDICATE)
Documentation
Like pcomplete-entries but without env-var handling.
Source Code
;; Defined in /usr/src/emacs/lisp/pcomplete.el.gz
(defun pcomplete--entries (&optional regexp predicate)
"Like `pcomplete-entries' but without env-var handling."
(let* ((ign-pred
(when (or pcomplete-file-ignore pcomplete-dir-ignore)
;; Capture the dynbound value for later use.
(let ((file-ignore pcomplete-file-ignore)
(dir-ignore pcomplete-dir-ignore))
(lambda (file)
(not
(if (eq (aref file (1- (length file))) ?/)
(and dir-ignore (string-match dir-ignore file))
(and file-ignore (string-match file-ignore file))))))))
(reg-pred (if regexp (lambda (file) (string-match regexp file))))
(pred (cond
((null (or ign-pred reg-pred)) predicate)
((null (or ign-pred predicate)) reg-pred)
((null (or reg-pred predicate)) ign-pred)
(t (lambda (f)
(and (or (null reg-pred) (funcall reg-pred f))
(or (null ign-pred) (funcall ign-pred f))
(or (null predicate) (funcall predicate f))))))))
(lambda (s p a)
(if (and (eq a 'metadata) pcomplete-compare-entry-function)
`(metadata (cycle-sort-function
. ,(lambda (comps)
(sort comps pcomplete-compare-entry-function)))
,@(cdr (completion-file-name-table s p a)))
(let ((completion-ignored-extensions nil)
(completion-ignore-case completion-ignore-case))
(completion-table-with-predicate
#'comint-completion-file-name-table pred 'strict s p a))))))