annotate lisp/net/tramp-cmds.el @ 110264:ec526909f60b

Migrate to Tramp 2.2. Rearrange load dependencies. (Bug#1529, Bug#5448, Bug#5705) * Makefile.in (TRAMP_DIR, TRAMP_SRC): New variables. ($(TRAMP_DIR)/tramp-loaddefs.el): New target. (LOADDEFS): Add $(lisp)/net/tramp-loaddefs.el. * net/tramp.el (top): Remove all other tramp-* loads except tramp-compat.el. Remove all changes to tramp-unload-hook for other tramp-* packages. Rearrange defun order. Change calls of `tramp-compat-call-process', `tramp-compat-decimal-to-octal', `tramp-compat-octal-to-decimal' to new function names. (tramp-terminal-type, tramp-initial-end-of-output) (tramp-methods, tramp-foreign-file-name-handler-alist) (tramp-tramp-file-p, tramp-completion-mode-p) (tramp-send-command-and-check, tramp-get-remote-path) (tramp-get-remote-tmpdir, tramp-get-remote-ln) (tramp-shell-quote-argument): Set tramp-autoload cookie. (with-file-property, with-connection-property): Move to tramp-cache.el. (tramp-local-call-process, tramp-decimal-to-octal) (tramp-octal-to-decimal): Move to tramp-compat.el. (tramp-handle-shell-command): Do not require 'shell. (tramp-compute-multi-hops): No special handling for tramp-gw-* symbols. (tramp-unload-tramp): Do not call `tramp-unload-file-name-handlers'. * net/tramp-cache.el (top): Require 'tramp. Add to `tramp-unload-hook'. (tramp-cache-data, tramp-get-file-property) (tramp-set-file-property, tramp-flush-file-property) (tramp-flush-directory-property, tramp-get-connection-property) (tramp-set-connection-property, tramp-flush-connection-property) (tramp-cache-print, tramp-list-connections): Set tramp-autoload cookie. (with-file-property, with-connection-property): New defuns, moved from tramp.el. (tramp-flush-file-function): Use `with-parsed-tramp-file-name' macro. * net/tramp-cmds.el (top): Add to `tramp-unload-hook'. (tramp-version): Set tramp-autoload cookie. * net/tramp-compat.el (top): Require 'tramp-loaddefs. Remove all changes to tramp-unload-hook for other tramp-* packages. Add to `tramp-unload-hook'. (tramp-compat-decimal-to-octal, tramp-compat-octal-to-decimal) (tramp-compat-call-process): New defuns, moved from tramp.el. * net/tramp-fish.el (top) Require just 'tramp. Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. Change call of `tramp-compat-decimal-to-octal' to new function name. (tramp-fish-method): Make it a defconst. (tramp-fish-file-name-p): Make it a defsubst. (tramp-fish-method, tramp-fish-file-name-handler) (tramp-fish-file-name-p): Set tramp-autoload cookie. * net/tramp-ftp.el (top) Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. (tramp-ftp-method): Make it a defconst. (tramp-ftp-file-name-p): Make it a defsubst. (tramp-ftp-method, tramp-ftp-file-name-handler) (tramp-ftp-file-name-p): Set tramp-autoload cookie. * net/tramp-gvfs.el (top) Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. Change checks, whether package can be loaded. (tramp-gvfs-file-name-p): Make it a defsubst. (tramp-gvfs-methods, tramp-gvfs-file-name-handler) (tramp-gvfs-file-name-p): Set tramp-autoload cookie. (tramp-gvfs-handle-file-directory-p): New defun. (tramp-gvfs-file-name-handler-alist): Use it. * net/tramp-gw.el (top) Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. (tramp-gw-tunnel-method, tramp-gw-default-tunnel-port) (tramp-gw-socks-method, tramp-gw-default-socks-port): Make it a defconst. (tramp-gw-tunnel-method, tramp-gw-socks-method) (tramp-gw-open-connection): Set tramp-autoload cookie. * net/tramp-imap.el (top) Require just 'tramp. Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. Change checks, whether package can be loaded. (tramp-imap-file-name-p): Make it a defsubst. (tramp-imap-method, tramp-imaps-method) (tramp-imap-file-name-handler) (tramp-imap-file-name-p): Set tramp-autoload cookie. * net/tramp-smb.el (top) Require just 'tramp. Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. Change checks, whether package can be loaded. Change call of `tramp-compat-decimal-to-octal' to new function name. (tramp-smb-tunnel-method): Make it a defconst. (tramp-smb-file-name-p): Make it a defsubst. (tramp-smb-method, tramp-smb-file-name-handler) (tramp-smb-file-name-p): Set tramp-autoload cookie. * net/tramp-uu.el (top) Add to `tramp-unload-hook'. (tramp-uuencode-region): Set tramp-autoload cookie. * net/trampver.el (top) Add to `tramp-unload-hook'. (tramp-version, tramp-bug-report-address): Set tramp-autoload cookie. Update release number.
author Michael Albinus <michael.albinus@gmx.de>
date Wed, 08 Sep 2010 16:42:54 +0200
parents 280c8ae2476d
children ba4844f77a64
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
85508
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1 ;;; tramp-cmds.el --- Interactive commands for Tramp
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
2
106815
1d1d5d9bd884 Add 2010 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 103528
diff changeset
3 ;; Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
85508
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
4
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
5 ;; Author: Michael Albinus <michael.albinus@gmx.de>
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
6 ;; Keywords: comm, processes
110015
280c8ae2476d Add "Package:" file headers to denote built-in packages.
Chong Yidong <cyd@stupidchicken.com>
parents: 109563
diff changeset
7 ;; Package: tramp
85508
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
8
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
9 ;; This file is part of GNU Emacs.
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
10
94677
91e5880a36c1 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 91532
diff changeset
11 ;; GNU Emacs is free software: you can redistribute it and/or modify
85508
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
12 ;; it under the terms of the GNU General Public License as published by
94677
91e5880a36c1 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 91532
diff changeset
13 ;; the Free Software Foundation, either version 3 of the License, or
91e5880a36c1 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 91532
diff changeset
14 ;; (at your option) any later version.
85508
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
15
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
16 ;; GNU Emacs is distributed in the hope that it will be useful,
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
19 ;; GNU General Public License for more details.
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
20
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
94677
91e5880a36c1 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 91532
diff changeset
22 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
85508
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
23
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
24 ;;; Commentary:
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
25
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
26 ;; This package provides all interactive commands which are releated
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
27 ;; to Tramp.
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
28
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
29 ;;; Code:
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
30
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
31 (require 'tramp)
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
32
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
33 (defun tramp-list-tramp-buffers ()
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
34 "Return a list of all Tramp connection buffers."
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
35 (append
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
36 (all-completions
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
37 "*tramp" (mapcar 'list (mapcar 'buffer-name (buffer-list))))
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
38 (all-completions
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
39 "*debug tramp" (mapcar 'list (mapcar 'buffer-name (buffer-list))))))
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
40
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
41 (defun tramp-list-remote-buffers ()
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
42 "Return a list of all buffers with remote default-directory."
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
43 (delq
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
44 nil
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
45 (mapcar
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
46 (lambda (x)
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
47 (with-current-buffer x
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
48 (when (and (stringp default-directory)
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
49 (file-remote-p default-directory))
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
50 x)))
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
51 (buffer-list))))
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
52
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
53 (defun tramp-cleanup-connection (vec)
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
54 "Flush all connection related objects.
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
55 This includes password cache, file cache, connection cache, buffers.
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
56 When called interactively, a Tramp connection has to be selected."
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
57 (interactive
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
58 ;; When interactive, select the Tramp remote identification.
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
59 ;; Return nil when there is no Tramp connection.
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
60 (list
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
61 (let ((connections
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
62 (mapcar
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
63 (lambda (x)
85943
85b6f7d4aca8 * net/tramp.el (top): Don't autoload `tramp-cache-print'.
Michael Albinus <michael.albinus@gmx.de>
parents: 85694
diff changeset
64 (tramp-make-tramp-file-name
85b6f7d4aca8 * net/tramp.el (top): Don't autoload `tramp-cache-print'.
Michael Albinus <michael.albinus@gmx.de>
parents: 85694
diff changeset
65 (tramp-file-name-method x)
85b6f7d4aca8 * net/tramp.el (top): Don't autoload `tramp-cache-print'.
Michael Albinus <michael.albinus@gmx.de>
parents: 85694
diff changeset
66 (tramp-file-name-user x)
85b6f7d4aca8 * net/tramp.el (top): Don't autoload `tramp-cache-print'.
Michael Albinus <michael.albinus@gmx.de>
parents: 85694
diff changeset
67 (tramp-file-name-host x)
85b6f7d4aca8 * net/tramp.el (top): Don't autoload `tramp-cache-print'.
Michael Albinus <michael.albinus@gmx.de>
parents: 85694
diff changeset
68 (tramp-file-name-localname x)))
85962
7f134b676a0c * net/tramp.el (tramp-handle-substitute-in-file-name): Don't
Michael Albinus <michael.albinus@gmx.de>
parents: 85943
diff changeset
69 (tramp-list-connections)))
85508
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
70 name)
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
71
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
72 (when connections
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
73 (setq name
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
74 (completing-read
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
75 "Enter Tramp connection: " connections nil t
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
76 (try-completion "" connections)))
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
77 (when (and name (file-remote-p name))
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
78 (with-parsed-tramp-file-name name nil v))))))
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
79
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
80 (if (not vec)
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
81 ;; Nothing to do.
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
82 (message "No Tramp connection found.")
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
83
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
84 ;; Flush password cache.
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
85 (tramp-clear-passwd vec)
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
86
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
87 ;; Flush file cache.
102969
a8c41d72ae8a * net/tramp-cmds.el (tramp-cleanup-connection): Flush cache data
Michael Albinus <michael.albinus@gmx.de>
parents: 100908
diff changeset
88 (tramp-flush-directory-property vec "")
85508
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
89
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
90 ;; Flush connection cache.
91532
c4baafae1dc1 (tramp-cleanup-connection): Update calls to
Glenn Morris <rgm@gnu.org>
parents: 87665
diff changeset
91 (tramp-flush-connection-property (tramp-get-connection-process vec))
c4baafae1dc1 (tramp-cleanup-connection): Update calls to
Glenn Morris <rgm@gnu.org>
parents: 87665
diff changeset
92 (tramp-flush-connection-property vec)
85508
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
93
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
94 ;; Remove buffers.
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
95 (dolist
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
96 (buf (list (get-buffer (tramp-buffer-name vec))
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
97 (get-buffer (tramp-debug-buffer-name vec))
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
98 (tramp-get-connection-property vec "process-buffer" nil)))
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
99 (when (bufferp buf) (kill-buffer buf)))))
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
100
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
101 (defun tramp-cleanup-all-connections ()
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
102 "Flush all Tramp internal objects.
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
103 This includes password cache, file cache, connection cache, buffers."
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
104 (interactive)
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
105
95964
c8848a020b33 * net/tramp-cmds.el (tramp-cleanup-all-connections): Reset
Michael Albinus <michael.albinus@gmx.de>
parents: 94677
diff changeset
106 ;; Unlock Tramp.
c8848a020b33 * net/tramp-cmds.el (tramp-cleanup-all-connections): Reset
Michael Albinus <michael.albinus@gmx.de>
parents: 94677
diff changeset
107 (setq tramp-locked nil)
c8848a020b33 * net/tramp-cmds.el (tramp-cleanup-all-connections): Reset
Michael Albinus <michael.albinus@gmx.de>
parents: 94677
diff changeset
108
85508
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
109 ;; Flush password cache.
108377
7827d5a5c826 * net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents: 106815
diff changeset
110 (tramp-compat-funcall 'password-reset)
85508
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
111
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
112 ;; Flush file and connection cache.
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
113 (clrhash tramp-cache-data)
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
114
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
115 ;; Remove buffers.
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
116 (dolist (name (tramp-list-tramp-buffers))
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
117 (when (bufferp (get-buffer name)) (kill-buffer name))))
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
118
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
119 (defun tramp-cleanup-all-buffers ()
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
120 "Kill all remote buffers."
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
121 (interactive)
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
122
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
123 ;; Remove all Tramp related buffers.
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
124 (tramp-cleanup-all-connections)
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
125
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
126 ;; Remove all buffers with a remote default-directory.
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
127 (dolist (name (tramp-list-remote-buffers))
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
128 (when (bufferp (get-buffer name)) (kill-buffer name))))
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
129
85694
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
130 ;; Tramp version is useful in a number of situations.
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
131
110264
ec526909f60b Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents: 110015
diff changeset
132 ;;;###tramp-autoload
85694
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
133 (defun tramp-version (arg)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
134 "Print version number of tramp.el in minibuffer or current buffer."
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
135 (interactive "P")
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
136 (if arg (insert tramp-version) (message tramp-version)))
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
137
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
138 ;; Make the `reporter` functionality available for making bug reports about
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
139 ;; the package. A most useful piece of code.
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
140
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
141 (autoload 'reporter-submit-bug-report "reporter")
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
142
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
143 (defun tramp-bug ()
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
144 "Submit a bug report to the Tramp developers."
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
145 (interactive)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
146 (require 'reporter)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
147 (catch 'dont-send
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
148 (let ((reporter-prompt-for-summary-p t))
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
149 (reporter-submit-bug-report
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
150 tramp-bug-report-address ; to-address
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
151 (format "tramp (%s)" tramp-version) ; package name and version
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
152 (delq nil
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
153 `(;; Current state
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
154 tramp-current-method
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
155 tramp-current-user
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
156 tramp-current-host
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
157
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
158 ;; System defaults
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
159 tramp-auto-save-directory ; vars to dump
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
160 tramp-default-method
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
161 tramp-default-method-alist
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
162 tramp-default-host
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
163 tramp-default-proxies-alist
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
164 tramp-default-user
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
165 tramp-default-user-alist
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
166 tramp-rsh-end-of-line
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
167 tramp-default-password-end-of-line
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
168 tramp-login-prompt-regexp
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
169 ;; Mask non-7bit characters
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
170 (tramp-password-prompt-regexp . tramp-reporter-dump-variable)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
171 tramp-wrong-passwd-regexp
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
172 tramp-yesno-prompt-regexp
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
173 tramp-yn-prompt-regexp
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
174 tramp-terminal-prompt-regexp
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
175 tramp-temp-name-prefix
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
176 tramp-file-name-structure
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
177 tramp-file-name-regexp
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
178 tramp-methods
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
179 tramp-end-of-output
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
180 tramp-local-coding-commands
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
181 tramp-remote-coding-commands
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
182 tramp-actions-before-shell
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
183 tramp-actions-copy-out-of-band
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
184 tramp-terminal-type
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
185 ;; Mask non-7bit characters
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
186 (tramp-shell-prompt-pattern . tramp-reporter-dump-variable)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
187 ,(when (boundp 'tramp-backup-directory-alist)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
188 'tramp-backup-directory-alist)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
189 ,(when (boundp 'tramp-bkup-backup-directory-info)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
190 'tramp-bkup-backup-directory-info)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
191 ;; Dump cache.
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
192 (tramp-cache-data . tramp-reporter-dump-variable)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
193
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
194 ;; Non-tramp variables of interest
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
195 ;; Mask non-7bit characters
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
196 (shell-prompt-pattern . tramp-reporter-dump-variable)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
197 backup-by-copying
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
198 backup-by-copying-when-linked
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
199 backup-by-copying-when-mismatch
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
200 ,(when (boundp 'backup-by-copying-when-privileged-mismatch)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
201 'backup-by-copying-when-privileged-mismatch)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
202 ,(when (boundp 'password-cache)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
203 'password-cache)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
204 ,(when (boundp 'password-cache-expiry)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
205 'password-cache-expiry)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
206 ,(when (boundp 'backup-directory-alist)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
207 'backup-directory-alist)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
208 ,(when (boundp 'bkup-backup-directory-info)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
209 'bkup-backup-directory-info)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
210 file-name-handler-alist))
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
211
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
212 'tramp-load-report-modules ; pre-hook
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
213 'tramp-append-tramp-buffers ; post-hook
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
214 "\
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
215 Enter your bug report in this message, including as much detail
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
216 as you possibly can about the problem, what you did to cause it
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
217 and what the local and remote machines are.
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
218
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
219 If you can give a simple set of instructions to make this bug
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
220 happen reliably, please include those. Thank you for helping
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
221 kill bugs in Tramp.
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
222
103528
014ba66def3d * net/tramp-cmds.el (tramp-bug): Recommend
Michael Albinus <michael.albinus@gmx.de>
parents: 102969
diff changeset
223 Before reproducing the bug, you might apply
014ba66def3d * net/tramp-cmds.el (tramp-bug): Recommend
Michael Albinus <michael.albinus@gmx.de>
parents: 102969
diff changeset
224
014ba66def3d * net/tramp-cmds.el (tramp-bug): Recommend
Michael Albinus <michael.albinus@gmx.de>
parents: 102969
diff changeset
225 M-x tramp-cleanup-all-connections
014ba66def3d * net/tramp-cmds.el (tramp-bug): Recommend
Michael Albinus <michael.albinus@gmx.de>
parents: 102969
diff changeset
226
014ba66def3d * net/tramp-cmds.el (tramp-bug): Recommend
Michael Albinus <michael.albinus@gmx.de>
parents: 102969
diff changeset
227 This allows to investigate from a clean environment. Another
014ba66def3d * net/tramp-cmds.el (tramp-bug): Recommend
Michael Albinus <michael.albinus@gmx.de>
parents: 102969
diff changeset
228 useful thing to do is to put
85694
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
229
109563
35f14a2258f3 * net/tramp.el (tramp-methods): Move hostname to the end in all
Michael Albinus <michael.albinus@gmx.de>
parents: 108377
diff changeset
230 (setq tramp-verbose 9)
85694
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
231
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
232 in the ~/.emacs file and to repeat the bug. Then, include the
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
233 contents of the *tramp/foo* buffer and the *debug tramp/foo*
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
234 buffer in your bug report.
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
235
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
236 --bug report follows this line--
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
237 "))))
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
238
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
239 (defun tramp-reporter-dump-variable (varsym mailbuf)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
240 "Pretty-print the value of the variable in symbol VARSYM.
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
241 Used for non-7bit chars in strings."
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
242 (let* ((reporter-eval-buffer (symbol-value 'reporter-eval-buffer))
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
243 (val (with-current-buffer reporter-eval-buffer
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
244 (symbol-value varsym))))
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
245
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
246 (if (hash-table-p val)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
247 ;; Pretty print the cache.
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
248 (set varsym (read (format "(%s)" (tramp-cache-print val))))
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
249 ;; There are characters to be masked.
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
250 (when (and (boundp 'mm-7bit-chars)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
251 (string-match
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
252 (concat "[^" (symbol-value 'mm-7bit-chars) "]") val))
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
253 (with-current-buffer reporter-eval-buffer
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
254 (set varsym (format "(base64-decode-string \"%s\""
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
255 (base64-encode-string val))))))
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
256
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
257 ;; Dump variable.
108377
7827d5a5c826 * net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents: 106815
diff changeset
258 (tramp-compat-funcall 'reporter-dump-variable varsym mailbuf)
85694
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
259
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
260 (unless (hash-table-p val)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
261 ;; Remove string quotation.
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
262 (forward-line -1)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
263 (when (looking-at
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
264 (concat "\\(^.*\\)" "\"" ;; \1 "
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
265 "\\((base64-decode-string \\)" "\\\\" ;; \2 \
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
266 "\\(\".*\\)" "\\\\" ;; \3 \
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
267 "\\(\")\\)" "\"$")) ;; \4 "
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
268 (replace-match "\\1\\2\\3\\4")
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
269 (beginning-of-line)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
270 (insert " ;; variable encoded due to non-printable characters\n"))
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
271 (forward-line 1))
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
272
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
273 ;; Reset VARSYM to old value.
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
274 (with-current-buffer reporter-eval-buffer
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
275 (set varsym val))))
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
276
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
277 (defun tramp-load-report-modules ()
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
278 "Load needed modules for reporting."
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
279
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
280 ;; We load message.el and mml.el from Gnus.
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
281 (if (featurep 'xemacs)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
282 (progn
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
283 (load "message" 'noerror)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
284 (load "mml" 'noerror))
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
285 (require 'message nil 'noerror)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
286 (require 'mml nil 'noerror))
108377
7827d5a5c826 * net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents: 106815
diff changeset
287 (tramp-compat-funcall 'message-mode)
7827d5a5c826 * net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents: 106815
diff changeset
288 (tramp-compat-funcall 'mml-mode t))
85694
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
289
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
290 (defun tramp-append-tramp-buffers ()
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
291 "Append Tramp buffers and buffer local variables into the bug report."
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
292
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
293 (goto-char (point-max))
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
294
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
295 ;; Dump buffer local variables.
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
296 (dolist (buffer
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
297 (delq nil
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
298 (mapcar
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
299 '(lambda (b)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
300 (when (string-match "\\*tramp/" (buffer-name b)) b))
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
301 (buffer-list))))
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
302 (let ((reporter-eval-buffer buffer)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
303 (buffer-name (buffer-name buffer))
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
304 (elbuf (get-buffer-create " *tmp-reporter-buffer*")))
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
305 (with-current-buffer elbuf
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
306 (emacs-lisp-mode)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
307 (erase-buffer)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
308 (insert "\n(setq\n")
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
309 (lisp-indent-line)
108377
7827d5a5c826 * net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents: 106815
diff changeset
310 (tramp-compat-funcall
7827d5a5c826 * net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents: 106815
diff changeset
311 'reporter-dump-variable 'buffer-name (current-buffer))
85694
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
312 (dolist (varsym-or-cons-cell (buffer-local-variables buffer))
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
313 (let ((varsym (or (car-safe varsym-or-cons-cell)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
314 varsym-or-cons-cell)))
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
315 (when (string-match "tramp" (symbol-name varsym))
108377
7827d5a5c826 * net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents: 106815
diff changeset
316 (tramp-compat-funcall
7827d5a5c826 * net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents: 106815
diff changeset
317 'reporter-dump-variable varsym (current-buffer)))))
85694
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
318 (lisp-indent-line)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
319 (insert ")\n"))
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
320 (insert-buffer-substring elbuf)))
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
321
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
322 ;; Append buffers only when we are in message mode.
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
323 (when (and
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
324 (eq major-mode 'message-mode)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
325 (boundp 'mml-mode)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
326 (symbol-value 'mml-mode))
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
327
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
328 (let ((tramp-buf-regexp "\\*\\(debug \\)?tramp/")
108377
7827d5a5c826 * net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents: 106815
diff changeset
329 (buffer-list (tramp-compat-funcall 'tramp-list-tramp-buffers))
85694
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
330 (curbuf (current-buffer)))
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
331
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
332 ;; There is at least one Tramp buffer.
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
333 (when buffer-list
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
334 (switch-to-buffer (list-buffers-noselect nil))
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
335 (delete-other-windows)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
336 (setq buffer-read-only nil)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
337 (goto-char (point-min))
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
338 (while (not (eobp))
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
339 (if (re-search-forward
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
340 tramp-buf-regexp (tramp-compat-line-end-position) t)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
341 (forward-line 1)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
342 (forward-line 0)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
343 (let ((start (point)))
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
344 (forward-line 1)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
345 (kill-region start (point)))))
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
346 (insert "
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
347 The buffer(s) above will be appended to this message. If you
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
348 don't want to append a buffer because it contains sensitive data,
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
349 or because the buffer is too large, you should delete the
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
350 respective buffer. The buffer(s) will contain user and host
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
351 names. Passwords will never be included there.")
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
352
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
353 (when (>= tramp-verbose 6)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
354 (insert "\n\n")
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
355 (let ((start (point)))
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
356 (insert "\
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
357 Please note that you have set `tramp-verbose' to a value of at
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
358 least 6. Therefore, the contents of files might be included in
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
359 the debug buffer(s).")
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
360 (add-text-properties start (point) (list 'face 'italic))))
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
361
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
362 (set-buffer-modified-p nil)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
363 (setq buffer-read-only t)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
364 (goto-char (point-min))
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
365
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
366 (if (y-or-n-p "Do you want to append the buffer(s)? ")
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
367 ;; OK, let's send. First we delete the buffer list.
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
368 (progn
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
369 (kill-buffer nil)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
370 (switch-to-buffer curbuf)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
371 (goto-char (point-max))
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
372 (insert "\n\
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
373 This is a special notion of the `gnus/message' package. If you
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
374 use another mail agent (by copying the contents of this buffer)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
375 please ensure that the buffers are attached to your email.\n\n")
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
376 (dolist (buffer buffer-list)
108377
7827d5a5c826 * net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents: 106815
diff changeset
377 (tramp-compat-funcall
7827d5a5c826 * net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents: 106815
diff changeset
378 'mml-insert-empty-tag 'part 'type "text/plain"
7827d5a5c826 * net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents: 106815
diff changeset
379 'encoding "base64" 'disposition "attachment" 'buffer buffer
7827d5a5c826 * net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents: 106815
diff changeset
380 'description buffer))
85694
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
381 (set-buffer-modified-p nil))
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
382
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
383 ;; Don't send. Delete the message buffer.
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
384 (set-buffer curbuf)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
385 (set-buffer-modified-p nil)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
386 (kill-buffer nil)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
387 (throw 'dont-send nil))))))
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
388
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
389 (defalias 'tramp-submit-bug 'tramp-bug)
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
390
110264
ec526909f60b Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents: 110015
diff changeset
391 (add-hook 'tramp-unload-hook
ec526909f60b Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents: 110015
diff changeset
392 (lambda () (unload-feature 'tramp-cmds 'force)))
ec526909f60b Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents: 110015
diff changeset
393
85508
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
394 (provide 'tramp-cmds)
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
395
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
396 ;;; TODO:
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
397
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
398 ;; * Clean up unused *tramp/foo* buffers after a while. (Pete Forman)
85694
21983e7c844a * net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents: 85530
diff changeset
399 ;; * WIBNI there was an interactive command prompting for Tramp
85508
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
400 ;; method, hostname, username and filename and translates the user
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
401 ;; input into the correct filename syntax (depending on the Emacs
110264
ec526909f60b Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents: 110015
diff changeset
402 ;; flavor) (Reiner Steib)
85508
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
403 ;; * Let the user edit the connection properties interactively.
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
404 ;; Something like `gnus-server-edit-server' in Gnus' *Server* buffer.
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
405 ;; * It's just that when I come to Customize `tramp-default-user-alist'
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
406 ;; I'm presented with a mismatch and raw lisp for a value. It is my
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
407 ;; understanding that a variable declared with defcustom is a User
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
408 ;; Option and should not be modified by the code. add-to-list is
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
409 ;; called in several places. One way to handle that is to have a new
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
410 ;; ordinary variable that gets its initial value from
110264
ec526909f60b Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents: 110015
diff changeset
411 ;; tramp-default-user-alist and then is added to. (Pete Forman)
85508
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
412
85530
1ee7c459e1db Add arch tagline
Miles Bader <miles@gnu.org>
parents: 85508
diff changeset
413 ;; arch-tag: 190d4c33-76bb-4e99-8b6f-71741f23d98c
85508
05c8e6a18913 * net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
414 ;;; tramp-cmds.el ends here