emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r100587: * net/tramp.el (tramp-remote


From: Michael Albinus
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r100587: * net/tramp.el (tramp-remote-process-environment): Protect version
Date: Sat, 12 Jun 2010 10:59:37 +0200
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 100587
committer: Michael Albinus <address@hidden>
branch nick: trunk
timestamp: Sat 2010-06-12 10:59:37 +0200
message:
  * net/tramp.el (tramp-remote-process-environment): Protect version
  string by apostroph.
  (tramp-shell-prompt-pattern): Do not use a shy group in case of
  XEmacs.
  (tramp-file-name-for-operation): Add `call-process-region'.
  (tramp-set-process-query-on-exit-flag): Fix wrong parentheses.
  
  * net/tramp-compat.el (top): Do not autoload
  `tramp-handle-file-remote-p'.  Load tramp-util.el and tramp-vc.el
  only when `start-file-process' is not bound.
  (tramp-advice-file-expand-wildcards): Do not use
  `tramp-handle-file-remote-p'.
  (tramp-compat-make-temp-file): Handle the case, that
  `make-temp-file' has no third argument EXTENSION.
modified:
  lisp/ChangeLog
  lisp/net/tramp-compat.el
  lisp/net/tramp.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-06-11 21:26:13 +0000
+++ b/lisp/ChangeLog    2010-06-12 08:59:37 +0000
@@ -1,3 +1,20 @@
+2010-06-12  Michael Albinus  <address@hidden>
+
+       * net/tramp.el (tramp-remote-process-environment): Protect version
+       string by apostroph.
+       (tramp-shell-prompt-pattern): Do not use a shy group in case of
+       XEmacs.
+       (tramp-file-name-for-operation): Add `call-process-region'.
+       (tramp-set-process-query-on-exit-flag): Fix wrong parentheses.
+
+       * net/tramp-compat.el (top): Do not autoload
+       `tramp-handle-file-remote-p'.  Load tramp-util.el and tramp-vc.el
+       only when `start-file-process' is not bound.
+       (tramp-advice-file-expand-wildcards): Do not use
+       `tramp-handle-file-remote-p'.
+       (tramp-compat-make-temp-file): Handle the case, that
+       `make-temp-file' has no third argument EXTENSION.
+
 2010-06-11  Juanma Barranquero  <address@hidden>
 
        * makefile.w32-in (WINS_BASIC): Include new directory vc.
@@ -45,7 +62,7 @@
 
        * net/notifications.el (notifications-on-action-signal)
        (notifications-on-closed-signal): Pass notification id as first
-       argument to the callback functions. Add docstrings.
+       argument to the callback functions.  Add docstrings.
        (notifications-notify): Fix docstring.
 
 2010-06-10  Glenn Morris  <address@hidden>

=== modified file 'lisp/net/tramp-compat.el'
--- a/lisp/net/tramp-compat.el  2010-05-28 13:28:36 +0000
+++ b/lisp/net/tramp-compat.el  2010-06-12 08:59:37 +0000
@@ -44,33 +44,31 @@
 
   (autoload 'tramp-tramp-file-p "tramp")
   (autoload 'tramp-file-name-handler "tramp")
-  (autoload 'tramp-handle-file-remote-p "tramp")
-
-  ;; tramp-util offers integration into other (X)Emacs packages like
-  ;; compile.el, gud.el etc.  Not necessary in Emacs 23.
-  (eval-after-load "tramp"
-    ;; We check whether `start-file-process' is an alias.
-    '(when (or (not (fboundp 'start-file-process))
-              (symbolp (symbol-function 'start-file-process)))
-       (require 'tramp-util)
-       (add-hook 'tramp-unload-hook
-                '(lambda ()
-                   (when (featurep 'tramp-util)
-                     (unload-feature 'tramp-util 'force))))))
-
-  ;; Make sure that we get integration with the VC package.  When it
-  ;; is loaded, we need to pull in the integration module.  Not
-  ;; necessary in Emacs 23.
-  (eval-after-load "vc"
+
+  ;; We check whether `start-file-process' is bound.
+  (unless (fboundp 'start-file-process)
+
+    ;; tramp-util offers integration into other (X)Emacs packages like
+    ;; compile.el, gud.el etc.  Not necessary in Emacs 23.
     (eval-after-load "tramp"
-      ;; We check whether `start-file-process' is an alias.
-      '(when (or (not (fboundp 'start-file-process))
-                (symbolp (symbol-function 'start-file-process)))
-        (require 'tramp-vc)
+      '(progn
+        (require 'tramp-util)
         (add-hook 'tramp-unload-hook
                   '(lambda ()
-                     (when (featurep 'tramp-vc)
-                       (unload-feature 'tramp-vc 'force)))))))
+                     (when (featurep 'tramp-util)
+                       (unload-feature 'tramp-util 'force))))))
+
+    ;; Make sure that we get integration with the VC package.  When it
+    ;; is loaded, we need to pull in the integration module.  Not
+    ;; necessary in Emacs 23.
+    (eval-after-load "vc"
+      (eval-after-load "tramp"
+       '(progn
+          (require 'tramp-vc)
+          (add-hook 'tramp-unload-hook
+                    '(lambda ()
+                       (when (featurep 'tramp-vc)
+                         (unload-feature 'tramp-vc 'force))))))))
 
   ;; Avoid byte-compiler warnings if the byte-compiler supports this.
   ;; Currently, XEmacs supports this.
@@ -176,7 +174,8 @@
        (if (and
             (tramp-tramp-file-p name)
             (not (string-match
-                  "[[*?]" (tramp-handle-file-remote-p name 'localname))))
+                  "[[*?]" (tramp-compat-funcall
+                           'file-remote-p name 'localname))))
            (setq ad-return-value (list name))
          ;; Otherwise, just run the original function.
          ad-do-it)))
@@ -236,22 +235,23 @@
                  (tramp-compat-temporary-file-directory)))
         (extension (file-name-extension filename t))
         result)
-    (if (fboundp 'make-temp-file)
+    (condition-case nil
        (setq result
              (tramp-compat-funcall 'make-temp-file prefix dir-flag extension))
-      ;; We use our own implementation, taken from files.el.
-      (while
-         (condition-case ()
-             (progn
-               (setq result (concat (make-temp-name prefix) extension))
-               (if dir-flag
-                   (make-directory result)
-                 (write-region "" nil result nil 'silent))
-               nil)
-           (file-already-exists t))
-       ;; The file was somehow created by someone else between
-       ;; `make-temp-name' and `write-region', let's try again.
-       nil))
+      (error
+       ;; We use our own implementation, taken from files.el.
+       (while
+          (condition-case ()
+              (progn
+                (setq result (concat (make-temp-name prefix) extension))
+                (if dir-flag
+                    (make-directory result)
+                  (write-region "" nil result nil 'silent))
+                nil)
+            (file-already-exists t))
+        ;; The file was somehow created by someone else between
+        ;; `make-temp-name' and `write-region', let's try again.
+        nil)))
     result))
 
 ;; `most-positive-fixnum' does not exist in XEmacs.

=== modified file 'lisp/net/tramp.el'
--- a/lisp/net/tramp.el 2010-05-28 14:48:56 +0000
+++ b/lisp/net/tramp.el 2010-06-12 08:59:37 +0000
@@ -1065,7 +1065,7 @@
   `("HISTFILE=$HOME/.tramp_history" "HISTSIZE=1" "LC_ALL=C"
     ,(format "TERM=%s" tramp-terminal-type)
     "EMACS=t" ;; Deprecated.
-    ,(format "INSIDE_EMACS=%s,tramp:%s" emacs-version tramp-version)
+    ,(format "INSIDE_EMACS='%s,tramp:%s'" emacs-version tramp-version)
     "CDPATH=" "HISTORY=" "MAIL=" "MAILCHECK=" "MAILPATH="
     "autocorrect=" "correct=")
 
@@ -1091,8 +1091,10 @@
 
 (defcustom tramp-shell-prompt-pattern
   ;; Allow a prompt to start right after a ^M since it indeed would be
-  ;; displayed at the beginning of the line (and Zsh uses it).
-  "\\(?:^\\|\r\\)[^#$%>\n]*#?[#$%>] *\\(\e\\[[0-9;]*[a-zA-Z] *\\)*"
+  ;; displayed at the beginning of the line (and Zsh uses it).  This
+  ;; regexp works only for GNU Emacs.
+  (concat (if (featurep 'xemacs) "" "\\(?:^\\|\r\\)")
+         "[^#$%>\n]*#?[#$%>] *\\(\e\\[[0-9;]*[a-zA-Z] *\\)*")
   "Regexp to match prompts from remote shell.
 Normally, Tramp expects you to configure `shell-prompt-pattern'
 correctly, but sometimes it happens that you are connecting to a
@@ -5513,7 +5515,8 @@
                  ;; XEmacs only.
                  'dired-print-file 'dired-shell-call-process
                  ;; nowhere yet.
-                 'executable-find 'start-process 'call-process))
+                 'executable-find 'start-process
+                 'call-process 'call-process-region))
     default-directory)
    ;; Unknown file primitive.
    (t (error "unknown file I/O primitive: %s" operation))))
@@ -8758,7 +8761,7 @@
 exiting if process is running."
   (if (fboundp 'set-process-query-on-exit-flag)
       (tramp-compat-funcall 'set-process-query-on-exit-flag process flag)
-    (tramp-compat-funcall 'process-kill-without-query) process flag))
+    (tramp-compat-funcall 'process-kill-without-query process flag)))
 
 
 ;; ------------------------------------------------------------
@@ -8914,7 +8917,7 @@
 ;;   rsync).
 ;; * Keep a second connection open for out-of-band methods like scp or
 ;;   rsync.
-;; * Support ptys in `tramp-handle-start-file-process'.  (Bug#4604)
+;; * Support ptys in `tramp-handle-start-file-process'.  (Bug#4604, Bug#6360)
 ;; * IMHO, it's a drawback that currently Tramp doesn't support
 ;;   Unicode in Dired file names by default.  Is it possible to
 ;;   improve Tramp to set LC_ALL to "C" only for commands where Tramp


reply via email to

[Prev in Thread] Current Thread [Next in Thread]