changeset 47575:4d9f899a5963

* dired.el (dired-insert-directory): Always add "--dired" to to SWITCHES for remote files. * files.el (insert-directory): Comment saying that "--dired" might be in the SWITCHES. * net/ange-ftp.el (ange-ftp-ls): Handle "--dired" in LSARGS. (ange-ftp-insert-directory): Comment explaining "--dired" handling.
author Kai Großjohann <kgrossjo@eu.uu.net>
date Sun, 22 Sep 2002 13:01:10 +0000
parents 87934bad758d
children b31c8ab7336a
files lisp/ChangeLog lisp/dired.el lisp/files.el lisp/net/ange-ftp.el
diffstat 4 files changed, 19 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sat Sep 21 20:11:08 2002 +0000
+++ b/lisp/ChangeLog	Sun Sep 22 13:01:10 2002 +0000
@@ -1,3 +1,13 @@
+2002-09-22  Kai Gro,b_(Bjohann  <grossjoh@ls6.informatik.uni-dortmund.de>
+
+	* dired.el (dired-insert-directory): Always add "--dired" to to
+	SWITCHES for remote files.
+	* files.el (insert-directory): Comment saying that "--dired"
+	might be in the SWITCHES.
+	* net/ange-ftp.el (ange-ftp-ls): Handle "--dired" in LSARGS.
+	(ange-ftp-insert-directory): Comment explaining "--dired"
+	handling.
+
 2002-09-21  Markus Rost  <rost@math.ohio-state.edu>
 
 	* mail/mailabbrev.el (mail-abbrev-make-syntax-table):  Give %!._-
--- a/lisp/dired.el	Sat Sep 21 20:11:08 2002 +0000
+++ b/lisp/dired.el	Sun Sep 22 13:01:10 2002 +0000
@@ -677,8 +677,7 @@
   (let ((opoint (point))
 	(process-environment (copy-sequence process-environment))
 	end)
-    (if (and dired-use-ls-dired
-	     (not (file-remote-p dir)))
+    (if (or dired-use-ls-dired (file-remote-p dir))
 	(setq switches (concat "--dired " switches)))
     ;; We used to specify the C locale here, to force English month names;
     ;; but this should not be necessary any more,
--- a/lisp/files.el	Sat Sep 21 20:11:08 2002 +0000
+++ b/lisp/files.el	Sun Sep 22 13:01:10 2002 +0000
@@ -3969,6 +3969,9 @@
 ;;   		 dired-insert-headerline
 ;;   		 dired-after-subdir-garbage (defines what a "total" line is)
 ;;   - variable dired-subdir-regexp
+;; - may be passed "--dired" as the first argument in SWITCHES.
+;;   Filename handlers might have to remove this switch if their
+;;   "ls" command does not support it.
 (defun insert-directory (file switches &optional wildcard full-directory-p)
   "Insert directory listing for FILE, formatted according to SWITCHES.
 Leaves point after the inserted text.
--- a/lisp/net/ange-ftp.el	Sat Sep 21 20:11:08 2002 +0000
+++ b/lisp/net/ange-ftp.el	Sun Sep 22 13:01:10 2002 +0000
@@ -2527,6 +2527,8 @@
 FILE is the full name of the remote file, LSARGS is any args to pass to the
 `ls' command, and PARSE specifies that the output should be parsed and stored
 away in the internal cache."
+  (when (string-match "^--dired\\s-+" lsargs)
+    (setq lsargs (replace-match "" nil t lsargs)))
   ;; If parse is t, we assume that file is a directory. i.e. we only parse
   ;; full directory listings.
   (let* ((ange-ftp-this-file (ange-ftp-expand-file-name file))
@@ -4417,6 +4419,9 @@
 ;; I have preserved (and modernized) those hooks.
 ;; So the format conversion should be all that is needed.
 
+;; When called from dired, SWITCHES may start with "--dired".
+;; `ange-ftp-ls' handles this.
+
 (defun ange-ftp-insert-directory (file switches &optional wildcard full)
   (let ((short (ange-ftp-abbreviate-filename file))
 	(parsed (ange-ftp-ftp-name (expand-file-name file)))