Function: tramp-skeleton-file-name-all-completions

tramp-skeleton-file-name-all-completions is a macro defined in tramp.el.gz.

Signature

(tramp-skeleton-file-name-all-completions FILENAME DIRECTORY &rest BODY)

Documentation

Skeleton for tramp-*-handle-filename-all-completions.

BODY is the backend specific code.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp.el.gz
(defmacro tramp-skeleton-file-name-all-completions
    (filename directory &rest body)
  "Skeleton for `tramp-*-handle-filename-all-completions'.
BODY is the backend specific code."
  (declare (indent 2) (debug t))
  `(ignore-error file-missing
     (seq-uniq (delq nil (delete ""
       (let* ((case-fold-search read-file-name-completion-ignore-case)
	      (result (progn ,@body)))
	 ;; Some storage systems do not return "." and "..".
	 (when (tramp-tramp-file-p ,directory)
	   (dolist (elt '(".." "."))
	     (when (string-prefix-p ,filename elt)
	       (setq result (cons (concat elt "/") result)))))
	 (if (consp completion-regexp-list)
	     ;; Discriminate over `completion-regexp-list'.
	     (mapcar
	      (lambda (x)
		(when (stringp x)
		  (catch 'match
		    (dolist (elt completion-regexp-list x)
		      (unless (string-match-p elt x) (throw 'match nil))))))
	      result)
	   result)))))))