tramp-devel
[Top][All Lists]
Advanced

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

Re: problem with tramp-time-diff


From: Kai Großjohann
Subject: Re: problem with tramp-time-diff
Date: Fri, 27 Jun 2003 11:18:47 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)

Rodney Sparapani <address@hidden> writes:

> Hi.  I've been following tramp's development with interest the last
> 3 years.  But, for whatever reason, I've never been able to get it
> to work.  However, today I decided to do it.  I'm using xemacs
> 21.4.12.  And, I kept getting error messages about subtract-time
> which is not defined.  The code in tramp-time-diff seemed to take
> that into account.

Yes, so why is it failing for you?  The current Tramp has this code
for tramp-time-diff:

(defun tramp-time-diff (t1 t2)
  "Return the difference between the two times, in seconds.
T1 and T2 are time values (as returned by `current-time' for example).

NOTE: This function will fail if the time difference is too large to
fit in an integer."
  ;; Pacify byte-compiler with `symbol-function'.
  (cond ((and (fboundp 'subtract-time)
              (fboundp 'float-time))
         (funcall (symbol-function 'float-time)
                  (funcall (symbol-function 'subtract-time) t1 t2)))
        ((and (fboundp 'subtract-time)
              (fboundp 'time-to-seconds))
         (funcall (symbol-function 'time-to-seconds)
                  (funcall (symbol-function 'subtract-time) t1 t2)))
        ((fboundp 'itimer-time-difference)
         (floor (funcall
                 (symbol-function 'itimer-time-difference)
                 (if (< (length t1) 3) (append t1 '(0)) t1)
                 (if (< (length t2) 3) (append t2 '(0)) t2))))
        (t
         ;; snarfed from Emacs 21 time-date.el; combining
         ;; time-to-seconds and subtract-time
         (let ((time  (let ((borrow (< (cadr t1) (cadr t2))))
                 (list (- (car t1) (car t2) (if borrow 1 0))
                       (- (+ (if borrow 65536 0) (cadr t1)) (cadr t2))))))
           (+ (* (car time) 65536.0)
              (cadr time)
              (/ (or (nth 2 time) 0) 1000000.0))))))

It does not invoke subtract-time when it is undefined.  At least,
that's what I hope.

Does your version of tramp-time-diff look similar to the above?  If
it doesn't, then maybe it helps to install the most recent version of
Tramp (from savannah.gnu.org).

If you have the above code and it still doesn't work, then please
provide a backtrace.  You can do this with M-x toggle-debug-on-error
RET and the reproducing the problem.

I just started XEmacs 21.4.12 with my current version of Tramp, then
M-x ielm RET and then I evaled the expression (tramp-time-diff '(0 1)
'(0 2)) in that buffer and got -1, as expected.
-- 
~/.signature




reply via email to

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