emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 1b762de: Remove compat code in Tramp


From: Michael Albinus
Subject: [Emacs-diffs] master 1b762de: Remove compat code in Tramp
Date: Mon, 5 Dec 2016 15:06:20 +0000 (UTC)

branch: master
commit 1b762de16642cd08a7fbc47e2e0c058af2e09a11
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>

    Remove compat code in Tramp
    
    * lisp/net/tramp.el (tramp-parse-time-months): Remove.
    
    * lisp/net/tramp-compat.el (top): Require parse-time.
    
    * lisp/net/tramp-smb.el (tramp-smb-read-file-entry):
    Use `parse-time-months'.
---
 lisp/net/tramp-compat.el |    1 +
 lisp/net/tramp-smb.el    |    2 +-
 lisp/net/tramp.el        |    9 +--------
 3 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el
index 4ebae79..a079b67 100644
--- a/lisp/net/tramp-compat.el
+++ b/lisp/net/tramp-compat.el
@@ -37,6 +37,7 @@
 (require 'advice)
 (require 'custom)
 (require 'format-spec)
+(require 'parse-time)
 (require 'password-cache)
 (require 'shell)
 (require 'timer)
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index 61796a2..e52296f 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -1724,7 +1724,7 @@ Result is the list (LOCALNAME MODE SIZE MTIME)."
            (if (and sec min hour day month year)
                (encode-time
                 sec min hour day
-                (cdr (assoc (downcase month) tramp-parse-time-months))
+                (cdr (assoc (downcase month) parse-time-months))
                 year)
              '(0 0)))
       (list localname mode size mtime))))
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index a92b602..1eb66cf 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -4292,18 +4292,11 @@ Invokes `password-read' if available, `read-passwd' 
else."
        'auth-source-forget-user-or-password "password" host method))
     (password-cache-remove (tramp-make-tramp-file-name method user host ""))))
 
-;; Snarfed code from time-date.el and parse-time.el
+;; Snarfed code from time-date.el.
 
 (defconst tramp-half-a-year '(241 17024)
 "Evaluated by \"(days-to-time 183)\".")
 
-(defconst tramp-parse-time-months
-  '(("jan" . 1) ("feb" . 2) ("mar" . 3)
-    ("apr" . 4) ("may" . 5) ("jun" . 6)
-    ("jul" . 7) ("aug" . 8) ("sep" . 9)
-    ("oct" . 10) ("nov" . 11) ("dec" . 12))
-  "Alist mapping month names to integers.")
-
 ;;;###tramp-autoload
 (defun tramp-time-diff (t1 t2)
   "Return the difference between the two times, in seconds.



reply via email to

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