+2014-11-20 Michael Albinus <michael.albinus@gmx.de>
+
+ Improve XEmacs compatibility.
+
+ * net/tramp.el (tramp-autoload-file-name-handler):
+ Wrap `temporary-file-directory' by `symbol-value', it doesn't
+ exist in XEmacs.
+ (tramp-read-passwd): Don't use `with-timeout-suspend' and
+ `with-timeout-unsuspend' if they don't exist, like in XEmacs.
+ (tramp-time-less-p, tramp-time-subtract): Remove functions.
+ (tramp-handle-file-newer-than-file-p, tramp-time-diff):
+ * net/ttramp-adb.el (tramp-adb-ls-output-time-less-p):
+ * net/ttramp-cache.el (tramp-get-file-property):
+ * net/ttramp-smb.el (tramp-smb-handle-insert-directory):
+ Use `time-less-p' and `time-subtract, respectively.
+
+ * net/ttramp-adb.el (top): Do not require time-date.el.
+
+ * net/ttramp-compat.el (top): Require time-date.el for XEmacs.
+
+ * net/ttramp-sh.el (tramp-open-connection-setup-interactive-shell):
+ Check, whether `utf-8' is a valid coding system.
+
2014-11-19 Eli Zaretskii <eliz@gnu.org>
* vc/vc.el (vc-retrieve-tag): Doc fix.
;;;###autoload
(progn (defun tramp-autoload-file-name-handler (operation &rest args)
"Load Tramp file name handler, and perform OPERATION."
- ;; Avoid recursive loading of tramp.el.
- (let ((default-directory temporary-file-directory))
+ ;; Avoid recursive loading of tramp.el. `temporary-file-directory'
+ ;; does not exist in XEmacs, so we must use something else.
+ (let ((default-directory (or (symbol-value 'temporary-file-directory) "/")))
(load "tramp" nil t))
(apply operation args)))
(cond
((not (file-exists-p file1)) nil)
((not (file-exists-p file2)) t)
- (t (tramp-time-less-p (nth 5 (file-attributes file2))
- (nth 5 (file-attributes file1))))))
+ (t (time-less-p (nth 5 (file-attributes file2))
+ (nth 5 (file-attributes file1))))))
(defun tramp-handle-file-regular-p (filename)
"Like `file-regular-p' for Tramp files."
(tramp-check-for-regexp proc tramp-password-prompt-regexp)
(format "%s for %s " (capitalize (match-string 1)) key))))
;; We suspend the timers while reading the password.
- (stimers (with-timeout-suspend))
+ (stimers (and (functionp 'with-timeout-suspend)
+ (tramp-compat-funcall 'with-timeout-suspend)))
auth-info auth-passwd)
(unwind-protect
(read-passwd pw-prompt))
(tramp-set-connection-property v "first-password-request" nil)))
;; Reenable the timers.
- (with-timeout-unsuspend stimers))))
+ (and (functionp 'with-timeout-unsuspend)
+ (tramp-compat-funcall 'with-timeout-unsuspend stimers)))))
;;;###tramp-autoload
(defun tramp-clear-passwd (vec)
("oct" . 10) ("nov" . 11) ("dec" . 12))
"Alist mapping month names to integers.")
-;; FIXME: Shouldn't this also look at any subseconds parts of T1 and T2?
-;;;###tramp-autoload
-(defun tramp-time-less-p (t1 t2)
- "Say whether time value T1 is less than time value T2."
- (unless t1 (setq t1 '(0 0)))
- (unless t2 (setq t2 '(0 0)))
- (or (< (car t1) (car t2))
- (and (= (car t1) (car t2))
- (< (nth 1 t1) (nth 1 t2)))))
-
-;; FIXME: Shouldn't this also look at any subseconds parts of T1 and T2?
-(defun tramp-time-subtract (t1 t2)
- "Subtract two time values.
-Return the difference in the format of a time value."
- (unless t1 (setq t1 '(0 0)))
- (unless t2 (setq t2 '(0 0)))
- (let ((borrow (< (cadr t1) (cadr t2))))
- (list (- (car t1) (car t2) (if borrow 1 0))
- (- (+ (if borrow 65536 0) (cadr t1)) (cadr t2)))))
-
;;;###tramp-autoload
(defun tramp-time-diff (t1 t2)
"Return the difference between the two times, in seconds.
(if (< (length t1) 3) (append t1 '(0)) t1)
(if (< (length t2) 3) (append t2 '(0)) t2)))
(t
- (let ((time (tramp-time-subtract t1 t2)))
+ (let ((time (time-subtract t1 t2)))
(+ (* (car time) 65536.0)
(cadr time)
(/ (or (nth 2 time) 0) 1000000.0))))))