]> code.delx.au - gnu-emacs/commitdiff
Version 2.0.41 of Tramp released.
authorMichael Albinus <michael.albinus@gmx.de>
Sat, 29 May 2004 22:28:49 +0000 (22:28 +0000)
committerMichael Albinus <michael.albinus@gmx.de>
Sat, 29 May 2004 22:28:49 +0000 (22:28 +0000)
lisp/ChangeLog
lisp/net/tramp-smb.el
lisp/net/tramp-uu.el
lisp/net/tramp.el
man/ChangeLog
man/trampver.texi

index ecb98eb016cafd739ababfdaf68b9a2054abcc68..d4fdc205ac86a9a7cf140247796f369347f57d0a 100644 (file)
@@ -1,3 +1,53 @@
+2004-05-29  Michael Albinus  <michael.albinus@gmx.de>
+
+       Version 2.0.41 of Tramp released.
+
+       * tramp.el (tramp-wait-for-regexp, tramp-wait-for-output): Throw
+       away if process has died.  Reported by Luc Teirlinck
+       <teirllm@dms.auburn.edu>.
+       (tramp-out-of-band-prompt-regexp): Renamed to
+       `tramp-process-alive-regexp', because its usage is widen.
+       (tramp-actions-copy-out-of-band): Apply it.
+       (tramp-actions-before-shell, tramp-multi-actions): Add
+       `tramp-action-process-alive' action.
+       (tramp-action-process-alive): New defun.
+       (tramp-file-name-handler-alist, tramp-file-name-for-operation):
+       Add entry for `file-remote-p'.
+       (tramp-handle-file-remote-p): New defun.
+       (top): Remove setting of `file-remote-p'.  Don't set
+       `inhibit-file-name-handlers' and `inhibit-file-name-operation'.
+
+       * tramp-smb.el (tramp-smb-file-name-handler-alist): Add entry for
+       `file-remote-p'.
+
+       * tramp-uu.el (tramp-uuencode-region): Padding characters aren't
+       counted for (last) line.  Reported by Aaron Ucko
+       <ucko@ncbi.nlm.nih.gov>.
+
+2004-05-29  Kai Grossjohann  <kai.grossjohann@gmx.net>
+
+       * tramp.el (tramp-initial-commands): Add "unset HISTFILE"; this is
+       not really necessary but seems to keep the shell history smaller
+       in some cases.  It is no substitute for setting HISTFILE and
+       HISTSIZE from tramp-open-connection-setup-interactive-shell,
+       though.  Suggested by Luc Teirlinck.
+       (tramp-open-connection-setup-interactive-shell): Export variables
+       HISTFILE and HISTSIZE, do not just set them.  From Luc Teirlinck.
+       (tramp-set-process-query-on-exit-flag): New compat function.
+       (tramp-open-connection-multi, tramp-open-connection-su)
+       (tramp-open-connection-rsh, tramp-open-connection-telnet)
+       (tramp-do-copy-or-rename-file-out-of-band): Use it.
+       (tramp-let-maybe): New macro, let-binds a variable only if it
+       isn't obsolete.
+       (tramp-check-ls-commands, tramp-handle-expand-file-name)
+       (tramp-handle-file-truename): Use it.
+       (tramp-completion-file-name-regexp-unified): Avoid matching
+       filenames starting with "/:" -- those are reserved for
+       file-name-non-special.
+
+       * tramp-smb.el (tramp-smb-open-connection): Use
+       tramp-set-process-query-on-exit-flag compat function.
+
 2004-05-29  Richard M. Stallman  <rms@gnu.org>
 
        * net/browse-url.el (browse-url-interactive-arg): Doc fix.
        (starttls-negotiate, starttls-open-stream): Check `starttls-use-gnutls'
        and pass on to corresponding *-gnutls function if it is set.
 
->>>>>>> 1.6105
 2004-05-27  Luc Teirlinck  <teirllm@auburn.edu>
 
        * autorevert.el (auto-revert-handler): Disable auto-reverting of
        * progmodes/grep.el (grep-tree): Ensure that DIR argument is
        interpreted as a directory.
 
->>>>>>> 1.6097
 2004-05-22  Richard M. Stallman  <rms@gnu.org>
 
        * textmodes/paragraphs.el (sentence-end): Match unicode curly quotes
index 781814a9d55248f9d0108a79c27abc341b17b7eb..cca01d169b62f2b4bfd0667ee1f0c1d8de2b8522 100644 (file)
@@ -144,6 +144,7 @@ This variable is local to each buffer.")
     (file-executable-p . tramp-smb-handle-file-exists-p)
     (file-exists-p . tramp-smb-handle-file-exists-p)
     (file-local-copy . tramp-smb-handle-file-local-copy)
+    (file-remote-p . tramp-handle-file-remote-p)
     (file-modes . tramp-handle-file-modes)
     (file-name-all-completions . tramp-smb-handle-file-name-all-completions)
     ;; `file-name-as-directory' performed by default handler
@@ -1003,7 +1004,7 @@ Domain names in USER and port numbers in HOST are acknowledged."
                       tramp-smb-program args)))
 
        (tramp-message 9 "Started process %s" (process-command p))
-       (process-kill-without-query p)
+       (tramp-set-process-query-on-exit-flag p nil)
        (set-buffer buffer)
        (setq tramp-smb-share share)
 
index 1047e62a3cbbcfa0add31e0a7be696fd1c47692d..d18af101c4882e2d39a8c2989ce7ff763d51d184 100644 (file)
@@ -1,7 +1,7 @@
 ;;; -*- coding: iso-2022-7bit; -*-
 ;;; tramp-uu.el --- uuencode in Lisp
 
-;; Copyright (C) 2002  Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2004  Free Software Foundation, Inc.
 
 ;; Author: Kai Gro\e,A_\e(Bjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
 ;; Keywords: comm, terminals
        (setq c (char-after (point)))
        (delete-char 1)
        (if (equal c ?=)
-           ;; "=" means padding.  Insert "`" instead.
-           (insert "`")
-         (insert (tramp-uu-byte-to-uu-char (tramp-uu-b64-char-to-byte c))))
-       (setq i (1+ i))
+           ;; "=" means padding.  Insert "`" instead.  Not counted for length.
+           (progn (insert "`") (setq len (1- len)))
+         (insert (tramp-uu-byte-to-uu-char (tramp-uu-b64-char-to-byte c)))
+         (setq i (1+ i)))
        ;; Every 60 characters, add "M" at beginning of line (as
        ;; length byte) and insert a newline.
        (when (zerop (% i 60))
index 0fd955b27bcc2087413f2f6ea6eba9c1e4106635..1350774dbaa6853771b583f7b429ca63a3cbefb4 100644 (file)
@@ -911,12 +911,13 @@ The answer will be provided by `tramp-action-terminal', which see."
   :group 'tramp
   :type 'regexp)
 
-(defcustom tramp-out-of-band-prompt-regexp
+(defcustom tramp-process-alive-regexp
   ""
-  "Regular expression indicating an out-of-band copy has finished.
+  "Regular expression indicating a process has finished.
 In fact this expression is empty by intention, it will be used only to
 check regularly the status of the associated process.
-The answer will be provided by `tramp-action-out-of-band', which see."
+The answer will be provided by `tramp-action-process-alive' and
+`tramp-action-out-of-band', which see."
   :group 'tramp
   :type 'regexp)
 
@@ -1146,7 +1147,7 @@ Also see `tramp-file-name-structure'."
 
 ;;;###autoload
 (defconst tramp-completion-file-name-regexp-unified
-  "^/[^/]*$"
+  "^/$\\|^/[^/:][^/]*$"
   "Value for `tramp-completion-file-name-regexp' for unified remoting.
 Emacs (not XEmacs) uses a unified filename syntax for Ange-FTP and
 Tramp.  See `tramp-file-name-structure-unified' for more explanations.")
@@ -1288,7 +1289,8 @@ but it might be slow on large directories."
     (tramp-wrong-passwd-regexp tramp-action-permission-denied)
     (tramp-yesno-prompt-regexp tramp-action-yesno)
     (tramp-yn-prompt-regexp tramp-action-yn)
-    (tramp-terminal-prompt-regexp tramp-action-terminal))
+    (tramp-terminal-prompt-regexp tramp-action-terminal)
+    (tramp-process-alive-regexp tramp-action-process-alive))
   "List of pattern/action pairs.
 Whenever a pattern matches, the corresponding action is performed.
 Each item looks like (PATTERN ACTION).
@@ -1306,7 +1308,7 @@ corresponding PATTERN matches, the ACTION function is called."
 (defcustom tramp-actions-copy-out-of-band
   '((tramp-password-prompt-regexp tramp-action-password)
     (tramp-wrong-passwd-regexp tramp-action-permission-denied)
-    (tramp-out-of-band-prompt-regexp tramp-action-out-of-band))
+    (tramp-process-alive-regexp tramp-action-out-of-band))
   "List of pattern/action pairs.
 This list is used for copying/renaming with out-of-band methods.
 See `tramp-actions-before-shell' for more info."
@@ -1318,7 +1320,8 @@ See `tramp-actions-before-shell' for more info."
     (tramp-login-prompt-regexp tramp-multi-action-login)
     (shell-prompt-pattern tramp-multi-action-succeed)
     (tramp-shell-prompt-pattern tramp-multi-action-succeed)
-    (tramp-wrong-passwd-regexp tramp-multi-action-permission-denied))
+    (tramp-wrong-passwd-regexp tramp-multi-action-permission-denied)
+    (tramp-process-alive-regexp tramp-action-process-alive))
   "List of pattern/action pairs.
 This list is used for each hop in multi-hop connections.
 See `tramp-actions-before-shell' for more info."
@@ -1326,7 +1329,8 @@ See `tramp-actions-before-shell' for more info."
   :type '(repeat (list variable function)))
 
 (defcustom tramp-initial-commands
-  '("unset correct"
+  '("unset HISTORY"
+    "unset correct"
     "unset autocorrect")
   "List of commands to send to the first remote shell that we see.
 These commands will be sent to any shell, and thus they should be
@@ -1768,6 +1772,7 @@ on the FILENAME argument, even if VISIT was a string.")
     (insert-directory . tramp-handle-insert-directory)
     (expand-file-name . tramp-handle-expand-file-name)
     (file-local-copy . tramp-handle-file-local-copy)
+    (file-remote-p . tramp-handle-file-remote-p)
     (insert-file-contents . tramp-handle-insert-file-contents)
     (write-region . tramp-handle-write-region)
     (find-backup-file-name . tramp-handle-find-backup-file-name)
@@ -2042,8 +2047,8 @@ target of the symlink differ."
   "Like `file-truename' for tramp files."
   (with-parsed-tramp-file-name filename nil
     (let* ((steps        (tramp-split-string localname "/"))
-          (localnamedir (let ((directory-sep-char ?/))
-                     (file-name-as-directory localname)))
+          (localnamedir (tramp-let-maybe directory-sep-char ?/ ;for XEmacs
+                          (file-name-as-directory localname)))
           (is-dir (string= localname localnamedir))
           (thisstep nil)
           (numchase 0)
@@ -2984,7 +2989,7 @@ be a local filename.  The method used must be an out-of-band method."
       ;; Use rcp-like program for file transfer.
       (let ((p (apply 'start-process (buffer-name trampbuf) trampbuf
                      copy-program copy-args)))
-       (process-kill-without-query p)
+       (tramp-set-process-query-on-exit-flag p nil)
        (tramp-process-actions p multi-method method user host
                               tramp-actions-copy-out-of-band))
       (kill-buffer trampbuf)
@@ -3297,7 +3302,7 @@ the result will be a local, non-Tramp, filename."
        ;; expand-file-name (this does "/./" and "/../").  We bind
        ;; directory-sep-char here for XEmacs on Windows, which
        ;; would otherwise use backslash.
-       (let ((directory-sep-char ?/))
+       (tramp-let-maybe directory-sep-char ?/
          (tramp-make-tramp-file-name
           multi-method (or method (tramp-find-default-method user host))
           user host
@@ -3525,6 +3530,9 @@ This will break if COMMAND prints a newline, followed by the value of
            (t (error "Wrong method specification for `%s'" method)))
       tmpfil)))
 
+(defun tramp-handle-file-remote-p (filename)
+  "Like `file-remote-p' for tramp files."
+  (when (tramp-tramp-file-p filename) t))
 
 (defun tramp-handle-insert-file-contents
   (filename &optional visit beg end replace)
@@ -3845,10 +3853,10 @@ pass to the OPERATION."
 
 ;; We handle here all file primitives.  Most of them have the file
 ;; name as first parameter; nevertheless we check for them explicitly
-;; in order to be be signalled if a new primitive appears.  This
+;; in order to be signalled if a new primitive appears.  This
 ;; scenario is needed because there isn't a way to decide by
 ;; syntactical means whether a foreign method must be called.  It would
-;; ease the live if `file-name-handler-alist' would support a decision
+;; ease the life if `file-name-handler-alist' would support a decision
 ;; function as well but regexp only.
 (defun tramp-file-name-for-operation (operation &rest args)
   "Return file name related to OPERATION file primitive.
@@ -3862,16 +3870,16 @@ ARGS are the arguments OPERATION has been called with."
                  'dired-compress-file 'dired-uncache
                  'file-accessible-directory-p 'file-attributes
                  'file-directory-p 'file-executable-p 'file-exists-p
-                 'file-local-copy 'file-modes 'file-name-as-directory
-                 'file-name-directory 'file-name-nondirectory
-                 'file-name-sans-versions 'file-ownership-preserved-p
-                 'file-readable-p 'file-regular-p 'file-symlink-p
-                 'file-truename 'file-writable-p 'find-backup-file-name
-                 'find-file-noselect 'get-file-buffer 'insert-directory
-                 'insert-file-contents 'load 'make-directory
-                 'make-directory-internal 'set-file-modes
-                 'substitute-in-file-name 'unhandled-file-name-directory
-                 'vc-registered
+                 'file-local-copy 'file-remote-p 'file-modes
+                 'file-name-as-directory 'file-name-directory
+                 'file-name-nondirectory 'file-name-sans-versions
+                 'file-ownership-preserved-p 'file-readable-p
+                 'file-regular-p 'file-symlink-p 'file-truename
+                 'file-writable-p 'find-backup-file-name 'find-file-noselect
+                 'get-file-buffer 'insert-directory 'insert-file-contents
+                 'load 'make-directory 'make-directory-internal
+                 'set-file-modes 'substitute-in-file-name
+                 'unhandled-file-name-directory 'vc-registered
                  ; XEmacs only
                  'abbreviate-file-name 'create-file-buffer
                  'dired-file-modtime 'dired-make-compressed-filename
@@ -3940,9 +3948,6 @@ Falls back to normal file name handler if no tramp file name handler exists."
        (foreign (apply foreign operation args))
        (t (tramp-run-real-handler operation args))))))
 
-;;;###autoload
-(put 'tramp-file-name-handler 'file-remote-p t)        ;for file-remote-p
-
 (defun tramp-sh-file-name-handler (operation &rest args)
   "Invoke remote-shell Tramp file name handler.
 Fall back to normal file name handler if no Tramp handler exists."
@@ -4887,16 +4892,16 @@ otherwise."
   "Checks whether the given `ls' executable in one of the dirs groks `-n'.
 Returns nil if none was found, else the command is returned."
   (let ((dl dirlist)
-        (result nil)
-       (directory-sep-char ?/))        ;for XEmacs
-    ;; It would be better to use the CL function `find', but
-    ;; we don't want run-time dependencies on CL.
-    (while (and dl (not result))
-      (let ((x (concat (file-name-as-directory (car dl)) cmd)))
-        (when (tramp-check-ls-command multi-method method user host x)
-          (setq result x)))
-      (setq dl (cdr dl)))
-    result))
+        (result nil))
+    (tramp-let-maybe directory-sep-char ?/ ;for XEmacs
+      ;; It would be better to use the CL function `find', but
+      ;; we don't want run-time dependencies on CL.
+      (while (and dl (not result))
+       (let ((x (concat (file-name-as-directory (car dl)) cmd)))
+         (when (tramp-check-ls-command multi-method method user host x)
+           (setq result x)))
+       (setq dl (cdr dl)))
+      result)))
 
 (defun tramp-find-ls-command (multi-method method user host)
   "Finds an `ls' command which groks the `-n' option, returning nil if failed.
@@ -4976,6 +4981,11 @@ The terminal type can be configured with `tramp-terminal-type'."
   (process-send-string nil (concat tramp-terminal-type
                                   tramp-rsh-end-of-line)))
 
+(defun tramp-action-process-alive (p multi-method method user host)
+  "Check whether a process has finished."
+  (unless (memq (process-status p) '(run open))
+    (throw 'tramp-action 'process-died)))
+
 (defun tramp-action-out-of-band (p multi-method method user host)
   "Check whether an out-of-band copy has finished."
   (cond ((and (memq (process-status p) '(stop exit))
@@ -5165,7 +5175,7 @@ Maybe the different regular expressions need to be tuned.
                        user host 'tramp-login-args)))
              (found nil)
              (pw nil))
-        (process-kill-without-query p)
+        (tramp-set-process-query-on-exit-flag p nil)
        (set-buffer (tramp-get-buffer multi-method method user host))
        (erase-buffer)
        (tramp-process-actions p multi-method method user host
@@ -5232,7 +5242,7 @@ arguments, and xx will be used as the host name to connect to.
                   (apply #'start-process bufnam buf login-program 
                          host login-args)))
              (found nil))
-        (process-kill-without-query p)
+        (tramp-set-process-query-on-exit-flag p nil)
 
        (set-buffer buf)
        (tramp-process-actions p multi-method method user host
@@ -5293,7 +5303,7 @@ prompt than you do, so it is not at all unlikely that the variable
                         user host 'tramp-login-args))))
              (found nil)
              (pw nil))
-        (process-kill-without-query p)
+        (tramp-set-process-query-on-exit-flag p nil)
        (set-buffer (tramp-get-buffer multi-method method user host))
        (tramp-process-actions p multi-method method user host
                               tramp-actions-before-shell)
@@ -5346,7 +5356,7 @@ log in as u2 to h2."
                                tramp-multi-sh-program))
              (num-hops (length method))
              (i 0))
-        (process-kill-without-query p)
+        (tramp-set-process-query-on-exit-flag p nil)
         (tramp-message 9 "Waiting 60s for local shell to come up...")
         (unless (tramp-wait-for-regexp
                 p 60 (format "\\(%s\\)\\'\\|\\(%s\\)\\'"
@@ -5466,12 +5476,16 @@ nil."
              (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))))))
@@ -5526,7 +5540,7 @@ Uses PROMPT as a prompt and sends the password to process P."
 
 ;; HHH: Not Changed.  This might handle the case where USER is not
 ;;      given in the "File name" very poorly.  Then, the local
-;;      variable tramp-current user will be set to nil.
+;;      variable tramp-current-user will be set to nil.
 (defun tramp-pre-connection (multi-method method user host)
   "Do some setup before actually logging in.
 METHOD, USER and HOST specify the connection."
@@ -5621,9 +5635,10 @@ to set up.  METHOD, USER and HOST specify the connection."
                                     "stty -onlcr"))))
   (erase-buffer)
   (tramp-message
-   9 "Waiting 30s for `HISTFILE=$HOME/.tramp_history; HISTSIZE=1'")
-  (tramp-send-command-internal multi-method method user host
-                              "HISTFILE=$HOME/.tramp_history; HISTSIZE=1")
+   9 "Waiting 30s for `HISTFILE=$HOME/.tramp_history; HISTSIZE=1; export HISTFILE; export HISTSIZE'")
+  (tramp-send-command-internal
+   multi-method method user host
+   "HISTFILE=$HOME/.tramp_history; HISTSIZE=1; export HISTFILE; export HISTSIZE")
   (erase-buffer)
   (tramp-message 9 "Waiting 30s for `set +o vi +o emacs'")
   (tramp-send-command-internal multi-method method user host
@@ -6079,12 +6094,16 @@ Sends COMMAND, then waits 30 seconds for shell prompt."
                (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))
                    (forward-line -1)
                    (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))
                (forward-line -1)
                (setq found (looking-at end-of-output))))))
@@ -6762,6 +6781,26 @@ If you want to use it for something else, you'll have to check whether
 it does the right thing."
   (delete "" (split-string string pattern)))
 
+(defun tramp-set-process-query-on-exit-flag (process flag)
+  "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)))
+
+(defmacro tramp-let-maybe (variable value &rest body)
+  "Let-bind VARIABLE to VALUE in BODY, but only if VARIABLE is not obsolete.
+BODY is executed whether or not the variable is obsolete.
+The intent is to protect against `obsolete variable' warnings."
+  `(if (get 'byte-obsolete-variable ',variable)
+       (progn ,@body)
+     (let ((,variable ,value))
+       ,@body)))
+(put 'tramp-let-maybe 'lisp-indent-function 2)
+
+
 ;; ------------------------------------------------------------ 
 ;; -- Kludges section -- 
 ;; ------------------------------------------------------------ 
index f2cf1df9650726a1893b28b5610a57a48b868129..9d0e220fe96224c21ccb673b600c73f19f92d257 100644 (file)
@@ -1,3 +1,7 @@
+2004-05-29  Michael Albinus  <michael.albinus@gmx.de>
+
+       Version 2.0.41 of Tramp released.
+
 2004-05-29  Juanma Barranquero  <lektu@terra.es>
 
        * makefile.w32-in (../info/flymake, flymake.dvi): New targets.
index b125e9a20b6341875bfb485fa1ef806230e4f140..4ffc14a48c26308aa77dfd94ad36abec73433df6 100644 (file)
@@ -4,7 +4,7 @@
 @c In the Tramp CVS, the version number is auto-frobbed from
 @c configure.ac, so you should edit that file and run
 @c "autoconf && ./configure" to change the version number.
-@set trampver 2.0.40
+@set trampver 2.0.41
 
 @c Other flags from configuration
 @set prefix /usr/local