Function: pcomplete/scp

pcomplete/scp is an autoloaded and byte-compiled function defined in pcmpl-unix.el.gz.

Signature

(pcomplete/scp)

Documentation

Completion rules for the scp command.

Includes files as well as host names followed by a colon.

Source Code

;; Defined in /usr/src/emacs/lisp/pcmpl-unix.el.gz
;;;###autoload
(defun pcomplete/scp ()
  "Completion rules for the `scp' command.
Includes files as well as host names followed by a colon."
  (pcomplete-opt "1246BCpqrvcFiloPS")
  (while t (pcomplete-here
            (lambda (string pred action)
              (let ((table
                     (cond
                      ((string-match "\\`[^:/]+:" string) ; Remote file name.
		       (if (and (eq action 'lambda)
				(eq (match-end 0) (length string)))
			   ;; Avoid connecting to the remote host when we're
			   ;; only completing the host name.
			   (list string)
			 (completion-table-subvert (pcomplete-all-entries)
                                                   "" "/ssh:")))
                      ((string-search "/" string) ; Local file name.
                       (pcomplete-all-entries))
                      (t                ;Host name or local file name.
                       (append (all-completions string (pcomplete-all-entries))
                               (mapcar (lambda (host) (concat host ":"))
                                       (pcmpl-ssh-hosts)))))))
                (complete-with-action action table string pred))))))