diff options
| author | Michael Albinus | 2009-08-02 17:16:39 +0000 |
|---|---|---|
| committer | Michael Albinus | 2009-08-02 17:16:39 +0000 |
| commit | 736ac90f598e706aab1c84c52e707d6cafd167b0 (patch) | |
| tree | 3c3bd0acc2f1e223e717bbfc1a65992cafe4c7b6 | |
| parent | afae3a37773b0dfee20d04aa3bb686677b6bf757 (diff) | |
| download | emacs-736ac90f598e706aab1c84c52e707d6cafd167b0.tar.gz emacs-736ac90f598e706aab1c84c52e707d6cafd167b0.zip | |
* net/tramp.el (tramp-debug-message): Print also microseconds.
(tramp-handle-insert-file-contents): Optimize, when BEG
or END is non-nil.
(tramp-handle-vc-registered): Use `tramp-cache-inhibit-cache'.
(tramp-get-debug-buffer): Change `outline-regexp' according to new
format.
| -rw-r--r-- | lisp/net/tramp.el | 45 |
1 files changed, 37 insertions, 8 deletions
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 76cd679d774..e8ce36e4c07 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -1903,7 +1903,9 @@ ARGS to actually emit the message (if applicable)." | |||
| 1903 | (unless (bolp) | 1903 | (unless (bolp) |
| 1904 | (insert "\n")) | 1904 | (insert "\n")) |
| 1905 | ;; Timestamp. | 1905 | ;; Timestamp. |
| 1906 | (insert (format-time-string "%T ")) | 1906 | (let ((now (current-time))) |
| 1907 | (insert (format-time-string "%T." now)) | ||
| 1908 | (insert (format "%06d " (nth 2 now)))) | ||
| 1907 | ;; Calling function. | 1909 | ;; Calling function. |
| 1908 | (let ((btn 1) btf fn) | 1910 | (let ((btn 1) btf fn) |
| 1909 | (while (not fn) | 1911 | (while (not fn) |
| @@ -4204,7 +4206,7 @@ coding system might not be determined. This function repairs it." | |||
| 4204 | "Like `insert-file-contents' for Tramp files." | 4206 | "Like `insert-file-contents' for Tramp files." |
| 4205 | (barf-if-buffer-read-only) | 4207 | (barf-if-buffer-read-only) |
| 4206 | (setq filename (expand-file-name filename)) | 4208 | (setq filename (expand-file-name filename)) |
| 4207 | (let (coding-system-used result local-copy) | 4209 | (let (coding-system-used result local-copy remote-copy) |
| 4208 | (unwind-protect | 4210 | (unwind-protect |
| 4209 | (with-parsed-tramp-file-name filename nil | 4211 | (with-parsed-tramp-file-name filename nil |
| 4210 | 4212 | ||
| @@ -4224,6 +4226,26 @@ coding system might not be determined. This function repairs it." | |||
| 4224 | 'insert-file-contents | 4226 | 'insert-file-contents |
| 4225 | (list localname visit beg end replace))) | 4227 | (list localname visit beg end replace))) |
| 4226 | 4228 | ||
| 4229 | ;; When we shall insert only a part of the file, we copy | ||
| 4230 | ;; this part. | ||
| 4231 | (when (or beg end) | ||
| 4232 | (setq remote-copy (tramp-make-tramp-temp-file v)) | ||
| 4233 | (tramp-send-command | ||
| 4234 | v | ||
| 4235 | (cond | ||
| 4236 | ((and beg end) | ||
| 4237 | (format "tail -c +%d %s | head -c +%d >%s" | ||
| 4238 | (1+ beg) (tramp-shell-quote-argument localname) | ||
| 4239 | (- end beg) remote-copy)) | ||
| 4240 | (beg | ||
| 4241 | (format "tail -c +%d %s >%s" | ||
| 4242 | (1+ beg) (tramp-shell-quote-argument localname) | ||
| 4243 | remote-copy)) | ||
| 4244 | (end | ||
| 4245 | (format "head -c +%d %s >%s" | ||
| 4246 | (1+ end) (tramp-shell-quote-argument localname) | ||
| 4247 | remote-copy))))) | ||
| 4248 | |||
| 4227 | ;; `insert-file-contents-literally' takes care to avoid | 4249 | ;; `insert-file-contents-literally' takes care to avoid |
| 4228 | ;; calling jka-compr. By let-binding | 4250 | ;; calling jka-compr. By let-binding |
| 4229 | ;; `inhibit-file-name-operation', we propagate that care | 4251 | ;; `inhibit-file-name-operation', we propagate that care |
| @@ -4233,7 +4255,11 @@ coding system might not be determined. This function repairs it." | |||
| 4233 | (when (eq inhibit-file-name-operation | 4255 | (when (eq inhibit-file-name-operation |
| 4234 | 'insert-file-contents) | 4256 | 'insert-file-contents) |
| 4235 | 'file-local-copy))) | 4257 | 'file-local-copy))) |
| 4236 | (file-local-copy filename))) | 4258 | (file-local-copy |
| 4259 | (if (stringp remote-copy) | ||
| 4260 | (tramp-make-tramp-file-name | ||
| 4261 | method user host remote-copy) | ||
| 4262 | filename)))) | ||
| 4237 | (tramp-message | 4263 | (tramp-message |
| 4238 | v 4 "Inserting local temp file `%s'..." local-copy) | 4264 | v 4 "Inserting local temp file `%s'..." local-copy) |
| 4239 | 4265 | ||
| @@ -4244,7 +4270,7 @@ coding system might not be determined. This function repairs it." | |||
| 4244 | filename local-copy))) | 4270 | filename local-copy))) |
| 4245 | (setq result | 4271 | (setq result |
| 4246 | (insert-file-contents | 4272 | (insert-file-contents |
| 4247 | local-copy nil beg end replace)) | 4273 | local-copy nil nil nil replace)) |
| 4248 | ;; Now `last-coding-system-used' has right value. | 4274 | ;; Now `last-coding-system-used' has right value. |
| 4249 | ;; Remember it. | 4275 | ;; Remember it. |
| 4250 | (when (boundp 'last-coding-system-used) | 4276 | (when (boundp 'last-coding-system-used) |
| @@ -4264,7 +4290,10 @@ coding system might not be determined. This function repairs it." | |||
| 4264 | (set-visited-file-modtime) | 4290 | (set-visited-file-modtime) |
| 4265 | (set-buffer-modified-p nil)) | 4291 | (set-buffer-modified-p nil)) |
| 4266 | (when (stringp local-copy) | 4292 | (when (stringp local-copy) |
| 4267 | (delete-file local-copy)))) | 4293 | (delete-file local-copy)) |
| 4294 | (when (stringp remote-copy) | ||
| 4295 | (delete-file | ||
| 4296 | (tramp-make-tramp-file-name method user host remote-copy))))) | ||
| 4268 | 4297 | ||
| 4269 | ;; Result. | 4298 | ;; Result. |
| 4270 | (list (expand-file-name filename) | 4299 | (list (expand-file-name filename) |
| @@ -4605,8 +4634,8 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file." | |||
| 4605 | (defun tramp-handle-vc-registered (file) | 4634 | (defun tramp-handle-vc-registered (file) |
| 4606 | "Like `vc-registered' for Tramp files." | 4635 | "Like `vc-registered' for Tramp files." |
| 4607 | ;; There could be new files, created by the vc backend. We disable | 4636 | ;; There could be new files, created by the vc backend. We disable |
| 4608 | ;; the cache therefore, by providing a temporary one. | 4637 | ;; the file cache therefore. |
| 4609 | (let ((tramp-cache-data (make-hash-table :test 'equal))) | 4638 | (let ((tramp-cache-inhibit-cache t)) |
| 4610 | (tramp-run-real-handler 'vc-registered (list file)))) | 4639 | (tramp-run-real-handler 'vc-registered (list file)))) |
| 4611 | 4640 | ||
| 4612 | ;;;###autoload | 4641 | ;;;###autoload |
| @@ -5601,7 +5630,7 @@ from the default one." | |||
| 5601 | (let ((default-directory (tramp-compat-temporary-file-directory))) | 5630 | (let ((default-directory (tramp-compat-temporary-file-directory))) |
| 5602 | (outline-mode)) | 5631 | (outline-mode)) |
| 5603 | (set (make-local-variable 'outline-regexp) | 5632 | (set (make-local-variable 'outline-regexp) |
| 5604 | "[0-9]+:[0-9]+:[0-9]+ [a-z0-9-]+ (\\([0-9]+\\)) #") | 5633 | "[0-9]+:[0-9]+:[0-9]+\\.[0-9]+ [a-z0-9-]+ (\\([0-9]+\\)) #") |
| 5605 | ; (set (make-local-variable 'outline-regexp) | 5634 | ; (set (make-local-variable 'outline-regexp) |
| 5606 | ; "[a-z.-]+:[0-9]+: [a-z0-9-]+ (\\([0-9]+\\)) #") | 5635 | ; "[a-z.-]+:[0-9]+: [a-z0-9-]+ (\\([0-9]+\\)) #") |
| 5607 | (set (make-local-variable 'outline-level) 'tramp-outline-level)) | 5636 | (set (make-local-variable 'outline-level) 'tramp-outline-level)) |