annotate lisp/pcmpl-unix.el @ 107583:f35e7896a0fe

Retrospective commit. These are the original changes made by Kenichi Handa on the old pre Emacs 22 emacs-bidi branch.
author Eli Zaretskii <eliz@gnu.org>
date Thu, 31 Dec 2009 14:44:59 -0500
parents 33815099ecfc
children 1d1d5d9bd884
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38414
67b464da13ec Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 29959
diff changeset
1 ;;; pcmpl-unix.el --- standard UNIX completions
29959
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2
74442
b2e5081b9320 Update copyright years.
Glenn Morris <rgm@gnu.org>
parents: 68651
diff changeset
3 ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004,
100908
a9dc0e7c3f2b Add 2009 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
4 ;; 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
29959
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
6 ;; This file is part of GNU Emacs.
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
7
94678
ee5932bf781d Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 91644
diff changeset
8 ;; GNU Emacs is free software: you can redistribute it and/or modify
29959
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
9 ;; it under the terms of the GNU General Public License as published by
94678
ee5932bf781d Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 91644
diff changeset
10 ;; the Free Software Foundation, either version 3 of the License, or
ee5932bf781d Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 91644
diff changeset
11 ;; (at your option) any later version.
29959
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
12
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
13 ;; GNU Emacs is distributed in the hope that it will be useful,
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
16 ;; GNU General Public License for more details.
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
17
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
18 ;; You should have received a copy of the GNU General Public License
94678
ee5932bf781d Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 91644
diff changeset
19 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
29959
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
20
38414
67b464da13ec Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 29959
diff changeset
21 ;;; Commentary:
67b464da13ec Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 29959
diff changeset
22
29959
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
23 ;;; Code:
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
24
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
25 (require 'pcomplete)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
26
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
27 ;; User Variables:
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
28
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
29 (defcustom pcmpl-unix-group-file "/etc/group"
91644
681a1b7488c2 (top-level): Move provide statement to end.
Glenn Morris <rgm@gnu.org>
parents: 91643
diff changeset
30 "If non-nil, a string naming the group file on your system."
681a1b7488c2 (top-level): Move provide statement to end.
Glenn Morris <rgm@gnu.org>
parents: 91643
diff changeset
31 :type '(choice file (const nil))
29959
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
32 :group 'pcmpl-unix)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
33
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
34 (defcustom pcmpl-unix-passwd-file "/etc/passwd"
91644
681a1b7488c2 (top-level): Move provide statement to end.
Glenn Morris <rgm@gnu.org>
parents: 91643
diff changeset
35 "If non-nil, a string naming the passwd file on your system."
681a1b7488c2 (top-level): Move provide statement to end.
Glenn Morris <rgm@gnu.org>
parents: 91643
diff changeset
36 :type '(choice file (const nil))
29959
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
37 :group 'pcmpl-unix)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
38
91643
d3922949ea68 Phil Hagelberg <phil at evri.com>
Glenn Morris <rgm@gnu.org>
parents: 79721
diff changeset
39 (defcustom pcmpl-ssh-known-hosts-file "~/.ssh/known_hosts"
91644
681a1b7488c2 (top-level): Move provide statement to end.
Glenn Morris <rgm@gnu.org>
parents: 91643
diff changeset
40 "If non-nil, a string naming your SSH \"known_hosts\" file.
681a1b7488c2 (top-level): Move provide statement to end.
Glenn Morris <rgm@gnu.org>
parents: 91643
diff changeset
41 This allows completion of SSH host names. Note that newer
681a1b7488c2 (top-level): Move provide statement to end.
Glenn Morris <rgm@gnu.org>
parents: 91643
diff changeset
42 versions of ssh hash the hosts by default to prevent
681a1b7488c2 (top-level): Move provide statement to end.
Glenn Morris <rgm@gnu.org>
parents: 91643
diff changeset
43 Island-hopping SSH attacks. This can be disabled, at some risk,
681a1b7488c2 (top-level): Move provide statement to end.
Glenn Morris <rgm@gnu.org>
parents: 91643
diff changeset
44 with the SSH option \"HashKnownHosts no\"."
681a1b7488c2 (top-level): Move provide statement to end.
Glenn Morris <rgm@gnu.org>
parents: 91643
diff changeset
45 :type '(choice file (const nil))
681a1b7488c2 (top-level): Move provide statement to end.
Glenn Morris <rgm@gnu.org>
parents: 91643
diff changeset
46 :group 'pcmpl-unix
681a1b7488c2 (top-level): Move provide statement to end.
Glenn Morris <rgm@gnu.org>
parents: 91643
diff changeset
47 :version "23.1")
91643
d3922949ea68 Phil Hagelberg <phil at evri.com>
Glenn Morris <rgm@gnu.org>
parents: 79721
diff changeset
48
29959
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
49 ;; Functions:
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
50
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
51 ;;;###autoload
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
52 (defun pcomplete/cd ()
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
53 "Completion for `cd'."
106360
33815099ecfc (pcomplete/cd): Complete more than one argument, just in case.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 100908
diff changeset
54 (while (pcomplete-here (pcomplete-dirs))))
29959
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
55
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
56 ;;;###autoload
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
57 (defalias 'pcomplete/pushd 'pcomplete/cd)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
58
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
59 ;;;###autoload
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
60 (defun pcomplete/rmdir ()
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
61 "Completion for `rmdir'."
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
62 (while (pcomplete-here (pcomplete-dirs))))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
63
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
64 ;;;###autoload
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
65 (defun pcomplete/rm ()
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
66 "Completion for `rm'."
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
67 (let ((pcomplete-help "(fileutils)rm invocation"))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
68 (pcomplete-opt "dfirRv")
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
69 (while (pcomplete-here (pcomplete-all-entries) nil
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
70 'expand-file-name))))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
71
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
72 ;;;###autoload
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
73 (defun pcomplete/xargs ()
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
74 "Completion for `xargs'."
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
75 (pcomplete-here (funcall pcomplete-command-completion-function))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
76 (funcall (or (pcomplete-find-completion-function (pcomplete-arg 1))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
77 pcomplete-default-completion-function)))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
78
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
79 ;;;###autoload
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
80 (defalias 'pcomplete/time 'pcomplete/xargs)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
81
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
82 ;;;###autoload
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
83 (defun pcomplete/which ()
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
84 "Completion for `which'."
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
85 (while (pcomplete-here (funcall pcomplete-command-completion-function))))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
86
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
87 (defun pcmpl-unix-read-passwd-file (file)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
88 "Return an alist correlating gids to group names in FILE."
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
89 (let (names)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
90 (when (file-readable-p file)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
91 (with-temp-buffer
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
92 (insert-file-contents file)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
93 (goto-char (point-min))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
94 (while (not (eobp))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
95 (let* ((fields
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
96 (split-string (buffer-substring
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
97 (point) (progn (end-of-line)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
98 (point))) ":")))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
99 (setq names (cons (nth 0 fields) names)))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
100 (forward-line))))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
101 (pcomplete-uniqify-list names)))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
102
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
103 (defsubst pcmpl-unix-group-names ()
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
104 "Read the contents of /etc/group for group names."
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
105 (if pcmpl-unix-group-file
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
106 (pcmpl-unix-read-passwd-file pcmpl-unix-group-file)))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
107
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
108 (defsubst pcmpl-unix-user-names ()
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
109 "Read the contents of /etc/passwd for user names."
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
110 (if pcmpl-unix-passwd-file
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
111 (pcmpl-unix-read-passwd-file pcmpl-unix-passwd-file)))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
112
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
113 ;;;###autoload
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
114 (defun pcomplete/chown ()
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
115 "Completion for the `chown' command."
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
116 (unless (pcomplete-match "\\`-")
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
117 (if (pcomplete-match "\\`[^.]*\\'" 0)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
118 (pcomplete-here* (pcmpl-unix-user-names))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
119 (if (pcomplete-match "\\.\\([^.]*\\)\\'" 0)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
120 (pcomplete-here* (pcmpl-unix-group-names)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
121 (pcomplete-match-string 1 0))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
122 (pcomplete-here*))))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
123 (while (pcomplete-here (pcomplete-entries))))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
124
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
125 ;;;###autoload
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
126 (defun pcomplete/chgrp ()
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
127 "Completion for the `chgrp' command."
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
128 (unless (pcomplete-match "\\`-")
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
129 (pcomplete-here* (pcmpl-unix-group-names)))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
130 (while (pcomplete-here (pcomplete-entries))))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
131
91644
681a1b7488c2 (top-level): Move provide statement to end.
Glenn Morris <rgm@gnu.org>
parents: 91643
diff changeset
132
91643
d3922949ea68 Phil Hagelberg <phil at evri.com>
Glenn Morris <rgm@gnu.org>
parents: 79721
diff changeset
133 ;; ssh support by Phil Hagelberg.
d3922949ea68 Phil Hagelberg <phil at evri.com>
Glenn Morris <rgm@gnu.org>
parents: 79721
diff changeset
134 ;; http://www.emacswiki.org/cgi-bin/wiki/pcmpl-ssh.el
d3922949ea68 Phil Hagelberg <phil at evri.com>
Glenn Morris <rgm@gnu.org>
parents: 79721
diff changeset
135
91644
681a1b7488c2 (top-level): Move provide statement to end.
Glenn Morris <rgm@gnu.org>
parents: 91643
diff changeset
136 (defun pcmpl-ssh-hosts ()
681a1b7488c2 (top-level): Move provide statement to end.
Glenn Morris <rgm@gnu.org>
parents: 91643
diff changeset
137 "Return a list of hosts found in `pcmpl-ssh-known-hosts-file'."
681a1b7488c2 (top-level): Move provide statement to end.
Glenn Morris <rgm@gnu.org>
parents: 91643
diff changeset
138 (when (and pcmpl-ssh-known-hosts-file
681a1b7488c2 (top-level): Move provide statement to end.
Glenn Morris <rgm@gnu.org>
parents: 91643
diff changeset
139 (file-readable-p pcmpl-ssh-known-hosts-file))
681a1b7488c2 (top-level): Move provide statement to end.
Glenn Morris <rgm@gnu.org>
parents: 91643
diff changeset
140 (with-temp-buffer
681a1b7488c2 (top-level): Move provide statement to end.
Glenn Morris <rgm@gnu.org>
parents: 91643
diff changeset
141 (insert-file-contents-literally pcmpl-ssh-known-hosts-file)
681a1b7488c2 (top-level): Move provide statement to end.
Glenn Morris <rgm@gnu.org>
parents: 91643
diff changeset
142 (let (ssh-hosts-list)
681a1b7488c2 (top-level): Move provide statement to end.
Glenn Morris <rgm@gnu.org>
parents: 91643
diff changeset
143 (while (re-search-forward "^ *\\([-.[:alnum:]]+\\)[, ]" nil t)
681a1b7488c2 (top-level): Move provide statement to end.
Glenn Morris <rgm@gnu.org>
parents: 91643
diff changeset
144 (add-to-list 'ssh-hosts-list (match-string 1))
681a1b7488c2 (top-level): Move provide statement to end.
Glenn Morris <rgm@gnu.org>
parents: 91643
diff changeset
145 (while (and (looking-back ",")
681a1b7488c2 (top-level): Move provide statement to end.
Glenn Morris <rgm@gnu.org>
parents: 91643
diff changeset
146 (re-search-forward "\\([-.[:alnum:]]+\\)[, ]"
681a1b7488c2 (top-level): Move provide statement to end.
Glenn Morris <rgm@gnu.org>
parents: 91643
diff changeset
147 (line-end-position) t))
681a1b7488c2 (top-level): Move provide statement to end.
Glenn Morris <rgm@gnu.org>
parents: 91643
diff changeset
148 (add-to-list 'ssh-hosts-list (match-string 1))))
681a1b7488c2 (top-level): Move provide statement to end.
Glenn Morris <rgm@gnu.org>
parents: 91643
diff changeset
149 ssh-hosts-list))))
91643
d3922949ea68 Phil Hagelberg <phil at evri.com>
Glenn Morris <rgm@gnu.org>
parents: 79721
diff changeset
150
d3922949ea68 Phil Hagelberg <phil at evri.com>
Glenn Morris <rgm@gnu.org>
parents: 79721
diff changeset
151 ;;;###autoload
d3922949ea68 Phil Hagelberg <phil at evri.com>
Glenn Morris <rgm@gnu.org>
parents: 79721
diff changeset
152 (defun pcomplete/ssh ()
d3922949ea68 Phil Hagelberg <phil at evri.com>
Glenn Morris <rgm@gnu.org>
parents: 79721
diff changeset
153 "Completion rules for the `ssh' command."
d3922949ea68 Phil Hagelberg <phil at evri.com>
Glenn Morris <rgm@gnu.org>
parents: 79721
diff changeset
154 (pcomplete-opt "1246AaCfgKkMNnqsTtVvXxYbcDeFiLlmOopRSw" nil t)
d3922949ea68 Phil Hagelberg <phil at evri.com>
Glenn Morris <rgm@gnu.org>
parents: 79721
diff changeset
155 (pcomplete-here (pcmpl-ssh-hosts)))
d3922949ea68 Phil Hagelberg <phil at evri.com>
Glenn Morris <rgm@gnu.org>
parents: 79721
diff changeset
156
d3922949ea68 Phil Hagelberg <phil at evri.com>
Glenn Morris <rgm@gnu.org>
parents: 79721
diff changeset
157 ;;;###autoload
d3922949ea68 Phil Hagelberg <phil at evri.com>
Glenn Morris <rgm@gnu.org>
parents: 79721
diff changeset
158 (defun pcomplete/scp ()
d3922949ea68 Phil Hagelberg <phil at evri.com>
Glenn Morris <rgm@gnu.org>
parents: 79721
diff changeset
159 "Completion rules for the `scp' command.
d3922949ea68 Phil Hagelberg <phil at evri.com>
Glenn Morris <rgm@gnu.org>
parents: 79721
diff changeset
160 Includes files as well as host names followed by a colon."
d3922949ea68 Phil Hagelberg <phil at evri.com>
Glenn Morris <rgm@gnu.org>
parents: 79721
diff changeset
161 (pcomplete-opt "1246BCpqrvcFiloPS")
d3922949ea68 Phil Hagelberg <phil at evri.com>
Glenn Morris <rgm@gnu.org>
parents: 79721
diff changeset
162 (while t (pcomplete-here (append (pcomplete-all-entries)
91644
681a1b7488c2 (top-level): Move provide statement to end.
Glenn Morris <rgm@gnu.org>
parents: 91643
diff changeset
163 (mapcar (lambda (host)
681a1b7488c2 (top-level): Move provide statement to end.
Glenn Morris <rgm@gnu.org>
parents: 91643
diff changeset
164 (concat host ":"))
681a1b7488c2 (top-level): Move provide statement to end.
Glenn Morris <rgm@gnu.org>
parents: 91643
diff changeset
165 (pcmpl-ssh-hosts))))))
91643
d3922949ea68 Phil Hagelberg <phil at evri.com>
Glenn Morris <rgm@gnu.org>
parents: 79721
diff changeset
166
91644
681a1b7488c2 (top-level): Move provide statement to end.
Glenn Morris <rgm@gnu.org>
parents: 91643
diff changeset
167 (provide 'pcmpl-unix)
91643
d3922949ea68 Phil Hagelberg <phil at evri.com>
Glenn Morris <rgm@gnu.org>
parents: 79721
diff changeset
168
91644
681a1b7488c2 (top-level): Move provide statement to end.
Glenn Morris <rgm@gnu.org>
parents: 91643
diff changeset
169 ;; arch-tag: 3f9eb5af-7e0e-449d-b586-381cbbf8fc5c
29959
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
170 ;;; pcmpl-unix.el ends here