aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeoff Voelker1998-10-14 03:43:20 +0000
committerGeoff Voelker1998-10-14 03:43:20 +0000
commit0cb0ba6c86cbffb5cd2f5df7f96a7ad848fd351c (patch)
treeb849beb05bf0c7b2794b40d2523b3fceb43715a2
parente323ab22c38944d1c3d0b6e5e2eddf2bd29b580d (diff)
downloademacs-0cb0ba6c86cbffb5cd2f5df7f96a7ad848fd351c.tar.gz
emacs-0cb0ba6c86cbffb5cd2f5df7f96a7ad848fd351c.zip
(ls-lisp-use-insert-directory-program): New variable.
(ls-lisp-insert-directory): Renamed from insert-directory. (insert-directory): New function.
-rw-r--r--lisp/ls-lisp.el29
1 files changed, 27 insertions, 2 deletions
diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el
index 0a921bbb05c..5a3c1b52ff7 100644
--- a/lisp/ls-lisp.el
+++ b/lisp/ls-lisp.el
@@ -66,14 +66,39 @@ package is used.")
66(defvar ls-lisp-dired-ignore-case nil 66(defvar ls-lisp-dired-ignore-case nil
67 "Non-nil causes dired buffers to sort alphabetically regardless of case.") 67 "Non-nil causes dired buffers to sort alphabetically regardless of case.")
68 68
69(defun insert-directory (file &optional switches wildcard full-directory-p) 69(defvar ls-lisp-use-insert-directory-program nil
70 "Non-nil causes ls-lisp to revert back to using `insert-directory-program'.
71This is useful on platforms where ls-lisp is dumped into Emacs, such as
72Microsoft Windows, but you would still like to use a program to list
73the contents of a directory.")
74
75;; Remember the original insert-directory function.
76(fset 'original-insert-directory (symbol-function 'insert-directory))
77
78(defun insert-directory (file switches &optional wildcard full-directory-p)
79 "Insert directory listing for FILE, formatted according to SWITCHES.
80Leaves point after the inserted text.
81SWITCHES may be a string of options, or a list of strings.
82Optional third arg WILDCARD means treat FILE as shell wildcard.
83Optional fourth arg FULL-DIRECTORY-P means file is a directory and
84switches do not contain `d', so that a full listing is expected.
85
86This version of the function comes from `ls-lisp.el'. Depending upon
87the value of `ls-lisp-use-insert-directory-program', it will use an
88external program if non-nil or the lisp function `ls-lisp-insert-directory'
89otherwise."
90 (if ls-lisp-use-insert-directory-program
91 (original-insert-directory file switches wildcard full-directory-p)
92 (ls-lisp-insert-directory file switches wildcard full-directory-p)))
93
94(defun ls-lisp-insert-directory (file switches &optional wildcard full-directory-p)
70 "Insert directory listing for FILE, formatted according to SWITCHES. 95 "Insert directory listing for FILE, formatted according to SWITCHES.
71Leaves point after the inserted text. 96Leaves point after the inserted text.
72Optional third arg WILDCARD means treat FILE as shell wildcard. 97Optional third arg WILDCARD means treat FILE as shell wildcard.
73Optional fourth arg FULL-DIRECTORY-P means file is a directory and 98Optional fourth arg FULL-DIRECTORY-P means file is a directory and
74switches do not contain `d', so that a full listing is expected. 99switches do not contain `d', so that a full listing is expected.
75 100
76This version of the function comes from `ls-lisp.el'. It doesn not 101This version of the function comes from `ls-lisp.el'. It does not
77run any external programs or shells. It supports ordinary shell 102run any external programs or shells. It supports ordinary shell
78wildcards if `ls-lisp-support-shell-wildcards' variable is non-nil; 103wildcards if `ls-lisp-support-shell-wildcards' variable is non-nil;
79otherwise, it interprets wildcards as regular expressions to match 104otherwise, it interprets wildcards as regular expressions to match