comparison lisp/ls-lisp.el @ 185:7811acc9c926

Removed dired-ls-function. IT STILL CRASHES EMACS SOMETIMES!
author Sebastian Kremer <sk@thp.uni-koeln.de>
date Sun, 03 Feb 1991 17:06:50 +0000
parents c3060611e9af
children 954d6271f0e9
comparison
equal deleted inserted replaced
184:c3060611e9af 185:7811acc9c926
1 ;;;; dired-lisp.el - emulate ls completely in Emacs Lisp. $Revision$ 1 ;;;; dired-lisp.el - emulate ls completely in Emacs Lisp. $Revision: 1.2 $
2 ;;;; Copyright (C) 1991 Sebastian Kremer <sk@thp.uni-koeln.de> 2 ;;;; Copyright (C) 1991 Sebastian Kremer <sk@thp.uni-koeln.de>
3 3
4 ;;;; READ THE WARNING BELOW BEFORE USING THIS PROGRAM! 4 ;;;; READ THE WARNING BELOW BEFORE USING THIS PROGRAM!
5 5
6 ;;;; Useful if you cannot afford to fork Emacs on a real memory UNIX, 6 ;;;; Useful if you cannot afford to fork Emacs on a real memory UNIX,
22 ;; along with GNU Emacs; see the file COPYING. If not, write to 22 ;; along with GNU Emacs; see the file COPYING. If not, write to
23 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 23 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
24 24
25 ;;;; WARNING: 25 ;;;; WARNING:
26 26
27 ;;;; I initially used file-name-all-completions instead of 27 ;;;; Sometimes I get an internal Emacs error:
28 ;;;; directory-files and got an internal Emacs error:
29 28
30 ;;;; Signalling: (wrong-type-argument natnump #<EMACS BUG: ILLEGAL 29 ;;;; Signalling: (wrong-type-argument natnump #<EMACS BUG: ILLEGAL
31 ;;;; DATATYPE (#o37777777727) Save your buffers immediately and please 30 ;;;; DATATYPE (#o37777777727) Save your buffers immediately and please
32 ;;;; report this bug>) 31 ;;;; report this bug>)
33 32
34 ;;;; It has never happened again and had no bad aftereffects, but do be 33 ;;;; Sometimes emacs just crashes with a fatal error.
35 ;;;; careful!
36 34
37 ;;; RESTRICTIONS: 35 ;;; RESTRICTIONS:
38 ;;;; Always sorts by name (ls switches are completely ignored for now) 36 ;;;; Always sorts by name (ls switches are completely ignored for now)
39 ;;;; Cannot display date of file, displays a fake date "Jan 00 00:00" instead 37 ;;;; Cannot display date of file, displays a fake date "Jan 00 00:00" instead
40 ;;;; Only numeric uid/gid 38 ;;;; Only numeric uid/gid
39 ;;;; Loading ange-ftp breaks it
41 40
42 ;;;; It is surprisingly fast, though! 41 ;;;; It is surprisingly fast, though!
43 42
44 ;;;; TODO: 43 ;;;; TODO:
45 ;;;; Recognize at least some ls switches: l R g F i 44 ;;;; Recognize at least some ls switches: l R g F i
46 45
47 (require 'dired) 46 (require 'dired) ; we will redefine this function:
48
49 (or (fboundp 'tree-dired-ls) ; save original function definition
50 (fset 'tree-dired-ls (symbol-function 'dired-ls)))
51
52 ;; perhaps buffer-local (he he)
53 (defvar dired-ls-function 'dired-lisp-ls
54 "*Function dired uses to obtain ls output.
55 Possible values 'tree-dired-ls and 'dired-lisp-ls.
56 Arglist is (FILE &optional SWITCHES WILDCARD FULL-DIRECTORY-P).")
57 47
58 (defun dired-ls (file &optional switches wildcard full-directory-p) 48 (defun dired-ls (file &optional switches wildcard full-directory-p)
59 (funcall dired-ls-function file switches wildcard full-directory-p)) 49 "dired-lisp.el's version of dired-ls."
60
61 (defun dired-lisp-ls (file &optional switches wildcard full-directory-p)
62 ; "Insert ls output of FILE, optionally formatted with SWITCHES. 50 ; "Insert ls output of FILE, optionally formatted with SWITCHES.
63 ;Optional third arg WILDCARD means treat FILE as shell wildcard. 51 ;Optional third arg WILDCARD means treat FILE as shell wildcard.
64 ;Optional fourth arg FULL-DIRECTORY-P means file is a directory and 52 ;Optional fourth arg FULL-DIRECTORY-P means file is a directory and
65 ;switches do not contain `d'. 53 ;switches do not contain `d'.
66 ; 54 ;