aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Hansen2005-11-22 19:25:50 +0000
committerLars Hansen2005-11-22 19:25:50 +0000
commit5eba3394e0720dd90109fd2076748f38e2b581b9 (patch)
tree3453e46e4f4f0fba3f44fd9feb0bab9a1d7eacc7
parentad7a98ae73d1da9cbe11124fed0948fc160a42b8 (diff)
downloademacs-5eba3394e0720dd90109fd2076748f38e2b581b9.tar.gz
emacs-5eba3394e0720dd90109fd2076748f38e2b581b9.zip
(ls-lisp-parse-symlink): Delete.
(ls-lisp-classify, ls-lisp-format): Delete call to ls-lisp-parse-symlink. (ls-lisp-handle-switches): Handle symlinks to directories as directories when ls-lisp-dirs-first in non-nil.
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/ls-lisp.el31
2 files changed, 16 insertions, 22 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 3a9e3f9c83d..6c914d440fb 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12005-11-22 Lars Hansen <larsh@soem.dk>
2 * ls-lisp.el (ls-lisp-parse-symlink): Delete.
3 (ls-lisp-classify, ls-lisp-format): Delete call to
4 ls-lisp-parse-symlink.
5 (ls-lisp-handle-switches): Handle symlinks to directories as
6 directories when ls-lisp-dirs-first in non-nil.
7
12005-11-21 Luc Teirlinck <teirllm@auburn.edu> 82005-11-21 Luc Teirlinck <teirllm@auburn.edu>
2 9
3 * startup.el (command-line): Make sure that loaddefs.el is handled 10 * startup.el (command-line): Make sure that loaddefs.el is handled
diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el
index 5f5a53b0df0..0da64128118 100644
--- a/lisp/ls-lisp.el
+++ b/lisp/ls-lisp.el
@@ -45,8 +45,6 @@
45;; * A few obscure ls switches are still ignored: see the docstring of 45;; * A few obscure ls switches are still ignored: see the docstring of
46;; `insert-directory'. 46;; `insert-directory'.
47 47
48;; * Generally only numeric uid/gid.
49
50;; TO DO ============================================================= 48;; TO DO =============================================================
51 49
52;; Complete handling of F switch (if/when possible). 50;; Complete handling of F switch (if/when possible).
@@ -61,8 +59,8 @@
61;; Revised by Andrew Innes and Geoff Volker (and maybe others). 59;; Revised by Andrew Innes and Geoff Volker (and maybe others).
62 60
63;; Modified by Francis J. Wright <F.J.Wright@maths.qmw.ac.uk>, mainly 61;; Modified by Francis J. Wright <F.J.Wright@maths.qmw.ac.uk>, mainly
64;; to support many more ls options, "platform emulation", hooks for 62;; to support many more ls options, "platform emulation" and more
65;; external symbolic link support and more robust sorting. 63;; robust sorting.
66 64
67;;; Code: 65;;; Code:
68 66
@@ -175,14 +173,6 @@ current year. The OLD-TIME-FORMAT is used for older files. To use ISO
175(or (featurep 'ls-lisp) ; FJW: unless this file is being reloaded! 173(or (featurep 'ls-lisp) ; FJW: unless this file is being reloaded!
176 (setq original-insert-directory (symbol-function 'insert-directory))) 174 (setq original-insert-directory (symbol-function 'insert-directory)))
177 175
178;; This stub is to allow ls-lisp to parse symbolic links via another
179;; library such as w32-symlinks.el from
180;; http://centaur.maths.qmw.ac.uk/Emacs/:
181(defun ls-lisp-parse-symlink (file-name)
182 "This stub may be redefined to parse FILE-NAME as a symlink.
183It should return nil or the link target as a string."
184 nil)
185
186 176
187;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 177;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
188 178
@@ -429,7 +419,9 @@ SWITCHES is a list of characters. Default sorting is alphabetic."
429 ;; symbolic link, or nil. 419 ;; symbolic link, or nil.
430 (let (el dirs files) 420 (let (el dirs files)
431 (while file-alist 421 (while file-alist
432 (if (eq (cadr (setq el (car file-alist))) t) ; directory 422 (if (or (eq (cadr (setq el (car file-alist))) t) ; directory
423 (and (stringp (cadr el))
424 (file-directory-p (cadr el)))) ; symlink to a directory
433 (setq dirs (cons el dirs)) 425 (setq dirs (cons el dirs))
434 (setq files (cons el files))) 426 (setq files (cons el files)))
435 (setq file-alist (cdr file-alist))) 427 (setq file-alist (cdr file-alist)))
@@ -455,12 +447,11 @@ links, `|' for FIFOs, `=' for sockets, and nothing for regular files.
455\[But FIFOs and sockets are not recognized.] 447\[But FIFOs and sockets are not recognized.]
456FILEDATA has the form (filename . `file-attributes'). Its `cadr' is t 448FILEDATA has the form (filename . `file-attributes'). Its `cadr' is t
457for directory, string (name linked to) for symbolic link, or nil." 449for directory, string (name linked to) for symbolic link, or nil."
458 (let ((dir (cadr filedata)) (file-name (car filedata))) 450 (let ((file-name (car filedata))
459 (cond ((or dir 451 (type (cadr filedata)))
460 ;; Parsing .lnk files here is perhaps overkill! 452 (cond (type
461 (setq dir (ls-lisp-parse-symlink file-name)))
462 (cons 453 (cons
463 (concat file-name (if (eq dir t) "/" "@")) 454 (concat file-name (if (eq type t) "/" "@"))
464 (cdr filedata))) 455 (cdr filedata)))
465 ((string-match "x" (nth 9 filedata)) 456 ((string-match "x" (nth 9 filedata))
466 (cons 457 (cons
@@ -506,10 +497,6 @@ SWITCHES, TIME-INDEX and NOW give the full switch list and time data."
506 ;; t for directory, string (name linked to) 497 ;; t for directory, string (name linked to)
507 ;; for symbolic link, or nil. 498 ;; for symbolic link, or nil.
508 (drwxrwxrwx (nth 8 file-attr))) ; attribute string ("drwxrwxrwx") 499 (drwxrwxrwx (nth 8 file-attr))) ; attribute string ("drwxrwxrwx")
509 (and (null file-type)
510 ;; Maybe no kernel support for symlinks, so...
511 (setq file-type (ls-lisp-parse-symlink file-name))
512 (aset drwxrwxrwx 0 ?l)) ; symbolic link - update attribute string
513 (concat (if (memq ?i switches) ; inode number 500 (concat (if (memq ?i switches) ; inode number
514 (format " %6d" (nth 10 file-attr))) 501 (format " %6d" (nth 10 file-attr)))
515 ;; nil is treated like "" in concat 502 ;; nil is treated like "" in concat