aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/net/ange-ftp.el43
2 files changed, 24 insertions, 24 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 1b61621708b..6e08029588a 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12011-06-09 Glenn Morris <rgm@gnu.org>
2
3 * net/ange-ftp.el (ange-ftp-switches-ok): New function.
4 (ange-ftp-get-files): Use it.
5
12011-06-09 Alexander Klimov <alserkli@inbox.ru> (tiny change) 62011-06-09 Alexander Klimov <alserkli@inbox.ru> (tiny change)
2 7
3 * mail/sendmail.el (mail-recover-1, mail-recover): 8 * mail/sendmail.el (mail-recover-1, mail-recover):
diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el
index b1d8279e93f..0493ead7bbf 100644
--- a/lisp/net/ange-ftp.el
+++ b/lisp/net/ange-ftp.el
@@ -2806,6 +2806,19 @@ match subdirectories as well.")
2806 (and files (puthash (file-name-as-directory directory) 2806 (and files (puthash (file-name-as-directory directory)
2807 files ange-ftp-files-hashtable))) 2807 files ange-ftp-files-hashtable)))
2808 2808
2809(defun ange-ftp-switches-ok (switches)
2810 "Return SWITCHES (a string) if suitable for our use."
2811 (and (stringp switches)
2812 ;; We allow the A switch, which lists all files except "." and
2813 ;; "..". This is OK because we manually insert these entries
2814 ;; in the hash table.
2815 (string-match
2816 "--\\(almost-\\)?all\\>\\|\\(\\`\\| \\)-[[:alpha:]]*[aA]" switches)
2817 (string-match "\\(\\`\\| \\)-[[:alpha:]]*l" switches)
2818 (not (string-match
2819 "--recursive\\>\\|\\(\\`\\| \\)-[[:alpha:]]*R" switches))
2820 switches))
2821
2809(defun ange-ftp-get-files (directory &optional no-error) 2822(defun ange-ftp-get-files (directory &optional no-error)
2810 "Given a DIRECTORY, return a hashtable of file entries. 2823 "Given a DIRECTORY, return a hashtable of file entries.
2811This will give an error or return nil, depending on the value of 2824This will give an error or return nil, depending on the value of
@@ -2817,30 +2830,12 @@ NO-ERROR, if a listing for DIRECTORY cannot be obtained."
2817 ;; This is an efficiency hack. We try to 2830 ;; This is an efficiency hack. We try to
2818 ;; anticipate what sort of listing dired 2831 ;; anticipate what sort of listing dired
2819 ;; might want, and cache just such a listing. 2832 ;; might want, and cache just such a listing.
2820 (if (and (boundp 'dired-actual-switches) 2833 (or (and (boundp 'dired-actual-switches)
2821 (stringp dired-actual-switches) 2834 (ange-ftp-switches-ok dired-actual-switches))
2822 ;; We allow the A switch, which lists 2835 (and (boundp 'dired-listing-switches)
2823 ;; all files except "." and "..". 2836 (ange-ftp-switches-ok
2824 ;; This is OK because we manually 2837 dired-listing-switches))
2825 ;; insert these entries 2838 "-al")
2826 ;; in the hash table.
2827 (string-match
2828 "[aA]" dired-actual-switches)
2829 (string-match
2830 "l" dired-actual-switches)
2831 (not (string-match
2832 "R" dired-actual-switches)))
2833 dired-actual-switches
2834 (if (and (boundp 'dired-listing-switches)
2835 (stringp dired-listing-switches)
2836 (string-match
2837 "[aA]" dired-listing-switches)
2838 (string-match
2839 "l" dired-listing-switches)
2840 (not (string-match
2841 "R" dired-listing-switches)))
2842 dired-listing-switches
2843 "-al"))
2844 t no-error) 2839 t no-error)
2845 (gethash directory ange-ftp-files-hashtable))))) 2840 (gethash directory ange-ftp-files-hashtable)))))
2846 2841