diff options
| author | Michael Albinus | 2011-06-21 21:51:26 +0200 |
|---|---|---|
| committer | Michael Albinus | 2011-06-21 21:51:26 +0200 |
| commit | 065ec2c78bedd587cbaccf5491f262b0b3fa6da0 (patch) | |
| tree | c72e33af18c8981b09c5a8d9228eda5efdb45233 | |
| parent | cd93b3593035164d988fd4a21084dc60226b5b33 (diff) | |
| download | emacs-065ec2c78bedd587cbaccf5491f262b0b3fa6da0.tar.gz emacs-065ec2c78bedd587cbaccf5491f262b0b3fa6da0.zip | |
* net/tramp-cache.el (top): Don't load the persistency file when
"emacs -Q" has been called.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/net/tramp-cache.el | 78 |
2 files changed, 46 insertions, 37 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5c6c84fe3db..61606fb61e8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2011-06-21 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * net/tramp-cache.el (top): Don't load the persistency file when | ||
| 4 | "emacs -Q" has been called. | ||
| 5 | |||
| 1 | 2011-06-21 Tim Harper <timcharper@gmail.com> | 6 | 2011-06-21 Tim Harper <timcharper@gmail.com> |
| 2 | 7 | ||
| 3 | * term/ns-win.el (ns-initialize-window-system): set | 8 | * term/ns-win.el (ns-initialize-window-system): set |
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el index e3e6264b28f..9397025cb60 100644 --- a/lisp/net/tramp-cache.el +++ b/lisp/net/tramp-cache.el | |||
| @@ -177,9 +177,9 @@ Remove also properties of all files in subdirectories." | |||
| 177 | (tramp-message vec 8 "%s" directory) | 177 | (tramp-message vec 8 "%s" directory) |
| 178 | (maphash | 178 | (maphash |
| 179 | (lambda (key value) | 179 | (lambda (key value) |
| 180 | (when (and (stringp (tramp-file-name-localname key)) | 180 | (when (and (stringp (tramp-file-name-localname key)) |
| 181 | (string-match directory (tramp-file-name-localname key))) | 181 | (string-match directory (tramp-file-name-localname key))) |
| 182 | (remhash key tramp-cache-data))) | 182 | (remhash key tramp-cache-data))) |
| 183 | tramp-cache-data))) | 183 | tramp-cache-data))) |
| 184 | 184 | ||
| 185 | ;; Reverting or killing a buffer should also flush file properties. | 185 | ;; Reverting or killing a buffer should also flush file properties. |
| @@ -200,12 +200,12 @@ Remove also properties of all files in subdirectories." | |||
| 200 | (add-hook 'kill-buffer-hook 'tramp-flush-file-function) | 200 | (add-hook 'kill-buffer-hook 'tramp-flush-file-function) |
| 201 | (add-hook 'tramp-cache-unload-hook | 201 | (add-hook 'tramp-cache-unload-hook |
| 202 | (lambda () | 202 | (lambda () |
| 203 | (remove-hook 'before-revert-hook | 203 | (remove-hook 'before-revert-hook |
| 204 | 'tramp-flush-file-function) | 204 | 'tramp-flush-file-function) |
| 205 | (remove-hook 'eshell-pre-command-hook | 205 | (remove-hook 'eshell-pre-command-hook |
| 206 | 'tramp-flush-file-function) | 206 | 'tramp-flush-file-function) |
| 207 | (remove-hook 'kill-buffer-hook | 207 | (remove-hook 'kill-buffer-hook |
| 208 | 'tramp-flush-file-function))) | 208 | 'tramp-flush-file-function))) |
| 209 | 209 | ||
| 210 | ;;; -- Properties -- | 210 | ;;; -- Properties -- |
| 211 | 211 | ||
| @@ -290,17 +290,17 @@ KEY identifies the connection, it is either a process or a vector." | |||
| 290 | (let (result) | 290 | (let (result) |
| 291 | (maphash | 291 | (maphash |
| 292 | (lambda (key value) | 292 | (lambda (key value) |
| 293 | (let ((tmp (format | 293 | (let ((tmp (format |
| 294 | "(%s %s)" | 294 | "(%s %s)" |
| 295 | (if (processp key) | 295 | (if (processp key) |
| 296 | (prin1-to-string (prin1-to-string key)) | 296 | (prin1-to-string (prin1-to-string key)) |
| 297 | (prin1-to-string key)) | 297 | (prin1-to-string key)) |
| 298 | (if (hash-table-p value) | 298 | (if (hash-table-p value) |
| 299 | (tramp-cache-print value) | 299 | (tramp-cache-print value) |
| 300 | (if (bufferp value) | 300 | (if (bufferp value) |
| 301 | (prin1-to-string (prin1-to-string value)) | 301 | (prin1-to-string (prin1-to-string value)) |
| 302 | (prin1-to-string value)))))) | 302 | (prin1-to-string value)))))) |
| 303 | (setq result (if result (concat result " " tmp) tmp)))) | 303 | (setq result (if result (concat result " " tmp) tmp)))) |
| 304 | table) | 304 | table) |
| 305 | result))) | 305 | result))) |
| 306 | 306 | ||
| @@ -310,8 +310,8 @@ KEY identifies the connection, it is either a process or a vector." | |||
| 310 | (let (result) | 310 | (let (result) |
| 311 | (maphash | 311 | (maphash |
| 312 | (lambda (key value) | 312 | (lambda (key value) |
| 313 | (when (and (vectorp key) (null (aref key 3))) | 313 | (when (and (vectorp key) (null (aref key 3))) |
| 314 | (add-to-list 'result key))) | 314 | (add-to-list 'result key))) |
| 315 | tramp-cache-data) | 315 | tramp-cache-data) |
| 316 | result)) | 316 | result)) |
| 317 | 317 | ||
| @@ -327,12 +327,12 @@ KEY identifies the connection, it is either a process or a vector." | |||
| 327 | ;; Remove temporary data. | 327 | ;; Remove temporary data. |
| 328 | (maphash | 328 | (maphash |
| 329 | (lambda (key value) | 329 | (lambda (key value) |
| 330 | (if (and (vectorp key) (not (tramp-file-name-localname key))) | 330 | (if (and (vectorp key) (not (tramp-file-name-localname key))) |
| 331 | (progn | 331 | (progn |
| 332 | (remhash "process-name" value) | 332 | (remhash "process-name" value) |
| 333 | (remhash "process-buffer" value) | 333 | (remhash "process-buffer" value) |
| 334 | (remhash "first-password-request" value)) | 334 | (remhash "first-password-request" value)) |
| 335 | (remhash key cache))) | 335 | (remhash key cache))) |
| 336 | cache) | 336 | cache) |
| 337 | ;; Dump it. | 337 | ;; Dump it. |
| 338 | (with-temp-buffer | 338 | (with-temp-buffer |
| @@ -357,8 +357,8 @@ KEY identifies the connection, it is either a process or a vector." | |||
| 357 | (add-hook 'kill-emacs-hook 'tramp-dump-connection-properties)) | 357 | (add-hook 'kill-emacs-hook 'tramp-dump-connection-properties)) |
| 358 | (add-hook 'tramp-cache-unload-hook | 358 | (add-hook 'tramp-cache-unload-hook |
| 359 | (lambda () | 359 | (lambda () |
| 360 | (remove-hook 'kill-emacs-hook | 360 | (remove-hook 'kill-emacs-hook |
| 361 | 'tramp-dump-connection-properties))) | 361 | 'tramp-dump-connection-properties))) |
| 362 | 362 | ||
| 363 | ;;;###tramp-autoload | 363 | ;;;###tramp-autoload |
| 364 | (defun tramp-parse-connection-properties (method) | 364 | (defun tramp-parse-connection-properties (method) |
| @@ -368,18 +368,22 @@ for all methods. Resulting data are derived from connection history." | |||
| 368 | (let (res) | 368 | (let (res) |
| 369 | (maphash | 369 | (maphash |
| 370 | (lambda (key value) | 370 | (lambda (key value) |
| 371 | (if (and (vectorp key) | 371 | (if (and (vectorp key) |
| 372 | (string-equal method (tramp-file-name-method key)) | 372 | (string-equal method (tramp-file-name-method key)) |
| 373 | (not (tramp-file-name-localname key))) | 373 | (not (tramp-file-name-localname key))) |
| 374 | (push (list (tramp-file-name-user key) | 374 | (push (list (tramp-file-name-user key) |
| 375 | (tramp-file-name-host key)) | 375 | (tramp-file-name-host key)) |
| 376 | res))) | 376 | res))) |
| 377 | tramp-cache-data) | 377 | tramp-cache-data) |
| 378 | res)) | 378 | res)) |
| 379 | 379 | ||
| 380 | ;; Read persistent connection history. | 380 | ;; Read persistent connection history. |
| 381 | (when (and (stringp tramp-persistency-file-name) | 381 | (when (and (stringp tramp-persistency-file-name) |
| 382 | (zerop (hash-table-count tramp-cache-data))) | 382 | (zerop (hash-table-count tramp-cache-data)) |
| 383 | ;; When "emacs -Q" has been called, both variables are nil. | ||
| 384 | ;; We do not load the persistency file then, in order to | ||
| 385 | ;; have a clean test environment. | ||
| 386 | (or init-file-user site-run-file)) | ||
| 383 | (condition-case err | 387 | (condition-case err |
| 384 | (with-temp-buffer | 388 | (with-temp-buffer |
| 385 | (insert-file-contents tramp-persistency-file-name) | 389 | (insert-file-contents tramp-persistency-file-name) |