Index: emacs/lisp/net/tramp.el diff -c emacs/lisp/net/tramp.el:1.71 emacs/lisp/net/tramp.el:1.72 *** emacs/lisp/net/tramp.el:1.71 Mon Aug 1 15:17:06 2005 --- emacs/lisp/net/tramp.el Sun Aug 7 15:42:42 2005 *************** *** 4,10 **** ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, ;; 2005 Free Software Foundation, Inc. ! ;; Author: [EMAIL PROTECTED] ;; Keywords: comm, processes ;; This file is part of GNU Emacs. --- 4,11 ---- ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, ;; 2005 Free Software Foundation, Inc. ! ;; Author: Kai Gro,A_(Bjohann <[EMAIL PROTECTED]> ! ;; Michael Albinus <[EMAIL PROTECTED]> ;; Keywords: comm, processes ;; This file is part of GNU Emacs. *************** *** 147,157 **** (when (boundp 'byte-compile-not-obsolete-var) (setq byte-compile-not-obsolete-var 'directory-sep-char))) - ;; XEmacs byte-compiler raises warning abouts `last-coding-system-used'. - (eval-when-compile - (unless (boundp 'last-coding-system-used) - (defvar last-coding-system-used nil))) - ;;; User Customizable Internal Variables: (defgroup tramp nil --- 148,153 ---- *************** *** 1031,1037 **** :type 'regexp) (defcustom tramp-user-regexp ! "[^:@/ \t]*" "*Regexp matching user names." :group 'tramp :type 'regexp) --- 1027,1033 ---- :type 'regexp) (defcustom tramp-user-regexp ! "[^:/ \t]*" "*Regexp matching user names." :group 'tramp :type 'regexp) *************** *** 1914,1920 **** tramp-current-multi-method tramp-current-method tramp-current-user tramp-current-host)) (goto-char (point-max)) ! (tramp-insert-with-face 'italic (concat "# " (apply #'format fmt-string args) "\n")))))) --- 1910,1918 ---- tramp-current-multi-method tramp-current-method tramp-current-user tramp-current-host)) (goto-char (point-max)) ! (unless (bolp) ! (insert "\n")) ! (tramp-insert-with-face 'italic (concat "# " (apply #'format fmt-string args) "\n")))))) *************** *** 2370,2385 **** (buffer-name))) (if time-list (tramp-run-real-handler 'set-visited-file-modtime (list time-list)) ! (let ((f (buffer-file-name)) ! (coding-system-used nil)) (with-parsed-tramp-file-name f nil (let* ((attr (file-attributes f)) ;; '(-1 65535) means file doesn't exists yet. (modtime (or (nth 5 attr) '(-1 65535)))) ;; We use '(0 0) as a don't-know value. See also ;; `tramp-handle-file-attributes-with-ls'. - (when (boundp 'last-coding-system-used) - (setq coding-system-used last-coding-system-used)) (if (not (equal modtime '(0 0))) (tramp-run-real-handler 'set-visited-file-modtime (list modtime)) (save-excursion --- 2368,2380 ---- (buffer-name))) (if time-list (tramp-run-real-handler 'set-visited-file-modtime (list time-list)) ! (let ((f (buffer-file-name))) (with-parsed-tramp-file-name f nil (let* ((attr (file-attributes f)) ;; '(-1 65535) means file doesn't exists yet. (modtime (or (nth 5 attr) '(-1 65535)))) ;; We use '(0 0) as a don't-know value. See also ;; `tramp-handle-file-attributes-with-ls'. (if (not (equal modtime '(0 0))) (tramp-run-real-handler 'set-visited-file-modtime (list modtime)) (save-excursion *************** *** 2392,2400 **** (setq attr (buffer-substring (point) (progn (end-of-line) (point))))) (setq tramp-buffer-file-attributes attr)) ! (when (boundp 'last-coding-system-used) ! (setq last-coding-system-used coding-system-used)) ! nil))))) ;; CCC continue here --- 2387,2393 ---- (setq attr (buffer-substring (point) (progn (end-of-line) (point))))) (setq tramp-buffer-file-attributes attr)) ! nil))))) ;; CCC continue here *************** *** 2412,2418 **** ;; recorded last modification time. (if (or (not (buffer-file-name)) (eq (visited-file-modtime) 0)) ! t (let ((f (buffer-file-name))) (with-parsed-tramp-file-name f nil (let* ((attr (file-attributes f)) --- 2405,2411 ---- ;; recorded last modification time. (if (or (not (buffer-file-name)) (eq (visited-file-modtime) 0)) ! t (let ((f (buffer-file-name))) (with-parsed-tramp-file-name f nil (let* ((attr (file-attributes f)) *************** *** 2447,2458 **** ;; if and only if that agrees with the buffer's record. (t (equal mt '(-1 65535)))))))))) - (defadvice clear-visited-file-modtime (after tramp activate) - "Set `tramp-buffer-file-attributes' back to nil. - Tramp uses this variable as an emulation for the actual modtime of the file, - if the remote host can't provide the modtime." - (setq tramp-buffer-file-attributes nil)) - (defun tramp-handle-set-file-modes (filename mode) "Like `set-file-modes' for tramp files." (with-parsed-tramp-file-name filename nil --- 2440,2445 ---- *************** *** 3137,3144 **** tramp-current-method method tramp-current-user user tramp-current-host host) ! (tramp-message ! 5 "Transferring %s to file %s..." filename newname) ;; Use rcp-like program for file transfer. (let ((p (apply 'start-process (buffer-name trampbuf) trampbuf --- 3124,3130 ---- tramp-current-method method tramp-current-user user tramp-current-host host) ! (message "Transferring %s to %s..." filename newname) ;; Use rcp-like program for file transfer. (let ((p (apply 'start-process (buffer-name trampbuf) trampbuf *************** *** 3147,3154 **** (tramp-process-actions p multi-method method user host tramp-actions-copy-out-of-band)) (kill-buffer trampbuf) ! (tramp-message ! 5 "Transferring %s to file %s...done" filename newname) ;; Set the mode. (unless keep-date --- 3133,3139 ---- (tramp-process-actions p multi-method method user host tramp-actions-copy-out-of-band)) (kill-buffer trampbuf) ! (message "Transferring %s to %s...done" filename newname) ;; Set the mode. (unless keep-date *************** *** 3319,3325 **** (filename switches &optional wildcard full-directory-p) "Like `insert-directory' for tramp files." (if (and (boundp 'ls-lisp-use-insert-directory-program) ! (not ls-lisp-use-insert-directory-program)) (tramp-run-real-handler 'insert-directory (list filename switches wildcard full-directory-p)) ;; For the moment, we assume that the remote "ls" program does not --- 3304,3310 ---- (filename switches &optional wildcard full-directory-p) "Like `insert-directory' for tramp files." (if (and (boundp 'ls-lisp-use-insert-directory-program) ! (not (symbol-value 'ls-lisp-use-insert-directory-program))) (tramp-run-real-handler 'insert-directory (list filename switches wildcard full-directory-p)) ;; For the moment, we assume that the remote "ls" program does not *************** *** 3505,3511 **** ;; Remote commands. (defvar tramp-async-proc nil ! "Global variable keeping asyncronous process object. Used in `tramp-handle-shell-command'") (defun tramp-handle-shell-command (command &optional output-buffer error-buffer) --- 3490,3496 ---- ;; Remote commands. (defvar tramp-async-proc nil ! "Global variable keeping asynchronous process object. Used in `tramp-handle-shell-command'") (defun tramp-handle-shell-command (command &optional output-buffer error-buffer) *************** *** 3762,3768 **** 'insert-file-contents) 'file-local-copy))) (file-local-copy filename))) - (coding-system-used nil) (result nil)) (when visit (setq buffer-file-name filename) --- 3747,3752 ---- *************** *** 3772,3786 **** multi-method method user host 9 "Inserting local temp file `%s'..." local-copy) (setq result (insert-file-contents local-copy nil beg end replace)) - ;; Now `last-coding-system-used' has right value. Remember it. - (when (boundp 'last-coding-system-used) - (setq coding-system-used last-coding-system-used)) (tramp-message-for-buffer multi-method method user host 9 "Inserting local temp file `%s'...done" local-copy) (delete-file local-copy) - (when (boundp 'last-coding-system-used) - (setq last-coding-system-used coding-system-used)) (list (expand-file-name filename) (second result)))))) --- 3756,3765 ---- *************** *** 3845,3851 **** ;; (string= lockname filename)) ;; (error ;; "tramp-handle-write-region: LOCKNAME must be nil or equal FILENAME")) ! ;; XEmacs takes a coding system as the sevent argument, not `confirm' (when (and (not (featurep 'xemacs)) confirm (file-exists-p filename)) (unless (y-or-n-p (format "File %s exists; overwrite anyway? " --- 3824,3830 ---- ;; (string= lockname filename)) ;; (error ;; "tramp-handle-write-region: LOCKNAME must be nil or equal FILENAME")) ! ;; XEmacs takes a coding system as the seventh argument, not `confirm' (when (and (not (featurep 'xemacs)) confirm (file-exists-p filename)) (unless (y-or-n-p (format "File %s exists; overwrite anyway? " *************** *** 3859,3871 **** (loc-dec (tramp-get-local-decoding multi-method method user host)) (trampbuf (get-buffer-create "*tramp output*")) (modes (file-modes filename)) - ;; We use this to save the value of `last-coding-system-used' - ;; after writing the tmp file. At the end of the function, - ;; we set `last-coding-system-used' to this saved value. - ;; This way, any intermediary coding systems used while - ;; talking to the remote shell or suchlike won't hose this - ;; variable. This approach was snarfed from ange-ftp.el. - coding-system-used tmpfil) ;; Write region into a tmp file. This isn't really needed if we ;; use an encoding function, but currently we use it always --- 3838,3843 ---- *************** *** 3887,3895 **** ;; the backup file. This case `save-buffer' handles ;; permissions. (when modes (set-file-modes tmpfil modes)) - ;; Now, `last-coding-system-used' has the right value. Remember it. - (when (boundp 'last-coding-system-used) - (setq coding-system-used last-coding-system-used)) ;; This is a bit lengthy due to the different methods possible for ;; file transfer. First, we check whether the method uses an rcp ;; program. If so, we call it. Otherwise, both encoding and --- 3859,3864 ---- *************** *** 3991,3999 **** ;; We must pass modtime explicitely, because filename can be different ;; from (buffer-file-name), f.e. if `file-precious-flag' is set. (nth 5 (file-attributes filename)))) - ;; Make `last-coding-system-used' have the right value. - (when (boundp 'last-coding-system-used) - (setq last-coding-system-used coding-system-used)) (when (or (eq visit t) (eq visit nil) (stringp visit)) --- 3960,3965 ---- *************** *** 4301,4307 **** (symbol-function 'PC-expand-many-files)) (defun PC-expand-many-files (name) (if (tramp-tramp-file-p name) ! (expand-many-files name) (tramp-save-PC-expand-many-files name)))) ;; Why isn't eval-after-load sufficient? --- 4267,4273 ---- (symbol-function 'PC-expand-many-files)) (defun PC-expand-many-files (name) (if (tramp-tramp-file-p name) ! (funcall (symbol-function 'expand-many-files) name) (tramp-save-PC-expand-many-files name)))) ;; Why isn't eval-after-load sufficient? *************** *** 4825,4836 **** (defun tramp-completion-handle-expand-file-name (name &optional dir) "Like `expand-file-name' for tramp files." (let ((fullname (concat (or dir default-directory) name))) ! (tramp-drop-volume-letter ! (if (tramp-completion-mode fullname) ! (tramp-run-real-handler ! 'expand-file-name (list name dir)) ! (tramp-completion-run-real-handler ! 'expand-file-name (list name dir)))))) ;;; Internal Functions: --- 4791,4801 ---- (defun tramp-completion-handle-expand-file-name (name &optional dir) "Like `expand-file-name' for tramp files." (let ((fullname (concat (or dir default-directory) name))) ! (if (tramp-completion-mode fullname) ! (tramp-run-real-handler ! 'expand-file-name (list name dir)) ! (tramp-completion-run-real-handler ! 'expand-file-name (list name dir))))) ;;; Internal Functions: *************** *** 5127,5138 **** (tramp-send-command multi-method method user host (concat "PS1='$ ' exec " shell)) ; ! (unless (tramp-wait-for-regexp ! (get-buffer-process (current-buffer)) ! 60 (format "\\(\\(%s\\)\\|\\(%s\\)\\)\\'" ! tramp-shell-prompt-pattern shell-prompt-pattern)) ! (pop-to-buffer (buffer-name)) ! (error "Couldn't find remote `%s' prompt" shell)) (tramp-message 9 "Setting remote shell prompt...") ;; Douglas Gray Stephens <[EMAIL PROTECTED]> says that we --- 5092,5100 ---- (tramp-send-command multi-method method user host (concat "PS1='$ ' exec " shell)) ; ! (tramp-barf-if-no-shell-prompt ! (get-buffer-process (current-buffer)) ! 60 "Couldn't find remote `%s' prompt" shell) (tramp-message 9 "Setting remote shell prompt...") ;; Douglas Gray Stephens <[EMAIL PROTECTED]> says that we *************** *** 5331,5337 **** (tramp-message 9 "Waiting 60s for prompt from remote shell") (with-timeout (60 (throw 'tramp-action 'timeout)) (while (not found) ! (accept-process-output p 1) (goto-char (point-min)) (setq todo actions) (while todo --- 5293,5299 ---- (tramp-message 9 "Waiting 60s for prompt from remote shell") (with-timeout (60 (throw 'tramp-action 'timeout)) (while (not found) ! (tramp-accept-process-output p 1) (goto-char (point-min)) (setq todo actions) (while todo *************** *** 5368,5374 **** (tramp-message 9 "Waiting 60s for prompt from remote shell") (with-timeout (60 (throw 'tramp-action 'timeout)) (while (not found) ! (accept-process-output p 1) (setq todo actions) (goto-char (point-min)) (while todo --- 5330,5336 ---- (tramp-message 9 "Waiting 60s for prompt from remote shell") (with-timeout (60 (throw 'tramp-action 'timeout)) (while (not found) ! (tramp-accept-process-output p 1) (setq todo actions) (goto-char (point-min)) (while todo *************** *** 5757,5762 **** --- 5719,5732 ---- ;; Utility functions. + (defun tramp-accept-process-output + (&optional process timeout timeout-msecs) + "Like `accept-process-output' for Tramp processes. + This is needed in order to hide `last-coding-system-used', which is set + for process communication also." + (let (last-coding-system-used) + (accept-process-output process timeout timeout-msecs))) + (defun tramp-wait-for-regexp (proc timeout regexp) "Wait for a REGEXP to appear from process PROC within TIMEOUT seconds. Expects the output of PROC to be sent to the current buffer. Returns *************** *** 5773,5792 **** timeout)) (with-timeout (timeout) (while (not found) ! (accept-process-output proc 1) (unless (memq (process-status proc) '(run open)) (error "Process has died")) (goto-char (point-min)) ! (setq found (when (re-search-forward regexp nil t) ! (tramp-match-string-list))))))) (t (while (not found) ! (accept-process-output proc 1) (unless (memq (process-status proc) '(run open)) (error "Process has died")) (goto-char (point-min)) ! (setq found (when (re-search-forward regexp nil t) ! (tramp-match-string-list)))))) (when tramp-debug-buffer (append-to-buffer (tramp-get-debug-buffer tramp-current-multi-method tramp-current-method --- 5743,5760 ---- timeout)) (with-timeout (timeout) (while (not found) ! (tramp-accept-process-output proc 1) (unless (memq (process-status proc) '(run open)) (error "Process has died")) (goto-char (point-min)) ! (setq found (re-search-forward regexp nil t)))))) (t (while (not found) ! (tramp-accept-process-output proc 1) (unless (memq (process-status proc) '(run open)) (error "Process has died")) (goto-char (point-min)) ! (setq found (re-search-forward regexp nil t))))) (when tramp-debug-buffer (append-to-buffer (tramp-get-debug-buffer tramp-current-multi-method tramp-current-method *************** *** 6399,6405 **** timeout)) (with-timeout (timeout) (while (not found) ! (accept-process-output proc 1) (unless (memq (process-status proc) '(run open)) (error "Process has died")) (goto-char (point-max)) --- 6367,6373 ---- timeout)) (with-timeout (timeout) (while (not found) ! (tramp-accept-process-output proc 1) (unless (memq (process-status proc) '(run open)) (error "Process has died")) (goto-char (point-max)) *************** *** 6407,6413 **** (setq found (looking-at end-of-output)))))) (t (while (not found) ! (accept-process-output proc 1) (unless (memq (process-status proc) '(run open)) (error "Process has died")) (goto-char (point-max)) --- 6375,6381 ---- (setq found (looking-at end-of-output)))))) (t (while (not found) ! (tramp-accept-process-output proc 1) (unless (memq (process-status proc) '(run open)) (error "Process has died")) (goto-char (point-max)) *************** *** 6444,6461 **** ;; Return value is whether end-of-output sentinel was found. found)) - (defun tramp-match-string-list (&optional string) - "Returns list of all match strings. - That is, (list (match-string 0) (match-string 1) ...), according to the - number of matches." - (let* ((nmatches (/ (length (match-data)) 2)) - (i (- nmatches 1)) - (res nil)) - (while (>= i 0) - (setq res (cons (match-string i string) res)) - (setq i (- i 1))) - res)) - (defun tramp-send-command-and-check (multi-method method user host command &optional subshell) "Run COMMAND and check its exit status. --- 6412,6417 ---- *************** *** 6556,6562 **** If `tramp-discard-garbage' is nil, just erase buffer." (if (not tramp-discard-garbage) (erase-buffer) ! (while (prog1 (erase-buffer) (accept-process-output p 0.25)) (when tramp-debug-buffer (save-excursion (set-buffer (tramp-get-debug-buffer multi-method method user host)) --- 6512,6518 ---- If `tramp-discard-garbage' is nil, just erase buffer." (if (not tramp-discard-garbage) (erase-buffer) ! (while (prog1 (erase-buffer) (tramp-accept-process-output p 0.25)) (when tramp-debug-buffer (save-excursion (set-buffer (tramp-get-debug-buffer multi-method method user host)) *************** *** 6993,6999 **** ;; auto-saved file belonging to another original file. This could ;; be a security threat. (set-file-modes buffer-auto-save-file-name ! (or (file-modes bfn) ?\600))))) (unless (or (> emacs-major-version 21) (and (featurep 'xemacs) --- 6949,6955 ---- ;; auto-saved file belonging to another original file. This could ;; be a security threat. (set-file-modes buffer-auto-save-file-name ! (or (file-modes bfn) #o600))))) (unless (or (> emacs-major-version 21) (and (featurep 'xemacs) *************** *** 7130,7139 **** "Specify if query is needed for process when Emacs is exited. If the second argument flag is non-nil, Emacs will query the user before exiting if process is running." (if (fboundp 'set-process-query-on-exit-flag) ! (set-process-query-on-exit-flag process flag) ! (funcall (symbol-function 'process-kill-without-query) ! process flag))) ;; ------------------------------------------------------------ --- 7086,7096 ---- "Specify if query is needed for process when Emacs is exited. If the second argument flag is non-nil, Emacs will query the user before exiting if process is running." + (funcall (if (fboundp 'set-process-query-on-exit-flag) ! (symbol-function 'set-process-query-on-exit-flag) ! (symbol-function 'process-kill-without-query)) ! process flag)) ;; ------------------------------------------------------------ *************** *** 7213,7232 **** ;; CCC: This check is now also really awful; we should search all ;; of the filename format, not just the prefix. (when (string-match "\\[" tramp-prefix-format) ! (defadvice file-expand-wildcards (around tramp-fix activate) ! (let ((name (ad-get-arg 0))) ! (if (tramp-tramp-file-p name) ! ;; If it's a Tramp file, dissect it and look if wildcards ! ;; need to be expanded at all. ! (let ((v (tramp-dissect-file-name name))) ! (if (string-match "[[*?]" (tramp-file-name-localname v)) ! (let ((res ad-do-it)) ! (setq ad-return-value (or res (list name)))) ! (setq ad-return-value (list name)))) ! ;; If it is not a Tramp file, just run the original function. ! (let ((res ad-do-it)) ! (setq ad-return-value (or res (list name))))))) ! ) ;; Tramp version is useful in a number of situations. --- 7170,7188 ---- ;; CCC: This check is now also really awful; we should search all ;; of the filename format, not just the prefix. (when (string-match "\\[" tramp-prefix-format) ! (defadvice file-expand-wildcards (around tramp-fix activate) ! (let ((name (ad-get-arg 0))) ! (if (tramp-tramp-file-p name) ! ;; If it's a Tramp file, dissect it and look if wildcards ! ;; need to be expanded at all. ! (let ((v (tramp-dissect-file-name name))) ! (if (string-match "[[*?]" (tramp-file-name-localname v)) ! (let ((res ad-do-it)) ! (setq ad-return-value (or res (list name)))) ! (setq ad-return-value (list name)))) ! ;; If it is not a Tramp file, just run the original function. ! (let ((res ad-do-it)) ! (setq ad-return-value (or res (list name)))))))) ;; Tramp version is useful in a number of situations. *************** *** 7246,7314 **** (interactive) (require 'reporter) (catch 'dont-send ! (let ((reporter-prompt-for-summary-p t)) (reporter-submit-bug-report tramp-bug-report-address ; to-address (format "tramp (%s)" tramp-version) ; package name and version ! `(;; Current state ! tramp-ls-command ! tramp-test-groks-nt ! tramp-file-exists-command ! tramp-current-multi-method ! tramp-current-method ! tramp-current-user ! tramp-current-host ! ! ;; System defaults ! tramp-auto-save-directory ; vars to dump ! tramp-default-method ! tramp-rsh-end-of-line ! tramp-default-password-end-of-line ! tramp-remote-path ! tramp-login-prompt-regexp ! tramp-password-prompt-regexp ! tramp-wrong-passwd-regexp ! tramp-yesno-prompt-regexp ! tramp-yn-prompt-regexp ! tramp-terminal-prompt-regexp ! tramp-temp-name-prefix ! tramp-file-name-structure ! tramp-file-name-regexp ! tramp-multi-file-name-structure ! tramp-multi-file-name-hop-structure ! tramp-multi-methods ! tramp-multi-connection-function-alist ! tramp-methods ! tramp-end-of-output ! tramp-coding-commands ! tramp-actions-before-shell ! tramp-actions-copy-out-of-band ! tramp-multi-actions ! tramp-terminal-type ! tramp-shell-prompt-pattern ! tramp-chunksize ! ,(when (boundp 'tramp-backup-directory-alist) ! 'tramp-backup-directory-alist) ! ,(when (boundp 'tramp-bkup-backup-directory-info) ! 'tramp-bkup-backup-directory-info) ! ! ;; Non-tramp variables of interest ! shell-prompt-pattern ! backup-by-copying ! backup-by-copying-when-linked ! backup-by-copying-when-mismatch ! ,(when (boundp 'backup-by-copying-when-privileged-mismatch) ! 'backup-by-copying-when-privileged-mismatch) ! ,(when (boundp 'password-cache) ! 'password-cache) ! ,(when (boundp 'password-cache-expiry) ! 'password-cache-expiry) ! ,(when (boundp 'backup-directory-alist) ! 'backup-directory-alist) ! ,(when (boundp 'bkup-backup-directory-info) ! 'bkup-backup-directory-info) ! file-name-handler-alist) ! nil ; pre-hook 'tramp-append-tramp-buffers ; post-hook "\ Enter your bug report in this message, including as much detail as you --- 7202,7275 ---- (interactive) (require 'reporter) (catch 'dont-send ! (let ((reporter-prompt-for-summary-p t)) (reporter-submit-bug-report tramp-bug-report-address ; to-address (format "tramp (%s)" tramp-version) ; package name and version ! (delq nil ! `(;; Current state ! tramp-ls-command ! tramp-test-groks-nt ! tramp-file-exists-command ! tramp-current-multi-method ! tramp-current-method ! tramp-current-user ! tramp-current-host ! ! ;; System defaults ! tramp-auto-save-directory ; vars to dump ! tramp-default-method ! tramp-rsh-end-of-line ! tramp-default-password-end-of-line ! tramp-remote-path ! tramp-login-prompt-regexp ! ;; Mask non-7bit characters ! (tramp-password-prompt-regexp . tramp-reporter-dump-variable) ! tramp-wrong-passwd-regexp ! tramp-yesno-prompt-regexp ! tramp-yn-prompt-regexp ! tramp-terminal-prompt-regexp ! tramp-temp-name-prefix ! tramp-file-name-structure ! tramp-file-name-regexp ! tramp-multi-file-name-structure ! tramp-multi-file-name-hop-structure ! tramp-multi-methods ! tramp-multi-connection-function-alist ! tramp-methods ! tramp-end-of-output ! tramp-coding-commands ! tramp-actions-before-shell ! tramp-actions-copy-out-of-band ! tramp-multi-actions ! tramp-terminal-type ! ;; Mask non-7bit characters ! (tramp-shell-prompt-pattern . tramp-reporter-dump-variable) ! tramp-chunksize ! ,(when (boundp 'tramp-backup-directory-alist) ! 'tramp-backup-directory-alist) ! ,(when (boundp 'tramp-bkup-backup-directory-info) ! 'tramp-bkup-backup-directory-info) ! ! ;; Non-tramp variables of interest ! ;; Mask non-7bit characters ! (shell-prompt-pattern . tramp-reporter-dump-variable) ! backup-by-copying ! backup-by-copying-when-linked ! backup-by-copying-when-mismatch ! ,(when (boundp 'backup-by-copying-when-privileged-mismatch) ! 'backup-by-copying-when-privileged-mismatch) ! ,(when (boundp 'password-cache) ! 'password-cache) ! ,(when (boundp 'password-cache-expiry) ! 'password-cache-expiry) ! ,(when (boundp 'backup-directory-alist) ! 'backup-directory-alist) ! ,(when (boundp 'bkup-backup-directory-info) ! 'bkup-backup-directory-info) ! file-name-handler-alist)) ! ! 'tramp-load-report-modules ; pre-hook 'tramp-append-tramp-buffers ; post-hook "\ Enter your bug report in this message, including as much detail as you *************** *** 7327,7334 **** --bug report follows this line-- ")))) ! (defun tramp-append-tramp-buffers () ! "Append Tramp buffers into the bug report." ;; We load message.el and mml.el from Gnus. (if (featurep 'xemacs) --- 7288,7330 ---- --bug report follows this line-- ")))) ! (defun tramp-reporter-dump-variable (varsym mailbuf) ! "Pretty-print the value of the variable in symbol VARSYM. ! Used for non-7bit chars in strings." ! (let* ((reporter-eval-buffer (symbol-value 'reporter-eval-buffer)) ! (val (with-current-buffer reporter-eval-buffer ! (symbol-value varsym)))) ! ! ;; There are characters to be masked. ! (when (and (boundp 'mm-7bit-chars) ! (string-match ! (concat "[^" (symbol-value 'mm-7bit-chars) "]") val)) ! (with-current-buffer reporter-eval-buffer ! (set varsym (concat "(base64-decode-string \"" ! (base64-encode-string val) ! "\")")))) ! ! ;; Dump variable. ! (funcall (symbol-function 'reporter-dump-variable) varsym mailbuf) ! ! ;; Remove string quotation. ! (forward-line -1) ! (when (looking-at ! (concat "\\(^.*\\)" "\"" ;; \1 " ! "\\((base64-decode-string \\)" "\\\\" ;; \2 \ ! "\\(\".*\\)" "\\\\" ;; \3 \ ! "\\(\")\\)" "\"$")) ;; \4 " ! (replace-match "\\1\\2\\3\\4") ! (beginning-of-line) ! (insert " ;; variable encoded due to non-printable characters\n")) ! (forward-line 1) ! ! ;; Reset VARSYM to old value. ! (with-current-buffer reporter-eval-buffer ! (set varsym val)))) ! ! (defun tramp-load-report-modules () ! "Load needed modules for reporting." ;; We load message.el and mml.el from Gnus. (if (featurep 'xemacs) *************** *** 7338,7346 **** (require 'message nil 'noerror) (require 'mml nil 'noerror)) (when (functionp 'message-mode) ! (funcall 'message-mode)) (when (functionp 'mml-mode) ! (funcall 'mml-mode t)) (when (and (eq major-mode 'message-mode) --- 7334,7345 ---- (require 'message nil 'noerror) (require 'mml nil 'noerror)) (when (functionp 'message-mode) ! (funcall (symbol-function 'message-mode))) (when (functionp 'mml-mode) ! (funcall (symbol-function 'mml-mode) t))) ! ! (defun tramp-append-tramp-buffers () ! "Append Tramp buffers into the bug report." (when (and (eq major-mode 'message-mode) *************** *** 7394,7403 **** (goto-char (point-max)) (insert "\n\n") (dolist (buffer buffer-list) ! (mml-insert-empty-tag ! 'part 'type "text/plain" 'encoding "base64" ! 'disposition "attachment" 'buffer (buffer-name buffer) ! 'description (buffer-name buffer))) (set-buffer-modified-p nil)) ;; Don't send. Delete the message buffer. --- 7393,7402 ---- (goto-char (point-max)) (insert "\n\n") (dolist (buffer buffer-list) ! (funcall (symbol-function 'mml-insert-empty-tag) ! 'part 'type "text/plain" 'encoding "base64" ! 'disposition "attachment" 'buffer (buffer-name buffer) ! 'description (buffer-name buffer))) (set-buffer-modified-p nil)) ;; Don't send. Delete the message buffer.
_______________________________________________ Emacs-diffs mailing list Emacs-diffs@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-diffs