diff options
author | Michael Albinus <michael.albinus@gmx.de> | 2019-10-31 11:13:13 +0100 |
---|---|---|
committer | Michael Albinus <michael.albinus@gmx.de> | 2019-10-31 11:13:13 +0100 |
commit | bdb33af39d32cfb0bb23f18eb34775a30e2ff62d (patch) | |
tree | eed9633f5519abb8c10d85d4583fb25260df64af /lisp/net/tramp-smb.el | |
parent | e168bb73865f64cc67f80f8b2599c826cbf9e957 (diff) | |
download | emacs-bdb33af39d32cfb0bb23f18eb34775a30e2ff62d.tar.gz emacs-bdb33af39d32cfb0bb23f18eb34775a30e2ff62d.tar.bz2 emacs-bdb33af39d32cfb0bb23f18eb34775a30e2ff62d.zip |
Fix some minor Tramp problems
* lisp/net/tramp-gvfs.el (tramp-gvfs-maybe-open-connection):
Check, that `tramp-password-save-function' is a function.
* lisp/net/tramp-smb.el (tramp-smb-handle-file-system-info):
Check, that there is a share.
* lisp/net/tramp.el (outline-regexp): Declare.
(tramp-get-debug-buffer): Let-bind `signal-hook-function'.
* test/lisp/net/tramp-tests.el (tramp-test04-substitute-in-file-name):
Skip some tests for Emacs 24 and 25; they let Emacs crash.
Diffstat (limited to 'lisp/net/tramp-smb.el')
-rw-r--r-- | lisp/net/tramp-smb.el | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index 27c321bb9cb..5e52b26e7c6 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -946,29 +946,31 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." (unless (file-directory-p filename) (setq filename (file-name-directory filename))) (with-parsed-tramp-file-name (expand-file-name filename) nil - (tramp-message v 5 "file system info: %s" localname) - (tramp-smb-send-command v (format "du %s/*" (tramp-smb-get-localname v))) - (with-current-buffer (tramp-get-connection-buffer v) - (let (total avail blocksize) - (goto-char (point-min)) - (forward-line) - (when (looking-at - (eval-when-compile - (concat "[[:space:]]*\\([[:digit:]]+\\)" - " blocks of size \\([[:digit:]]+\\)" - "\\. \\([[:digit:]]+\\) blocks available"))) - (setq blocksize (string-to-number (match-string 2)) - total (* blocksize (string-to-number (match-string 1))) - avail (* blocksize (string-to-number (match-string 3))))) - (forward-line) - (when (looking-at "Total number of bytes: \\([[:digit:]]+\\)") - ;; The used number of bytes is not part of the result. As - ;; side effect, we store it as file property. - (tramp-set-file-property - v localname "used-bytes" (string-to-number (match-string 1)))) - ;; Result. - (when (and total avail) - (list total (- total avail) avail))))))) + (when (tramp-smb-get-share v) + (tramp-message v 5 "file system info: %s" localname) + (tramp-smb-send-command + v (format "du %s/*" (tramp-smb-get-localname v))) + (with-current-buffer (tramp-get-connection-buffer v) + (let (total avail blocksize) + (goto-char (point-min)) + (forward-line) + (when (looking-at + (eval-when-compile + (concat "[[:space:]]*\\([[:digit:]]+\\)" + " blocks of size \\([[:digit:]]+\\)" + "\\. \\([[:digit:]]+\\) blocks available"))) + (setq blocksize (string-to-number (match-string 2)) + total (* blocksize (string-to-number (match-string 1))) + avail (* blocksize (string-to-number (match-string 3))))) + (forward-line) + (when (looking-at "Total number of bytes: \\([[:digit:]]+\\)") + ;; The used number of bytes is not part of the result. + ;; As side effect, we store it as file property. + (tramp-set-file-property + v localname "used-bytes" (string-to-number (match-string 1)))) + ;; Result. + (when (and total avail) + (list total (- total avail) avail)))))))) (defun tramp-smb-handle-file-writable-p (filename) "Like `file-writable-p' for Tramp files." |