• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/lisp/net/

Lines Matching +defs:coding +defs:system +defs:for +defs:read

1 ;;; -*- mode: Emacs-Lisp; coding: iso-2022-7bit; -*-
23 ;; GNU General Public License for more details.
42 ;; This package only works for Emacs 20 and higher, and for XEmacs 21
45 ;; package `fsf-compat' for the `with-timeout' macro.)
56 ;; There's a mailing list for this, as well. Its name is:
93 (require 'base64)) ;for the mimencode methods
111 ;; just like before.) Another reason for using a separate filename
118 Otherwise, use a separate filename syntax for Tramp.")
123 ;; tramp-ftp supports Ange-FTP only. Not suited for XEmacs therefore.
145 (unless (memq system-type '(cygwin windows-nt))
186 "*Verbosity level for tramp.el. 0 means be silent, 10 is most verbose."
207 gives the same backup policy for Tramp files on their hosts like the
208 policy for local files."
213 ;; XEmacs case. We cannot check for `bkup-backup-directory-info', because
226 gives the same backup policy for Tramp files on their hosts like the
227 policy for local files."
246 (if (memq system-type '(windows-nt))
249 "*Use this program for encoding and decoding commands on the local host.
260 variable `tramp-encoding-command-switch' for the \"-c\" part. Also, see the
261 variable `tramp-encoding-reads-stdin' to specify whether the commands read
264 Note that this variable is not used for remote commands. There are
266 use for the remote host."
274 "*Use this switch together with `tramp-encoding-shell' for local commands.
275 See the variable `tramp-encoding-shell' for more information."
280 "*If non-nil, encoding commands read from standard input.
289 "*Use this program for bootstrapping multi-hop connections.
297 in `tramp-multi-connection-function-alist' for the first hop.
314 ;;-See `comint-file-name-quote-list' for details."
521 (tramp-password-end-of-line "xy")) ;see docstring for "xy"
530 (tramp-password-end-of-line "xy")) ;see docstring for "xy"
539 (tramp-password-end-of-line "xy")) ;see docstring for "xy"
550 "*Alist of methods for remote files.
552 Each NAME stands for a remote access method. Each PARAM is a
558 of these functions for more details.
563 which groks tilde expansion, but it can search for it. Also note
564 that \"/bin/sh\" exists on all Unixen, this might not be true for
567 This specifies the name of the program to use for logging in to the
571 name of telnet or a workalike (for `tramp-open-connection-telnet'),
572 or the name of su or a workalike (for `tramp-open-connection-su').
577 here. Instead, you want two list elements, one for \"-a\" and one
578 for \"-b\", or one for \"-f\" and one for \"foo\".
582 \"%t\" is replaced by the temporary file name for `scp'-like methods.
584 This specifies the name of the program to use for remotely copying
589 program, the hints for `tramp-login-args' also apply here.
591 This specifies the parameter to use for the copying program when the
592 timestamp of the original file should be kept. For `rcp', use `-p', for
595 This specifies the string to use for terminating the line after
602 We use \"xy\" as the value for methods using \"plink\".
605 for all methods; this program is used to log in to the remote site. Then,
610 Another possibility for file transfer is inline transfer, i.e. the
614 be eight-bit clean. Therefore, file contents are encoded for transit.
615 See the variable `tramp-coding-commands' for details.
621 the associated arguments (for example, the login program if you chose
627 remote host' sounds strange, but it is used nevertheless, for
671 "*List of connection functions for multi-hop methods.
674 function to be executed, and COMMAND is the shell command used for
680 `tramp-rsh-end-of-line'. Use `%%' for a literal percent character.
684 various functions for details."
690 ;; more performant for large files, and it hasn't too serious delays
691 ;; for small files. But it must be ensured that there aren't
694 ;; package shall be active for password caching. "scpc" would be
702 (if (or (fboundp 'password-read)
710 (if (or (fboundp 'password-read)
722 "*Default method to use for transferring files.
723 See `tramp-methods' for possibilities.
730 "*Default method to use for specific user/host pairs.
732 specifies the method to use for a file name which does not specify a
738 empty string for the user name.
740 See `tramp-methods' for a list of possibilities for METHOD."
746 ;; Default values for non-Unices seeked
748 (unless (memq system-type '(windows-nt))
751 "Default list of (FUNCTION FILE) pairs to be examined for rsh methods.")
753 ;; Default values for non-Unices seeked
755 (unless (memq system-type '(windows-nt))
768 "Default list of (FUNCTION FILE) pairs to be examined for ssh methods.")
770 ;; Default values for non-Unices seeked
772 (unless (memq system-type '(windows-nt))
774 "Default list of (FUNCTION FILE) pairs to be examined for telnet methods.")
776 ;; Default values for non-Unices seeked
778 (unless (memq system-type '(windows-nt))
780 "Default list of (FUNCTION FILE) pairs to be examined for su methods.")
783 "*Alist of methods for remote files.
785 Each NAME stands for a remote access method. Each PAIR is of the form
787 names from FILE for completion. The following predefined FUNCTIONs exists:
789 * `tramp-parse-rhosts' for \"~/.rhosts\" like files,
790 * `tramp-parse-shosts' for \"~/.ssh/known_hosts\" like files,
791 * `tramp-parse-sconfig' for \"~/.ssh/config\" like files,
792 * `tramp-parse-shostkeys' for \"~/.ssh2/hostkeys/*\" like files,
793 * `tramp-parse-sknownhosts' for \"~/.ssh2/knownhosts/*\" like files,
794 * `tramp-parse-hosts' for \"/etc/hosts\" like files,
795 * `tramp-parse-passwd' for \"/etc/passwd\" like files.
796 * `tramp-parse-netrc' for \"~/.netrc\" like files.
857 "*String used for end of line in rsh connections.
867 "*String used for end of line after sending a password.
868 This variable provides the default value for the method parameter
869 `tramp-password-end-of-line', see `tramp-methods' for more details.
873 \"\\n\" after all other lines. This variable can be used for the
874 password, see `tramp-rsh-end-of-line' for the other cases.
886 "*List of directories to search for executables on remote host.
889 You can use `~' in this list, but when searching for a shell which groks
1013 "*Prefix to use for temporary files.
1017 absolute file name; don't forget to include a prefix for the filename
1035 for tilde expansion. The extra arguments should typically prevent the
1065 ;; for single-hop and multi-hop cases.
1069 Applicable for single-hop methods.
1077 Applicable for single-hop methods.
1085 Applicable for multi-hop methods.
1093 Applicable for multi-hop methods.
1101 Applicable for multi-hop methods.
1109 Applicable for multi-hop methods.
1187 similar, but for the user name. The fourth element HOST is similar,
1188 but for the host name. The fifth element FILE is for the file name.
1195 (integer :tag "Paren pair for method name")
1196 (integer :tag "Paren pair for user name ")
1197 (integer :tag "Paren pair for host name ")
1198 (integer :tag "Paren pair for file name ")))
1203 "Value for `tramp-file-name-regexp' for unified remoting.
1204 Emacs (not XEmacs) uses a unified filename syntax for Ange-FTP and
1205 Tramp. See `tramp-file-name-structure-unified' for more explanations.")
1210 "Value for `tramp-file-name-regexp' for separate remoting.
1211 XEmacs uses a separate filename syntax for Tramp and EFS.
1212 See `tramp-file-name-structure-separate' for more explanations.")
1239 "Value for `tramp-completion-file-name-regexp' for unified remoting.
1240 Emacs (not XEmacs) uses a unified filename syntax for Ange-FTP and
1241 Tramp. See `tramp-file-name-structure-unified' for more explanations.")
1246 "Value for `tramp-completion-file-name-regexp' for separate remoting.
1247 XEmacs uses a separate filename syntax for Tramp and EFS.
1248 See `tramp-file-name-structure-separate' for more explanations.")
1284 of parentheses is used for the HOP element, see below.)
1298 (integer :tag "Paren pair for method name")
1299 (integer :tag "Paren pair for hops")
1318 (integer :tag "Paren pair for method name")
1319 (integer :tag "Paren pair for user name")
1320 (integer :tag "Paren pair for host name")))
1345 copy of LOCALNAME, but there is one copy of HOP for each hop in the file
1355 "*Value of TERM environment variable for logging in to remote host.
1363 "*If nil, use shell wildcards for completion, else rely on Lisp only.
1364 Using shell wildcards for completions has the advantage that it can be
1387 variable gives the regular expression to search for. Note that the
1402 This list is used for copying/renaming with out-of-band methods.
1403 See `tramp-actions-before-shell' for more info."
1415 This list is used for each hop in multi-hop connections.
1416 See `tramp-actions-before-shell' for more info."
1427 to the bare necessity for getting the remote shell into a state
1436 ;; Chunked sending kluge. We set this to 500 for black-listed constellations
1443 (memq system-type '(hpux)))
1448 "*If non-nil, chunksize for sending input to local process.
1473 (sit-for 0))))
1479 (sit-for 30))))
1483 respectively). You can do this, for example, by pasting it into
1502 Please raise a bug report via \"M-x tramp-bug\" if your system needs
1510 ;; for an override of the system default.
1512 "Overrides `process-connection-type' for connections from Tramp.
1521 "Holds the `ls -ild' output for the current buffer.
1523 machine groks Perl. If it is used, it's used as an emulation for
1533 "Function to call for running the MD5 algorithm.")
1556 "This internal variable holds a parameter for `tramp-methods'.
1561 "This internal variable holds a parameter for `tramp-methods'.
1566 "This internal variable holds a parameter for `tramp-methods'.
1571 "This internal variable holds a parameter for `tramp-methods'.
1576 "This internal variable holds a parameter for `tramp-methods'.
1581 "This internal variable holds a parameter for `tramp-methods'.
1586 "This internal variable holds a parameter for `tramp-methods'.
1591 "This internal variable holds a parameter for `tramp-methods'.
1596 "This internal variable holds a parameter for `tramp-methods'.
1601 "This internal variable holds a parameter for `tramp-methods'.
1606 "This internal variable holds a parameter for `tramp-methods'.
1611 "This internal variable holds a parameter for `tramp-methods'.
1622 "Name of `multi' connection method for this *tramp* buffer, or nil if not multi.
1627 "Connection method for this *tramp* buffer.
1632 "Remote login name for this *tramp* buffer.
1637 "Remote host for this *tramp* buffer.
1648 "Command to use for checking if a file exists.
1660 for this or `uudecode -p', but some systems don't, and for them
1663 ;; Perl script to implement `file-attributes' in a Lisp `read'able
1703 "Perl script to produce output suitable for use with `file-attributes'
1704 on the remote file system.")
1713 for($i = 0; $i < $n; $i++)
1753 "Perl script implementing `directory-files-attributes' as Lisp `read'able
1761 ;; while (read(STDIN, $s, 45)) {
1767 ;; "Perl program to use for encoding a file.
1773 ;; "Perl program to use for decoding a file.
1779 "Perl program to use for encoding a file.
1787 "Perl program to use for decoding a file.
1808 # We read in chunks of 54 bytes, to generate output lines
1815 # Only for the last chunk, and only if did not fill the last three-byte packet
1832 "Perl program to use for encoding a file.
1878 "Perl program to use for decoding a file.
1897 "A list of file types returned from the `stat' system call.
1900 (defvar tramp-dos-coding-system
1901 (if (and (fboundp 'coding-system-p)
1902 (funcall 'coding-system-p '(dos)))
1905 "Some Emacsen know the `dos' coding system, others need `undecided-dos'.")
1921 ;; I use instead of find-operation-coding-system in XEmacs?
1923 (when (fboundp 'find-operation-coding-system)
1924 (let ((file-coding-system-alist '(("test" emacs-mule))))
1925 (funcall (symbol-function 'find-operation-coding-system)
1927 "Internal variable to say if `write-region' chooses the right coding.
1928 Older versions of Emacs chose the coding system for `write-region' based
1986 ;; Handlers for partial tramp file names. For Emacs just
1993 Used for file names matching `tramp-file-name-regexp'. Operations not
1997 ;; Handlers for foreign methods, like FTP or SMB, shall be plugged here.
2002 "Alist of elements (FUNCTION . HANDLER) for foreign methods handled specially.
2031 (defun tramp-message-for-buffer
2054 the filename structure. It is also used as a prefix for the variables
2057 be bound to the multi-method component, and so on for `foo-method',
2100 "Sets the list of completion functions for METHOD.
2125 ;; Check for function and file
2136 "Returns list of completion functions for METHOD.
2144 "Like `make-symbolic-link' for tramp files.
2151 this can give surprising results if the user/host for the source and
2193 "Like `load' for tramp files. Not implemented!"
2203 ;; The first condition is always true for absolute file names.
2204 ;; Included for safety's sake.
2239 "Like `file-truename' for tramp files."
2242 (localnamedir (tramp-let-maybe directory-sep-char ?/ ;for XEmacs
2254 (tramp-message-for-buffer
2256 10 "Finding true name for `%s'" filename)
2259 (tramp-message-for-buffer
2275 (tramp-message-for-buffer multi-method method user host
2278 (tramp-message-for-buffer multi-method method user host
2283 (tramp-message-for-buffer
2316 (tramp-message-for-buffer
2325 "Like `file-exists-p' for tramp files."
2338 ;; (-1 x), whereby "x" is unique for a given (multi-method method user host).
2342 ;; CCC: This should check for an error condition and signal failure
2346 "Like `file-attributes' for tramp files."
2362 "Implement `file-attributes' for tramp files using the ls(1) command."
2366 (tramp-message-for-buffer multi-method method user host 10
2376 (tramp-wait-for-output)
2381 (read (current-buffer))
2382 (invalid-read-syntax
2388 (let* ((big (read (substring (caddr err) 0
2390 (small (read (match-string 1 (caddr err))))
2395 (setq res-filemodes (symbol-name (read (current-buffer))))
2397 (setq res-numlinks (read (current-buffer)))
2399 (setq res-uid (read (current-buffer)))
2400 (setq res-gid (read (current-buffer)))
2405 (setq res-size (read (current-buffer)))
2417 ;; 0. t for directory, string (name linked to) for symbolic
2447 "Implement `file-attributes' for tramp files using a Perl script."
2448 (tramp-message-for-buffer multi-method method user host 10
2458 (tramp-wait-for-output)
2459 (read (current-buffer)))
2462 "Like `set-visited-file-modtime' for tramp files."
2469 coding-system-used)
2474 (when (boundp 'last-coding-system-used)
2475 (setq coding-system-used (symbol-value 'last-coding-system-used)))
2486 (tramp-wait-for-output)
2490 (when (boundp 'last-coding-system-used)
2491 (set 'last-coding-system-used coding-system-used))
2499 "Like `verify-visited-file-modtime' for tramp files.
2537 (tramp-wait-for-output)
2546 "Like `set-file-modes' for tramp files."
2563 "Like `file-executable-p' for tramp files."
2568 "Like `file-readable-p' for tramp files."
2573 "Like `file-accessible-directory-p' for tramp files."
2579 ;; When the remote shell is started, it looks for a shell which groks
2581 ;; expansion will also provide a `test' command which groks `-nt' (for
2585 "Like `file-newer-than-file-p' for tramp files."
2636 "Like `file-modes' for tramp files."
2643 "Like `file-directory-p' for tramp files."
2644 ;; Care must be taken that this function returns `t' for symlinks
2646 ;; would be `test -d', but that returns false for such symlinks.
2662 "Like `file-regular-p' for tramp files."
2668 "Like `file-symlink-p' for tramp files."
2680 "Like `file-writable-p' for tramp files."
2692 "Like `file-ownership-preserved-p' for tramp files."
2705 ;; "Like `directory-file-name' for tramp files."
2713 ;; "Like `directory-file-name' for tramp files."
2724 "Like `directory-file-name' for tramp files."
2740 "Like `directory-files' for tramp files."
2755 (tramp-wait-for-output)
2767 (tramp-wait-for-output)
2769 ;; the remote shell for this would probably be way faster.
2791 "Like `directory-files-and-attributes' for tramp files."
2803 (tramp-wait-for-output)
2804 (let* ((root (cons nil (let ((object (read (current-buffer))))
2824 ;; This function should return "foo/" for directories and "bar" for
2829 "Like `file-name-all-completions' for tramp files."
2847 (format (concat "%s -a %s 2>/dev/null | while read f; do "
2857 (tramp-wait-for-output)
2865 (tramp-wait-for-output)
2873 ;; The following isn't needed for Emacs 20 but for 19.34?
2876 "Like `file-name-completion' for tramp files."
2891 "Like `add-name-to-file' for tramp files."
2902 "only implemented for same method, same user, same host"))
2916 "error with add-name-to-file, see buffer `%s' for details"
2921 "Like `copy-file' for tramp files."
2923 ;; Otherwise, use tramp from local system.
2937 "Like `rename-file' for tramp files."
2939 ;; Otherwise, use tramp from local system.
2955 the new file (for copy) or the new name of the file (for rename).
2998 ;; Shortcut: if method, host, user are the same for both
3029 ;; matter which filename handlers are used for the
3071 (let ((coding-system-for-write 'binary)
3087 "Invokes `cp' or `mv' on the remote system.
3106 (tramp-wait-for-output)
3117 (format "Copying directly failed, see buffer `%s' for details."
3234 ;; Check for program.
3246 ;; Use rcp-like program for file transfer.
3271 "Like `make-directory' for tramp files."
3285 "Like `delete-directory' for tramp files."
3293 (tramp-wait-for-output))))
3296 "Like `delete-file' for tramp files."
3312 This is like `dired-recursive-delete-directory' for tramp files."
3315 ;; Code shamelessly stolen for the dired implementation and, um, hacked :)
3320 ;; Which is better, -r or -R? (-r works for me <daniel@danann.net>)
3323 ;; Wait for the remote system to return to us...
3325 (tramp-wait-for-output 120)
3331 "Like `dired-call-process' for tramp files."
3343 (tramp-wait-for-output))
3356 (tramp-wait-for-output)))))
3359 "Like `dired-compress-file' for tramp files."
3360 ;; OK-FLAG is valid for XEmacs only, but not implemented.
3415 ;; it works for now, and wait for a guru to point out the Right Way to
3423 ;; It is only needed on XEmacs for the function
3428 "Like `insert-directory' for tramp files."
3440 (tramp-message-for-buffer
3484 (sit-for 1) ;needed for rsh but not ssh?
3485 (tramp-wait-for-output))
3487 ;; out. Let's leave the let-binding in for a while to see
3506 (tramp-wait-for-output))
3525 "Like `unhandled-file-name-directory' for tramp files."
3534 locally on a remote file name. When the local system is a W32 system
3535 but the remote system is Unix, this introduces a superfluous drive
3548 "Like `expand-file-name' for tramp files.
3568 ;; tell me about it when this doesn't work on your system.
3575 ;; the default user name for tilde expansion is not
3590 (tramp-wait-for-output)
3595 ;; There might be a double slash, for example when "~/"
3601 ;; directory-sep-char here for XEmacs on Windows, which would
3622 ;; ;; directory-sep-char here for XEmacs on Windows, which
3639 This is necessary for handling DISPLAY of `process-file'.")
3642 "Like `shell-command' for tramp files.
3646 ;; for `find-grep-dired' and `find-name-dired' in Emacs 22.
3709 (tramp-wait-for-output)))
3725 (tramp-wait-for-output)
3737 (tramp-wait-for-output))
3743 (tramp-wait-for-output)
3748 (setq status (read (current-buffer)))))
3762 "Like `process-file' for Tramp files."
3782 "Like `file-local-copy' for tramp files."
3806 ;; Use inline encoding for file transfer.
3808 ;; Following line for setting tramp-current-method,
3816 "Encoding remote file failed, see buffer `%s' for details"
3835 (tramp-message-for-buffer
3843 ;; search backward for tramp_exit_status, delete
3845 (let ((coding-system-for-write 'binary))
3849 ;; If tramp-decoding-function is not defined for this
3856 (tramp-call-local-coding-command
3859 (tramp-message-for-buffer
3865 (t (error "Wrong method specification for `%s'" method)))
3869 "Like `file-remote-p' for tramp files."
3881 "Like `insert-file-contents' for tramp files."
3882 (barf-if-buffer-read-only)
3903 coding-system-used result)
3908 (tramp-message-for-buffer
3912 ;; Now `last-coding-system-used' has right value. Remember it.
3913 (when (boundp 'last-coding-system-used)
3914 (setq coding-system-used (symbol-value 'last-coding-system-used)))
3915 (tramp-message-for-buffer
3919 (when (boundp 'last-coding-system-used)
3920 (set 'last-coding-system-used coding-system-used))
3926 "Like `find-backup-file-name' for tramp files."
3969 "Like `make-auto-save-file-name' for tramp files.
3970 Returns a file name in `tramp-auto-save-directory' for autosaving this file."
3973 ;; UNIQUIFY element of `auto-save-file-name-transforms'); but for
3988 ;; file name we make sure that jka-compr isn't used for the
4020 "Like `write-region' for tramp files."
4033 ;; XEmacs takes a coding system as the seventh argument, not `confirm'
4047 ;; We use this to save the value of `last-coding-system-used'
4049 ;; we set `last-coding-system-used' to this saved value.
4050 ;; This way, any intermediary coding systems used while
4053 coding-system-used
4067 (if confirm ; don't pass this arg unless defined for backward compat.
4070 ;; Now, `last-coding-system-used' has the right value. Remember it.
4071 (when (boundp 'last-coding-system-used)
4072 (setq coding-system-used (symbol-value 'last-coding-system-used)))
4078 ;; This is a bit lengthy due to the different methods possible for
4082 ;; _also_ specifies an encoding function, then that is used for
4093 (tramp-message-for-buffer multi-method method user host
4100 (tramp-message-for-buffer
4105 ;; CCC. The following `let' is a workaround for
4120 (tramp-message-for-buffer
4123 (unless (equal 0 (tramp-call-local-coding-command
4132 (tramp-message-for-buffer
4141 (tramp-message-for-buffer
4146 ;; wait for remote decoding to complete
4147 (tramp-message-for-buffer
4152 (tramp-message-for-buffer
4154 "Waiting for remote host to process data...")
4156 (tramp-wait-for-output)
4179 ;; Make `last-coding-system-used' have the right value.
4180 (when (boundp 'last-coding-system-used)
4181 (set 'last-coding-system-used coding-system-used))
4189 ;; TRAMP file name) it is needed to disable efs as well as tramp for the
4198 ;; 1) That EFS may not be completely dead (yet) for TRAMP filenames
4205 ;; "Invoke normal file name handler for OPERATION.
4220 "Invoke normal file name handler for OPERATION.
4236 ;; because the check is based on a full filename, not available for all
4240 "Invoke `tramp-file-name-handler' for OPERATION.
4254 ;; name as first parameter; nevertheless we check for them explicitly
4260 (defun tramp-file-name-for-operation (operation &rest args)
4351 (let* ((filename (apply 'tramp-file-name-for-operation operation args))
4365 ;; Nothing to do for us.
4487 "Like `PC-expand-many-files' for tramp files."
4505 ;;- (tramp-wait-for-output))
4508 (tramp-wait-for-output)
4526 (read (current-buffer))))))
4533 "Invoke `tramp-handle-expand-many-files' for tramp files."
4540 ;;; File name handler functions for completion mode
4550 ;; might require loading other files, like "~/.netrc", and for them it
4597 "Like `file-name-all-completions' for partial tramp files."
4669 ;; Method, host name and user name completion for a file.
4673 "Like `file-name-completion' for tramp files."
4681 ;; completion possibilities for partial methods / user names / host names.
4796 "Returns all method completions for PARTIAL-METHOD."
4806 "Returns the most expanded string for user and host name completion.
5073 (tramp-wait-for-output)
5092 "Run `test' on the remote system, given a SWITCH and a FILENAME.
5103 "Run `test'-like PROGRAM on the remote system, given FILE1, FILE2.
5125 "only implemented for same method, same user, same host"))
5159 (error "tramp-touch: touch failed, see buffer `%s' for details"
5169 "A name for the connection buffer for USER at HOST using METHOD."
5178 "A name for the multi method connection buffer.
5200 "Get the connection buffer to be used for USER at HOST using METHOD."
5207 "A name for the debug buffer for USER at HOST using METHOD."
5217 "Get the debug buffer for USER at HOST using METHOD."
5226 "Searches for PROGNAME in all directories mentioned in DIRLIST.
5228 is the program to search for, and DIRLIST gives the list of directories
5248 (format (concat "while read d; "
5257 (tramp-wait-for-output)
5266 I.e., for each directory in DIRLIST, it is tested whether it exists and if
5283 (tramp-wait-for-output)))
5288 "Find a command on the remote host for checking if a file exists.
5289 Here, we are looking for a command which has zero exit status if the
5310 ;; status, even for files which don't exist.
5334 ;; CCC test ksh or bash found for tilde expansion?
5339 (tramp-wait-for-output)
5349 ;; Find arguments for this shell.
5358 5 "Starting remote shell `%s' for tilde expansion..." shell)
5376 (tramp-wait-for-output)
5389 (tramp-message 9 "Checking remote `%s' command for `-n' option" cmd)
5393 (tramp-message 7 "Testing remote command `%s' for -n..." cmd)
5399 (tramp-message 7 "Testing remote command `%s' for -n...%s"
5409 (tramp-let-maybe directory-sep-char ?/ ;for XEmacs
5429 ;; -- Functions for establishing connection --
5434 ;; `tramp-actions-before-shell' for usage of these functions.
5445 "Query the user for a password."
5447 (format "Password for %s "
5472 "Ask the user for confirmation using `yes-or-no-p'.
5485 "Ask the user for confirmation using `y-or-n-p'.
5531 ;; The following functions are specifically for multi connections.
5540 "Query the user for a password."
5542 (format "Password for %s "
5566 ;; Functions for processing the actions.
5569 "Wait for output from the shell and perform one action."
5572 (tramp-message 9 "Waiting 60s for prompt from remote shell")
5582 (tramp-message 10 "Looking for regexp \"%s\" from remote shell"
5594 (tramp-message 9 "Waiting for prompts from remote shell")
5611 "Wait for output from the shell and perform one action."
5614 (tramp-message 9 "Waiting 60s for prompt from remote shell")
5625 (tramp-message 10 "Looking for regexp \"%s\" from remote shell"
5635 (tramp-message 9 "Waiting for prompts from remote shell")
5648 ;; okay for some commands to just fail with an error message, but
5666 ;; The actual functions for opening connections.
5670 This starts the command `telnet HOST ARGS'[*], then waits for a remote
5671 login prompt, then sends the user name USER, then waits for a remote
5672 password prompt. It queries the user for the password, then sends the
5696 (tramp-message 7 "Opening connection for %s@%s using %s..."
5705 (coding-system-for-read (unless (and (not (featurep 'xemacs))
5707 tramp-dos-coding-system))
5734 This starts the command `rsh HOST -l USER'[*], then waits for a remote
5736 queried for a password, this function sends the password to the remote
5737 host and waits for a shell prompt.
5746 be a port number for ssh, and \"-p yy\" will be added to the list of
5756 (tramp-message 7 "Opening connection for %s@%s using %s..."
5786 (coding-system-for-read (unless (and (not (featurep 'xemacs))
5788 tramp-dos-coding-system))
5807 This starts `su - USER', then waits for a password prompt. The HOST
5822 (system-name))
5829 (tramp-message 7 "Opening connection for `%s' using `%s'..."
5838 (coding-system-for-read (unless (and (not (featurep 'xemacs))
5840 tramp-dos-coding-system))
5869 ;; This is more difficult than for the single-hop method. In the
5871 ;; user must specify names for the telnet hops of which the user
5886 (error "METHOD must be an array of strings for multi methods"))
5888 (error "USER must be an array of strings for multi methods"))
5890 (error "HOST must be an array of strings for multi methods"))
5903 (coding-system-for-read (unless (and (not (featurep 'xemacs))
5905 tramp-dos-coding-system))
5912 (tramp-message 9 "Waiting 60s for local shell to come up...")
5913 (unless (tramp-wait-for-regexp
6016 "Like `accept-process-output' for Tramp processes.
6017 This is needed in order to hide `last-coding-system-used', which is set
6018 for process communication also."
6019 (let (last-coding-system-used)
6022 (defun tramp-wait-for-regexp (proc timeout regexp)
6023 "Wait for a REGEXP to appear from process PROC within TIMEOUT seconds.
6032 ;; to polling for buggy XEmacsen, but oh, well.
6066 (defun tramp-wait-for-shell-prompt (proc timeout)
6067 "Wait for the shell prompt to appear from process PROC within TIMEOUT seconds.
6068 See `tramp-wait-for-regexp' for more details.
6071 (tramp-wait-for-regexp
6077 "Wait for shell prompt and barf if none appears.
6080 (unless (tramp-wait-for-shell-prompt proc timeout)
6085 "Prompt for a password and send it to the remote end.
6087 (let ((pw (tramp-read-passwd user host prompt)))
6122 (sit-for 1)
6127 ;; some people have a setting for $PS1 which /bin/sh doesn't know
6135 ;; because that is read by some sh implementations (eg, bash when
6148 "Remote `%s' didn't come up. See buffer `%s' for details"
6164 ;; This is known for FreeBSD (see comment in `send_process', file process.c).
6169 (tramp-message 9 "Checking remote host type for `send-process-string' bug")
6176 ;; Try to set up the coding system correctly.
6180 (tramp-message 9 "Determining coding system")
6185 ;; Use MULE to select the right EOL convention for communicating
6187 (let* ((cs (or (process-coding-system p) (cons 'undecided 'undecided)))
6194 (setq cs-encode (tramp-coding-system-change-eol-conversion
6197 (setq cs-decode (tramp-coding-system-change-eol-conversion
6199 (set-buffer-process-coding-system cs-decode cs-encode))
6200 ;; Look for ^M and do something useful if found.
6202 ;; We have found a ^M but cannot frob the process coding system
6211 9 "Waiting 30s for `HISTFILE=$HOME/.tramp_history; HISTSIZE=1; export HISTFILE; export HISTSIZE'")
6216 (tramp-message 9 "Waiting 30s for `set +o vi +o emacs'")
6220 (tramp-message 9 "Waiting 30s for `unset MAIL MAILCHECK MAILPATH'")
6225 (tramp-message 9 "Waiting 30s for `unset CDPATH'")
6241 (tramp-wait-for-output))
6249 ;; Search for a good shell before searching for a command which
6258 ;; Without (sit-for 0.1) at least, my machine will almost always blow
6263 ;; I can't work out why this is a problem though. The (tramp-wait-for-output)
6267 ;; of that function though. The workaround stays for me at least. :/
6270 (sleep-for 1)
6284 (tramp-message 5 "Using remote command `%s' for getting directory listings"
6290 (tramp-wait-for-output)
6293 ;; Tell remote shell to use standard time format, needed for
6297 (tramp-wait-for-output)
6300 (tramp-wait-for-output)
6303 (tramp-wait-for-output)
6308 (tramp-wait-for-output)
6311 ;; for otherwise the shell crashes.
6316 (tramp-wait-for-output)
6326 (tramp-wait-for-output)
6330 (tramp-wait-for-output)
6350 (tramp-wait-for-output)
6357 (tramp-wait-for-output)
6365 (tramp-wait-for-output)
6372 (tramp-wait-for-output))))
6382 (tramp-wait-for-output)
6385 "uid" (read (current-buffer)) multi-method method user host)
6387 "gid" (read (current-buffer)) multi-method method user host)
6411 (tramp-wait-for-output)
6414 (error "Remote host cannot execute de/encoding commands. See buffer `%s' for details"
6429 ;; Unix versions. But if you can't use base64 for some reason, please
6430 ;; note that the default uudecode command does not work well for some
6432 ;; the following command for uudecode:
6438 (defvar tramp-coding-commands
6457 "List of coding commands for inline transfer.
6472 specifier is not present, the input should be read from standard
6481 Goes through the list `tramp-coding-commands'."
6482 (let ((commands tramp-coding-commands)
6496 ;; for two reaons: when checking the decoding command, we
6500 (tramp-message-for-buffer
6502 "Checking remote encoding command `%s' for sanity" rem-enc)
6507 (tramp-message-for-buffer
6509 "Checking remote decoding command `%s' for sanity" rem-dec)
6522 (tramp-message-for-buffer
6524 "Checking local encoding command `%s' for sanity" loc-enc)
6525 (unless (zerop (tramp-call-local-coding-command
6529 (tramp-message-for-buffer
6531 "Checking local decoding command `%s' for sanity" loc-dec)
6532 (unless (zerop (tramp-call-local-coding-command
6536 ;; of the commands is correct. But for the moment we will
6557 (defun tramp-call-local-coding-command (cmd input output)
6580 connection if a previous connection has died for some reason."
6599 (tramp-wait-for-output 10))
6639 "Send command to remote host and wait for success.
6640 Sends COMMAND, then waits 30 seconds for shell prompt."
6643 (tramp-message 9 "Waiting 30s for %s..." msg))
6648 (defun tramp-wait-for-output (&optional timeout)
6649 "Wait for output from remote rsh command."
6666 ;; for buggy XEmacsen, but oh, well.
6692 ;; If processing echoes, look for it in the first line and delete.
6721 Sends `echo $?' along with the COMMAND for checking the exit status. If
6732 (tramp-wait-for-output)
6737 (read (current-buffer)))
6753 ;; `file-attributes' implementation, for instance.) Therefore, we
6785 (tramp-message-for-buffer
6792 (sleep-for 0.1)))
6828 (owner-read (aref mode-chars 1))
6831 (group-read (aref mode-chars 4))
6834 (other-read (aref mode-chars 7))
6839 (case owner-read
6841 (t (error "Second char `%c' must be one of `r-'" owner-read)))
6852 (case group-read
6854 (t (error "Fifth char `%c' must be one of `r-'" group-read)))
6865 (case other-read
6867 (t (error "Eighth char `%c' must be one of `r-'" other-read)))
6953 ;; Kudos to Gerd Moellmann for this suggestion.
6977 ;; internal data structure. Convenience functions for internal
7091 "Constructs a tramp file name for a multi-hop method."
7163 "Get the named property for the connection.
7164 If the value is not set for the connection, return `default'"
7245 "Invoke `tramp-handle-make-auto-save-file-name' for tramp files."
7303 "Return name of directory for temporary files (compat function).
7304 For Emacs, this is the variable `temporary-file-directory', for XEmacs
7321 (defun tramp-read-passwd (user host prompt)
7323 Invokes `password-read' if available, `read-passwd' else."
7324 (if (functionp 'password-read)
7326 (password (apply #'password-read (list prompt key))))
7329 (read-passwd prompt)))
7332 "Clear password cache for connection related to current-buffer."
7340 (lhost (or host (tramp-file-name-host v) (system-name)))
7346 T1 and T2 are time values (as returned by `current-time' for example)."
7370 (defun tramp-coding-system-change-eol-conversion (coding-system eol-type)
7371 "Return a coding system like CODING-SYSTEM but with given EOL-TYPE.
7373 (cond ((fboundp 'coding-system-change-eol-conversion)
7374 (apply #'coding-system-change-eol-conversion
7375 (list coding-system eol-type)))
7376 ((fboundp 'subsidiary-coding-system)
7378 #'subsidiary-coding-system
7379 (list coding-system
7395 Note: this function has been written for `tramp-handle-file-truename'.
7396 If you want to use it for something else, you'll have to check whether
7401 "Specify if query is needed for process when Emacs is exited.
7431 ;; kludges section, we bind `system-type' in such a way that
7434 ;; Thanks to Mario DeWeerd for the hint that it is sufficient for this
7442 Only works for Bourne-like shells."
7443 (let ((system-type 'not-windows))
7511 ;; Make the `reporter` functionality available for making bug reports about
7522 (let ((reporter-prompt-for-summary-p t))
7558 tramp-coding-commands
7597 reliably, please include those. Thank you for helping kill bugs in
7610 Used for non-7bit chars in strings."
7644 "Load needed modules for reporting."
7678 (setq buffer-read-only nil)
7702 (setq buffer-read-only t)
7727 ;; Checklist for `tramp-unload-hook'
7765 ;; parameters in filenames. There is currently a kludge for
7766 ;; putting the port number into the filename for ssh and ftp
7768 ;; Another approach is to read a netrc file like ~/.authinfo
7772 ;; * Add fallback for inline encodings. This should be used
7779 ;; for the "dangerous" characters. The null byte might be a problem.
7784 ;; * Separate local `tramp-coding-commands' from remote ones. Connect
7786 ;; for the right local commands and the right remote commands separately.
7788 ;; work for remote files.
7796 ;; * When logging in, keep looking for questions according to an alist
7803 ;; * Don't use globbing for directories with many files, as this is
7814 ;; * Grok `append' parameter for `write-region'.
7815 ;; * Test remote ksh or bash for tilde expansion in `tramp-find-shell'?
7823 ;; * Add caching for filename completion. (Greg Stark)
7826 ;; * Provide a local cache of old versions of remote files for the rsync
7829 ;; * Invoke rsync once for copying a whole directory hierarchy.
7833 ;; * Make it work for XEmacs 20, which is missing `with-timeout'.
7834 ;; * Make it work for different encodings, and for different file name
7841 ;; * `Smart' connection method that uses inline for small and out of
7842 ;; band for large files. (Michael Kifer)
7843 ;; * Don't search for perl5 and perl. Instead, only search for perl and
7849 ;; for the source and the target file are different. Right now,
7851 ;; there is one. But since ange-ftp, for instance, does not know
7859 ;; ** Extend `tramp-get-completion-su' for NIS and shadow passwords.
7862 ;; ** Decide whiche files to take for searching user/host names depending on
7863 ;; operating system (windows-nt) in `tramp-completion-function-alist'.
7864 ;; ** Enhance variables for debug.
7866 ;; ** Add a learning mode for completion. Make results persistent.
7869 ;; Functions for file-name-handler-alist: