diff options
| author | Geoff Voelker | 1998-10-14 03:43:20 +0000 |
|---|---|---|
| committer | Geoff Voelker | 1998-10-14 03:43:20 +0000 |
| commit | 0cb0ba6c86cbffb5cd2f5df7f96a7ad848fd351c (patch) | |
| tree | b849beb05bf0c7b2794b40d2523b3fceb43715a2 | |
| parent | e323ab22c38944d1c3d0b6e5e2eddf2bd29b580d (diff) | |
| download | emacs-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.el | 29 |
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'. | ||
| 71 | This is useful on platforms where ls-lisp is dumped into Emacs, such as | ||
| 72 | Microsoft Windows, but you would still like to use a program to list | ||
| 73 | the 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. | ||
| 80 | Leaves point after the inserted text. | ||
| 81 | SWITCHES may be a string of options, or a list of strings. | ||
| 82 | Optional third arg WILDCARD means treat FILE as shell wildcard. | ||
| 83 | Optional fourth arg FULL-DIRECTORY-P means file is a directory and | ||
| 84 | switches do not contain `d', so that a full listing is expected. | ||
| 85 | |||
| 86 | This version of the function comes from `ls-lisp.el'. Depending upon | ||
| 87 | the value of `ls-lisp-use-insert-directory-program', it will use an | ||
| 88 | external program if non-nil or the lisp function `ls-lisp-insert-directory' | ||
| 89 | otherwise." | ||
| 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. |
| 71 | Leaves point after the inserted text. | 96 | Leaves point after the inserted text. |
| 72 | Optional third arg WILDCARD means treat FILE as shell wildcard. | 97 | Optional third arg WILDCARD means treat FILE as shell wildcard. |
| 73 | Optional fourth arg FULL-DIRECTORY-P means file is a directory and | 98 | Optional fourth arg FULL-DIRECTORY-P means file is a directory and |
| 74 | switches do not contain `d', so that a full listing is expected. | 99 | switches do not contain `d', so that a full listing is expected. |
| 75 | 100 | ||
| 76 | This version of the function comes from `ls-lisp.el'. It doesn not | 101 | This version of the function comes from `ls-lisp.el'. It does not |
| 77 | run any external programs or shells. It supports ordinary shell | 102 | run any external programs or shells. It supports ordinary shell |
| 78 | wildcards if `ls-lisp-support-shell-wildcards' variable is non-nil; | 103 | wildcards if `ls-lisp-support-shell-wildcards' variable is non-nil; |
| 79 | otherwise, it interprets wildcards as regular expressions to match | 104 | otherwise, it interprets wildcards as regular expressions to match |