diff options
| author | Michael Albinus | 2012-02-26 20:36:59 +0100 |
|---|---|---|
| committer | Michael Albinus | 2012-02-26 20:36:59 +0100 |
| commit | 530739c9095230eed623d69f04b6ceec8c917da7 (patch) | |
| tree | 724f3462d855ed693f2c13cbf4cbee0cea0b4abb | |
| parent | 487915d7385aeef679d9a6f077f319540835da4c (diff) | |
| download | emacs-530739c9095230eed623d69f04b6ceec8c917da7.tar.gz emacs-530739c9095230eed623d69f04b6ceec8c917da7.zip | |
* net/tramp.el (tramp-inodes, tramp-devices): Initialize with 0.
(tramp-get-inode, tramp-get-device): Use cached values.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 26 |
2 files changed, 11 insertions, 20 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a79b6307d16..76a7ccfe753 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-02-26 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * net/tramp.el (tramp-inodes, tramp-devices): Initialize with 0. | ||
| 4 | (tramp-get-inode, tramp-get-device): Use cached values. | ||
| 5 | |||
| 1 | 2012-02-26 Alan Mackenzie <acm@muc.de> | 6 | 2012-02-26 Alan Mackenzie <acm@muc.de> |
| 2 | 7 | ||
| 3 | Check there is a font-lock specification before doing initial | 8 | Check there is a font-lock specification before doing initial |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index cc1977dfe22..a5e3da9d04c 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -1650,7 +1650,7 @@ been set up by `rfn-eshadow-setup-minibuffer'." | |||
| 1650 | ;; applied might be not so efficient (Ange-FTP uses hashes). But | 1650 | ;; applied might be not so efficient (Ange-FTP uses hashes). But |
| 1651 | ;; performance isn't the major issue given that file transfer will | 1651 | ;; performance isn't the major issue given that file transfer will |
| 1652 | ;; take time. | 1652 | ;; take time. |
| 1653 | (defvar tramp-inodes nil | 1653 | (defvar tramp-inodes 0 |
| 1654 | "Keeps virtual inodes numbers.") | 1654 | "Keeps virtual inodes numbers.") |
| 1655 | 1655 | ||
| 1656 | ;; Devices must distinguish physical file systems. The device numbers | 1656 | ;; Devices must distinguish physical file systems. The device numbers |
| @@ -1658,7 +1658,7 @@ been set up by `rfn-eshadow-setup-minibuffer'." | |||
| 1658 | ;; So we use virtual device numbers, generated by Tramp. Both Ange-FTP and | 1658 | ;; So we use virtual device numbers, generated by Tramp. Both Ange-FTP and |
| 1659 | ;; EFS use device number "-1". In order to be different, we use device number | 1659 | ;; EFS use device number "-1". In order to be different, we use device number |
| 1660 | ;; (-1 . x), whereby "x" is unique for a given (method user host). | 1660 | ;; (-1 . x), whereby "x" is unique for a given (method user host). |
| 1661 | (defvar tramp-devices nil | 1661 | (defvar tramp-devices 0 |
| 1662 | "Keeps virtual device numbers.") | 1662 | "Keeps virtual device numbers.") |
| 1663 | 1663 | ||
| 1664 | (defun tramp-default-file-modes (filename) | 1664 | (defun tramp-default-file-modes (filename) |
| @@ -3412,28 +3412,14 @@ the remote host use line-endings as defined in the variable | |||
| 3412 | (defun tramp-get-inode (vec) | 3412 | (defun tramp-get-inode (vec) |
| 3413 | "Returns the virtual inode number. | 3413 | "Returns the virtual inode number. |
| 3414 | If it doesn't exist, generate a new one." | 3414 | If it doesn't exist, generate a new one." |
| 3415 | (let ((string (tramp-make-tramp-file-name | 3415 | (with-file-property vec (tramp-file-name-localname vec) "inode" |
| 3416 | (tramp-file-name-method vec) | 3416 | (setq tramp-inodes (1+ tramp-inodes)))) |
| 3417 | (tramp-file-name-user vec) | ||
| 3418 | (tramp-file-name-host vec) | ||
| 3419 | ""))) | ||
| 3420 | (unless (assoc string tramp-inodes) | ||
| 3421 | (add-to-list 'tramp-inodes | ||
| 3422 | (list string (length tramp-inodes)))) | ||
| 3423 | (nth 1 (assoc string tramp-inodes)))) | ||
| 3424 | 3417 | ||
| 3425 | (defun tramp-get-device (vec) | 3418 | (defun tramp-get-device (vec) |
| 3426 | "Returns the virtual device number. | 3419 | "Returns the virtual device number. |
| 3427 | If it doesn't exist, generate a new one." | 3420 | If it doesn't exist, generate a new one." |
| 3428 | (let ((string (tramp-make-tramp-file-name | 3421 | (with-connection-property (tramp-get-connection-process vec) "device" |
| 3429 | (tramp-file-name-method vec) | 3422 | (cons -1 (setq tramp-devices (1+ tramp-devices))))) |
| 3430 | (tramp-file-name-user vec) | ||
| 3431 | (tramp-file-name-host vec) | ||
| 3432 | ""))) | ||
| 3433 | (unless (assoc string tramp-devices) | ||
| 3434 | (add-to-list 'tramp-devices | ||
| 3435 | (list string (length tramp-devices)))) | ||
| 3436 | (cons -1 (nth 1 (assoc string tramp-devices))))) | ||
| 3437 | 3423 | ||
| 3438 | (defun tramp-equal-remote (file1 file2) | 3424 | (defun tramp-equal-remote (file1 file2) |
| 3439 | "Check, whether the remote parts of FILE1 and FILE2 are identical. | 3425 | "Check, whether the remote parts of FILE1 and FILE2 are identical. |