[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 5f640bf: Make last Tramp change backward compatible
From: |
Michael Albinus |
Subject: |
[Emacs-diffs] master 5f640bf: Make last Tramp change backward compatible to Emacs 24 |
Date: |
Sat, 23 Feb 2019 05:56:46 -0500 (EST) |
branch: master
commit 5f640bfdf84753322763be23ebaa8ded92dc1c5d
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>
Make last Tramp change backward compatible to Emacs 24
* lisp/net/tramp-cache.el (tramp-get-file-property):
* lisp/net/tramp-sh.el (tramp-maybe-open-connection):
* lisp/net/tramp-smb.el (tramp-smb-maybe-open-connection):
Make them backward compatible to Emacs 24.
---
lisp/net/tramp-cache.el | 11 ++++++++---
lisp/net/tramp-sh.el | 12 ++++++++----
lisp/net/tramp-smb.el | 5 +++--
3 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el
index 064b209..0fb9bea 100644
--- a/lisp/net/tramp-cache.el
+++ b/lisp/net/tramp-cache.el
@@ -128,9 +128,14 @@ Returns DEFAULT if not set."
(and (consp value)
(or (null remote-file-name-inhibit-cache)
(and (integerp remote-file-name-inhibit-cache)
- (time-less-p nil
- (time-add (car value)
- remote-file-name-inhibit-cache)))
+ (time-less-p
+ ;; `current-time' can be nil once we get rid of Emacs 24.
+ (current-time)
+ (time-add
+ (car value)
+ ;; `seconds-to-time' can be removed once we get
+ ;; rid of Emacs 24.
+ (seconds-to-time remote-file-name-inhibit-cache))))
(and (consp remote-file-name-inhibit-cache)
(time-less-p
remote-file-name-inhibit-cache (car value)))))
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 91ff153..2d02961 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -4785,8 +4785,11 @@ connection if a previous connection has died for some
reason."
(not (tramp-file-name-equal-p
vec (car tramp-current-connection)))
(time-less-p
- (or tramp-connection-min-time-diff 0)
- (time-since (cdr tramp-current-connection))))
+ ;; `current-time' can be removed once we get rid of Emacs 24.
+ (time-since (or (cdr tramp-current-connection) (current-time)))
+ ;; `seconds-to-time' can be removed once we get rid
+ ;; of Emacs 24.
+ (seconds-to-time (or tramp-connection-min-time-diff 0))))
(throw 'suppress 'suppress))
;; If too much time has passed since last command was sent, look
@@ -4797,10 +4800,11 @@ connection if a previous connection has died for some
reason."
;; try to send a command from time to time, then look again
;; whether the process is really alive.
(condition-case nil
- (when (and (time-less-p 60
+ ;; `seconds-to-time' can be removed once we get rid of Emacs 24.
+ (when (and (time-less-p (seconds-to-time 60)
(time-since
(tramp-get-connection-property
- p "last-cmd-time" 0)))
+ p "last-cmd-time" (seconds-to-time 0))))
(process-live-p p))
(tramp-send-command vec "echo are you awake" t t)
(unless (and (process-live-p p)
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index 31470b2..eda3081 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -1900,10 +1900,11 @@ If ARGUMENT is non-nil, use it as argument for
;; connection timeout.
(with-current-buffer buf
(goto-char (point-min))
- (when (and (time-less-p 60
+ ;; `seconds-to-time' can be removed once we get rid of Emacs 24.
+ (when (and (time-less-p (seconds-to-time 60)
(time-since
(tramp-get-connection-property
- p "last-cmd-time" 0)))
+ p "last-cmd-time" (seconds-to-time 0))))
(process-live-p p)
(re-search-forward tramp-smb-errors nil t))
(delete-process p)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 5f640bf: Make last Tramp change backward compatible to Emacs 24,
Michael Albinus <=