diff options
| author | Michael Albinus | 2014-02-20 15:24:13 +0100 |
|---|---|---|
| committer | Michael Albinus | 2014-02-20 15:24:13 +0100 |
| commit | f5bee33b8250199f3bae3560283cc15c55dd9b22 (patch) | |
| tree | aa6ca31b66d3d8bf0183d5178a3b4ae78c767192 | |
| parent | d9386b0ca0ca420ab9f7ea1c41096707373ccd70 (diff) | |
| download | emacs-f5bee33b8250199f3bae3560283cc15c55dd9b22.tar.gz emacs-f5bee33b8250199f3bae3560283cc15c55dd9b22.zip | |
* net/tramp.el (ls-lisp-use-insert-directory-program): Declare.
(tramp-handle-insert-directory): New defun, taken from tramp-gvfs.el.
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist)
[insert-directory]: Use `tramp-handle-insert-directory.
(tramp-gvfs-handle-insert-directory): Remove function.
* net/tramp-sh.el (tramp-sh-handle-insert-directory):
Call `tramp-handle-insert-directory'.
| -rw-r--r-- | lisp/ChangeLog | 12 | ||||
| -rw-r--r-- | lisp/net/tramp-gvfs.el | 16 | ||||
| -rw-r--r-- | lisp/net/tramp-sh.el | 4 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 36 |
4 files changed, 49 insertions, 19 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a3d78dcddad..e0b8e20496d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,15 @@ | |||
| 1 | 2014-02-20 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * net/tramp.el (ls-lisp-use-insert-directory-program): Declare. | ||
| 4 | (tramp-handle-insert-directory): New defun, taken from tramp-gvfs.el. | ||
| 5 | |||
| 6 | * net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist) | ||
| 7 | [insert-directory]: Use `tramp-handle-insert-directory. | ||
| 8 | (tramp-gvfs-handle-insert-directory): Remove function. | ||
| 9 | |||
| 10 | * net/tramp-sh.el (tramp-sh-handle-insert-directory): | ||
| 11 | Call `tramp-handle-insert-directory'. | ||
| 12 | |||
| 1 | 2014-02-20 Juanma Barranquero <lekktu@gmail.com> | 13 | 2014-02-20 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 14 | ||
| 3 | * elec-pair.el (electric-pair-syntax-info): Do not check syntax | 15 | * elec-pair.el (electric-pair-syntax-info): Do not check syntax |
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 38b53afea45..320e00c681d 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el | |||
| @@ -108,7 +108,6 @@ | |||
| 108 | (eval-when-compile | 108 | (eval-when-compile |
| 109 | (require 'cl) | 109 | (require 'cl) |
| 110 | (require 'custom)) | 110 | (require 'custom)) |
| 111 | (defvar ls-lisp-use-insert-directory-program) | ||
| 112 | 111 | ||
| 113 | ;;;###tramp-autoload | 112 | ;;;###tramp-autoload |
| 114 | (defcustom tramp-gvfs-methods '("dav" "davs" "obex" "synce") | 113 | (defcustom tramp-gvfs-methods '("dav" "davs" "obex" "synce") |
| @@ -451,7 +450,7 @@ Every entry is a list (NAME ADDRESS).") | |||
| 451 | (find-backup-file-name . tramp-handle-find-backup-file-name) | 450 | (find-backup-file-name . tramp-handle-find-backup-file-name) |
| 452 | ;; `find-file-noselect' performed by default handler. | 451 | ;; `find-file-noselect' performed by default handler. |
| 453 | ;; `get-file-buffer' performed by default handler. | 452 | ;; `get-file-buffer' performed by default handler. |
| 454 | (insert-directory . tramp-gvfs-handle-insert-directory) | 453 | (insert-directory . tramp-handle-insert-directory) |
| 455 | (insert-file-contents . tramp-handle-insert-file-contents) | 454 | (insert-file-contents . tramp-handle-insert-file-contents) |
| 456 | (load . tramp-handle-load) | 455 | (load . tramp-handle-load) |
| 457 | (make-auto-save-file-name . tramp-handle-make-auto-save-file-name) | 456 | (make-auto-save-file-name . tramp-handle-make-auto-save-file-name) |
| @@ -1006,19 +1005,6 @@ is no information where to trace the message.") | |||
| 1006 | (and (file-directory-p (file-name-directory filename)) | 1005 | (and (file-directory-p (file-name-directory filename)) |
| 1007 | (file-writable-p (file-name-directory filename))))))) | 1006 | (file-writable-p (file-name-directory filename))))))) |
| 1008 | 1007 | ||
| 1009 | (defun tramp-gvfs-handle-insert-directory | ||
| 1010 | (filename switches &optional wildcard full-directory-p) | ||
| 1011 | "Like `insert-directory' for Tramp files." | ||
| 1012 | ;; gvfs-* output is hard to parse. So we let `ls-lisp' do the job. | ||
| 1013 | (unless switches (setq switches "")) | ||
| 1014 | (with-parsed-tramp-file-name (expand-file-name filename) nil | ||
| 1015 | (with-tramp-progress-reporter v 0 (format "Opening directory %s" filename) | ||
| 1016 | (require 'ls-lisp) | ||
| 1017 | (let (ls-lisp-use-insert-directory-program) | ||
| 1018 | (tramp-run-real-handler | ||
| 1019 | 'insert-directory | ||
| 1020 | (list filename switches wildcard full-directory-p)))))) | ||
| 1021 | |||
| 1022 | (defun tramp-gvfs-handle-make-directory (dir &optional parents) | 1008 | (defun tramp-gvfs-handle-make-directory (dir &optional parents) |
| 1023 | "Like `make-directory' for Tramp files." | 1009 | "Like `make-directory' for Tramp files." |
| 1024 | (with-parsed-tramp-file-name dir nil | 1010 | (with-parsed-tramp-file-name dir nil |
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 4284fecf14f..01abfe0e71f 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -2516,8 +2516,8 @@ This is like `dired-recursive-delete-directory' for Tramp files." | |||
| 2516 | (with-parsed-tramp-file-name filename nil | 2516 | (with-parsed-tramp-file-name filename nil |
| 2517 | (if (and (featurep 'ls-lisp) | 2517 | (if (and (featurep 'ls-lisp) |
| 2518 | (not (symbol-value 'ls-lisp-use-insert-directory-program))) | 2518 | (not (symbol-value 'ls-lisp-use-insert-directory-program))) |
| 2519 | (tramp-run-real-handler | 2519 | (tramp-handle-insert-directory |
| 2520 | 'insert-directory (list filename switches wildcard full-directory-p)) | 2520 | filename switches wildcard full-directory-p) |
| 2521 | (when (stringp switches) | 2521 | (when (stringp switches) |
| 2522 | (setq switches (split-string switches))) | 2522 | (setq switches (split-string switches))) |
| 2523 | (when (and (member "--dired" switches) | 2523 | (when (and (member "--dired" switches) |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index aa9881be997..9b3cc9f73a5 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -49,9 +49,8 @@ | |||
| 49 | ;; http://lists.gnu.org/mailman/listinfo/tramp-devel | 49 | ;; http://lists.gnu.org/mailman/listinfo/tramp-devel |
| 50 | ;; | 50 | ;; |
| 51 | ;; For the adventurous, the current development sources are available | 51 | ;; For the adventurous, the current development sources are available |
| 52 | ;; via CVS. You can find instructions about this at the following URL: | 52 | ;; via Git. You can find instructions about this at the following URL: |
| 53 | ;; http://savannah.gnu.org/projects/tramp/ | 53 | ;; http://savannah.gnu.org/projects/tramp/ |
| 54 | ;; Click on "CVS" in the navigation bar near the top. | ||
| 55 | ;; | 54 | ;; |
| 56 | ;; Don't forget to put on your asbestos longjohns, first! | 55 | ;; Don't forget to put on your asbestos longjohns, first! |
| 57 | 56 | ||
| @@ -66,6 +65,7 @@ | |||
| 66 | (defvar directory-sep-char) | 65 | (defvar directory-sep-char) |
| 67 | (defvar eshell-path-env) | 66 | (defvar eshell-path-env) |
| 68 | (defvar file-notify-descriptors) | 67 | (defvar file-notify-descriptors) |
| 68 | (defvar ls-lisp-use-insert-directory-program) | ||
| 69 | (defvar outline-regexp) | 69 | (defvar outline-regexp) |
| 70 | 70 | ||
| 71 | ;;; User Customizable Internal Variables: | 71 | ;;; User Customizable Internal Variables: |
| @@ -3007,6 +3007,38 @@ User is always nil." | |||
| 3007 | 3007 | ||
| 3008 | (tramp-run-real-handler 'find-backup-file-name (list filename))))) | 3008 | (tramp-run-real-handler 'find-backup-file-name (list filename))))) |
| 3009 | 3009 | ||
| 3010 | (defun tramp-handle-insert-directory | ||
| 3011 | (filename switches &optional wildcard full-directory-p) | ||
| 3012 | "Like `insert-directory' for Tramp files." | ||
| 3013 | (unless switches (setq switches "")) | ||
| 3014 | ;; Mark trailing "/". | ||
| 3015 | (when (and (zerop (length (file-name-nondirectory filename))) | ||
| 3016 | (not full-directory-p)) | ||
| 3017 | (setq switches (concat switches "F"))) | ||
| 3018 | (with-parsed-tramp-file-name (expand-file-name filename) nil | ||
| 3019 | (with-tramp-progress-reporter v 0 (format "Opening directory %s" filename) | ||
| 3020 | (require 'ls-lisp) | ||
| 3021 | (let (ls-lisp-use-insert-directory-program start) | ||
| 3022 | (tramp-run-real-handler | ||
| 3023 | 'insert-directory | ||
| 3024 | (list filename switches wildcard full-directory-p)) | ||
| 3025 | ;; `ls-lisp' always returns full listings. We must remove | ||
| 3026 | ;; superfluous parts. | ||
| 3027 | (unless (string-match "l" switches) | ||
| 3028 | (save-excursion | ||
| 3029 | (goto-char (point-min)) | ||
| 3030 | (while (setq start | ||
| 3031 | (text-property-not-all | ||
| 3032 | (point) (point-at-eol) 'dired-filename t)) | ||
| 3033 | (delete-region | ||
| 3034 | start | ||
| 3035 | (or (text-property-any start (point-at-eol) 'dired-filename t) | ||
| 3036 | (point-at-eol))) | ||
| 3037 | (if (= (point-at-bol) (point-at-eol)) | ||
| 3038 | ;; Empty line. | ||
| 3039 | (delete-region (point) (progn (forward-line) (point))) | ||
| 3040 | (forward-line))))))))) | ||
| 3041 | |||
| 3010 | (defun tramp-handle-insert-file-contents | 3042 | (defun tramp-handle-insert-file-contents |
| 3011 | (filename &optional visit beg end replace) | 3043 | (filename &optional visit beg end replace) |
| 3012 | "Like `insert-file-contents' for Tramp files." | 3044 | "Like `insert-file-contents' for Tramp files." |