2332 |
;; (substring directory 0 (- (length directory) 1)) |
;; (substring directory 0 (- (length directory) 1)) |
2333 |
;; directory)) |
;; directory)) |
2334 |
|
|
2335 |
;; Philippe Troin <phil@fifi.org> |
;; ;; Philippe Troin <phil@fifi.org> |
2336 |
|
;; (defun tramp-handle-directory-file-name (directory) |
2337 |
|
;; "Like `directory-file-name' for tramp files." |
2338 |
|
;; (with-parsed-tramp-file-name directory nil |
2339 |
|
;; (let ((directory-length-1 (1- (length directory)))) |
2340 |
|
;; (save-match-data |
2341 |
|
;; (if (and (eq (aref directory directory-length-1) ?/) |
2342 |
|
;; (eq (string-match tramp-file-name-regexp directory) 0) |
2343 |
|
;; (/= (match-end 0) directory-length-1)) |
2344 |
|
;; (substring directory 0 directory-length-1) |
2345 |
|
;; directory))))) |
2346 |
|
|
2347 |
(defun tramp-handle-directory-file-name (directory) |
(defun tramp-handle-directory-file-name (directory) |
2348 |
"Like `directory-file-name' for tramp files." |
"Like `directory-file-name' for tramp files." |
2349 |
|
;; If path component of filename is "/", leave it unchanged. |
2350 |
|
;; Otherwise, remove any trailing slash from path component. |
2351 |
|
;; Method, host, etc, are unchanged. Does it make sense to try |
2352 |
|
;; to avoid parsing the filename? |
2353 |
(with-parsed-tramp-file-name directory nil |
(with-parsed-tramp-file-name directory nil |
2354 |
(let ((directory-length-1 (1- (length directory)))) |
(if (and (eq (aref path (1- (length path))) ?/) |
2355 |
(save-match-data |
(not (string= path "/"))) |
2356 |
(if (and (eq (aref directory directory-length-1) ?/) |
(substring directory 0 -1) |
2357 |
(eq (string-match tramp-file-name-regexp directory) 0) |
directory))) |
|
(/= (match-end 0) directory-length-1)) |
|
|
(substring directory 0 directory-length-1) |
|
|
directory))))) |
|
2358 |
|
|
2359 |
;; Directory listings. |
;; Directory listings. |
2360 |
|
|
5596 |
(pop-to-buffer (current-buffer)) |
(pop-to-buffer (current-buffer)) |
5597 |
(funcall 'signal signal (apply 'format fmt args)))) |
(funcall 'signal signal (apply 'format fmt args)))) |
5598 |
|
|
5599 |
;; Chunked sending kluge. |
;; Chunked sending kluge. We set this to 500 just to be on the |
5600 |
(defvar tramp-chunksize nil |
;; safe side; some ssh connections appear to drop bytes when data |
5601 |
|
;; is sent too quickly. |
5602 |
|
;; This happens when using `ssh' method using GNU Emacs 20.7.1 |
5603 |
|
;; (hppa1.1-hp-hpux10.20, Motif). (The connection is made to |
5604 |
|
;; localhost.) |
5605 |
|
(defvar tramp-chunksize 500 |
5606 |
"If non-nil, chunksize for sending things to remote host.") |
"If non-nil, chunksize for sending things to remote host.") |
5607 |
|
|
5608 |
(defun tramp-send-region (multi-method method user host start end) |
(defun tramp-send-region (multi-method method user host start end) |