]> code.delx.au - gnu-emacs/blobdiff - lisp/net/tramp.el
Merged from emacs@sv.gnu.org.
[gnu-emacs] / lisp / net / tramp.el
index 000b0922b5016291c8a716627d805fd7196f6aac..822a995230e2540056e61f9e9a57890051d95110 100644 (file)
@@ -693,20 +693,18 @@ various functions for details."
   ;; another good choice because of the "ControlMaster" option, but
   ;; this is a more modern alternative in OpenSSH 4, which cannot be
   ;; taken as default.
-  (let ((e-f (and (fboundp 'executable-find)
-                 (symbol-function 'executable-find))))
+  (let ((e-f (fboundp 'executable-find)))
     (cond
      ;; PuTTY is installed.
-     ((and e-f (funcall e-f "pscp"))
+     ((and e-f (funcall 'executable-find "pscp"))
       (if (or (fboundp 'password-read)
              ;; Pageant is running.
              (and (fboundp 'w32-window-exists-p)
-                  (funcall (symbol-function 'w32-window-exists-p)
-                           "Pageant" "Pageant")))
+                  (funcall 'w32-window-exists-p "Pageant" "Pageant")))
          "pscp"
        "plink"))
      ;; There is an ssh installation.
-     ((and e-f (funcall e-f "scp"))
+     ((and e-f (funcall 'executable-find "scp"))
       (if (or (fboundp 'password-read)
              ;; ssh-agent is running.
              (getenv "SSH_AUTH_SOCK")
@@ -956,8 +954,10 @@ See also `tramp-yn-prompt-regexp'."
   :type 'regexp)
 
 (defcustom tramp-yn-prompt-regexp
-  (concat (regexp-opt '("Store key in cache? (y/n)") t)
-         "\\s-*")
+  (concat
+   (regexp-opt '("Store key in cache? (y/n)"
+                "Update cached key? (y/n, Return cancels connection)") t)
+   "\\s-*")
   "Regular expression matching all y/n queries which need to be confirmed.
 The confirmation should be done with y or n.
 The regexp should match at end of buffer.
@@ -2075,7 +2075,9 @@ If VAR is nil, then we bind `v' to the structure and `multi-method',
 ;; Enable debugging.
 (def-edebug-spec with-parsed-tramp-file-name (form symbolp body))
 ;; Highlight as keyword.
-(font-lock-add-keywords 'emacs-lisp-mode '("\\<with-parsed-tramp-file-name\\>"))
+(when (functionp 'font-lock-add-keywords)
+  (funcall 'font-lock-add-keywords
+          'emacs-lisp-mode '("\\<with-parsed-tramp-file-name\\>")))
 
 (defmacro tramp-let-maybe (variable value &rest body)
   "Let-bind VARIABLE to VALUE in BODY, but only if VARIABLE is not obsolete.
@@ -4526,7 +4528,6 @@ Falls back to normal file name handler if no tramp file name handler exists."
   "Checks whether method / user name / host name completion is active."
   (cond
    (tramp-completion-mode t)
-   ((not tramp-unified-filenames) t)
    ((string-match "^/.*:.*:$" file) nil)
    ((string-match
      (concat tramp-prefix-regexp
@@ -4535,7 +4536,7 @@ Falls back to normal file name handler if no tramp file name handler exists."
     (member (match-string 1 file) (mapcar 'car tramp-methods)))
    ((or (equal last-input-event 'tab)
        ;; Emacs
-       (and (integerp last-input-event)
+       (and (wholenump last-input-event)
             (or
              ;; ?\t has event-modifier 'control
              (char-equal last-input-event ?\t)
@@ -5104,13 +5105,23 @@ hosts, or files, disagree."
 (defun tramp-touch (file time)
   "Set the last-modified timestamp of the given file.
 TIME is an Emacs internal time value as returned by `current-time'."
-  (let ((touch-time (format-time-string "%Y%m%d%H%M.%S" time t)))
+  (let* ((utc
+         ;; With GNU Emacs, `format-time-string' has an optional
+         ;; parameter UNIVERSAL.  This is preferred.
+         (and (functionp 'subr-arity)
+              (= 3 (cdr (funcall (symbol-function 'subr-arity)
+                                 (symbol-function 'format-time-string))))))
+        (touch-time
+         (if utc
+             (format-time-string "%Y%m%d%H%M.%S" time t)
+           (format-time-string "%Y%m%d%H%M.%S" time))))
     (if (tramp-tramp-file-p file)
        (with-parsed-tramp-file-name file nil
          (let ((buf (tramp-get-buffer multi-method method user host)))
            (unless (zerop (tramp-send-command-and-check
                            multi-method method user host
-                           (format "TZ=UTC; export TZ; touch -t %s %s"
+                           (format "%s touch -t %s %s"
+                                   (if utc "TZ=UTC; export TZ;" "")
                                    touch-time
                                    (tramp-shell-quote-argument localname))
                            t))