annotate lisp/efs/efs-netware.el @ 116:9f59509498e1 r20-1b10

Import from CVS: tag r20-1b10
author cvs
date Mon, 13 Aug 2007 09:23:06 +0200
parents 8fc7fe29b841
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
1 ;; -*-Emacs-Lisp-*-
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
2 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
3 ;;
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
4 ;; File: efs-netware.el
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
5 ;; Release: $efs release: 1.15 $
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 22
diff changeset
6 ;; Version: #Revision: 1.5 $
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
7 ;; RCS:
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
8 ;; Description: efs support for the Novell Netware FTP server
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
9 ;; Author: Sandy Rutherford <sandy@math.ubc.ca>
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
10 ;; Created: Fri Oct 15 00:30:50 1993 by sandy on gauss.math.ubc.ca
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
11 ;; Modified: Tue Nov 22 00:11:46 1994 by sandy on gandalf
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
12 ;;
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
13 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
14
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
15 ;;; This file is part of efs. See efs.el for copyright
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
16 ;;; (it's copylefted) and warrranty (there isn't one) information.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
17
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
18 ;;; Works for (at least) Novell NetWare v3.11. This is a DOS FTP server,
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
19 ;;; however, it returns a unix-ish path format.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
20
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
21 (provide 'efs-netware)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
22 (require 'efs)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
23
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
24 (defconst efs-netware-version
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
25 (concat (substring "$efs release: 1.15 $" 14 -2)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
26 "/"
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 22
diff changeset
27 (substring "#Revision: 1.5 $" 11 -2)))
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
28
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
29 ;;; Basic efs support
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
30
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
31 (defconst efs-netware-date-regexp
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
32 (concat
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
33 "\\(Jan\\|Feb\\|Mar\\|Apr\\|May\\|Jun\\|Jul\\|Aug\\|Sep\\|Oct\\|Nov\\|"
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
34 "Dec\\) [ 0-3][0-9] \\([0-9][0-9] \\)?[0-2][0-9]:[0-6][0-9] +"))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
35
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
36 (efs-defun efs-fix-path netware (path &optional reverse)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
37 ;; Convert PATH from UNIX-ish to netware.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
38 (efs-save-match-data
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
39 (if reverse
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
40 (cond ((string-match "^[^/][^:]*:" path)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
41 (concat "/" path))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
42 ((string-match "^/" path)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
43 path)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
44 ((error "%s not a valid netware path." path)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
45 (if (string-match ":" path)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
46 (substring path 1)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
47 path))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
48
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
49 (efs-defun efs-fix-dir-path netware (dir-path)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
50 ;; Convert DIR-PATH from UN*X-ish to Netware for a DIR listing.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
51 (efs-fix-dir-path nil (efs-fix-path 'netware dir-path)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
52
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
53 (defun efs-netware-bogus-listing-p (dir path)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
54 (save-excursion
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
55 (and
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
56 (not (eobp))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
57 (save-excursion (forward-line 1) (eobp))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
58 (not (string-equal dir "/"))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
59 (re-search-forward efs-netware-date-regexp nil t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
60 (search-forward "/.\n"))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
61
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
62 (efs-defun efs-parse-listing netware (host user dir path &optional switches)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
63 ;; Parse the current buffer which is assumed to be a listing from
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
64 ;; a Novell Netware FTP server (runs under DOS).
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
65 ;; format, and return a hashtable as the result. SWITCHES are never used,
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
66 ;; but they must be specified in the argument list for compatibility
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
67 ;; with the unix version of this function.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
68 ;; HOST = remote host name
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
69 ;; USER = user name
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
70 ;; DIR = directory in as a full remote path
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
71 ;; PATH = directory in full efs path syntax
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
72 ;; SWITCHES = ls switches (not relevant here)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
73 (goto-char (point-min))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
74 (efs-save-match-data
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
75 (if (re-search-forward efs-netware-date-regexp nil t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
76 (progn
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
77 (beginning-of-line)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
78 (and (not (efs-netware-bogus-listing-p dir path))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
79 (let ((tbl (efs-make-hashtable))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
80 dir-p file size)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
81 (while (let ((eol (save-excursion (end-of-line) (point))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
82 (setq dir-p (= (following-char) ?d))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
83 (re-search-forward efs-netware-date-regexp eol t))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
84 (setq file (buffer-substring (point)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
85 (progn (end-of-line) (point)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
86 size (progn
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
87 (goto-char (match-beginning 0))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
88 (skip-chars-backward " ")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
89 (buffer-substring (point)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
90 (progn
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
91 (skip-chars-backward "0-9")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
92 (point)))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
93 (if (string-equal size "")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
94 (setq size nil)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
95 (setq size (string-to-int size)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
96 (efs-put-hash-entry file (list dir-p size) tbl)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
97 (forward-line 1))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
98 (efs-put-hash-entry "." '(t) tbl)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
99 (efs-put-hash-entry ".." '(t) tbl)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
100 tbl))))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
101
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
102 ;;; Sorting dir listings.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
103
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
104 (efs-fset 'efs-t-converter 'netware 'efs-unix-t-converter)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
105
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
106 ;;; Dired support
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
107
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
108 (defconst efs-dired-netware-re-exe "\\.\\(exe\\|EXE\\)$")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
109 (or (assq 'netware efs-dired-re-exe-alist)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
110 (setq efs-dired-re-exe-alist
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
111 (cons (cons 'netware efs-dired-netware-re-exe)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
112 efs-dired-re-exe-alist)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
113
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
114 (defconst efs-dired-netware-re-dir "^.[ \t]+d ")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
115 (or (assq 'netware efs-dired-re-dir-alist)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
116 (setq efs-dired-re-dir-alist
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
117 (cons (cons 'netware efs-dired-netware-re-dir)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
118 efs-dired-re-dir-alist)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
119
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
120 (efs-defun efs-dired-manual-move-to-filename netware
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
121 (&optional raise-error bol eol)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
122 ;; In dired, move to the first char of filename on this line.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
123 ;; Returns (point) or nil if raise-error is nil, and there is no
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
124 ;; no filename on this line.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
125 ;; This is the Netware version.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
126 (or eol (setq eol (save-excursion (skip-chars-forward "^\r\n") (point))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
127 (let (case-fold-search)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
128 (if bol
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
129 (goto-char bol)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
130 (skip-chars-backward "^\n\r"))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
131 ;; move over marker
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
132 (if (re-search-forward efs-netware-date-regexp eol t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
133 (goto-char (match-end 0)) ; returns (point)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
134 (and raise-error (error "No file on this line")))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
135
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
136 (efs-defun efs-dired-manual-move-to-end-of-filename netware
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
137 (&optional no-error bol eol)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
138 ;; Assumes point is at the beginning of filename.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
139 ;; So, it should be called only after (dired-move-to-filename t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
140 ;; On failure signals an error, or returns nil.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
141 ;; This is the Netware version.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
142 (let ((opoint (point)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
143 (and selective-display
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
144 (null no-error)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
145 (eq (char-after
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
146 (1- (or bol (save-excursion
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
147 (skip-chars-backward "^\r\n")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
148 (point)))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
149 ?\r)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
150 ;; File is hidden or omitted.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
151 (cond
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
152 ((dired-subdir-hidden-p (dired-current-directory))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
153 (error
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
154 (substitute-command-keys
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
155 "File line is hidden. Type \\[dired-hide-subdir] to unhide.")))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
156 ((error
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
157 (substitute-command-keys
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
158 "File line is omitted. Type \\[dired-omit-toggle] to un-omit."
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
159 )))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
160 (skip-chars-forward "^A-Z\n\r")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
161 (if (or (= opoint (point)) (not (memq (following-char) '(?\n ?\r ?\ ))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
162 (if no-error
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
163 nil
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
164 (error "No file on this line"))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
165 (point))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
166
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
167 (efs-defun efs-dired-insert-headerline netware (dir)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
168 ;; Insert a blank line for aesthetics.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
169 (insert " \n")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
170 (forward-char -2)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
171 (efs-real-dired-insert-headerline dir))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
172
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
173 (efs-defun efs-dired-fixup-listing netware
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
174 (file path &optional switches wildcard)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
175 ;; listings come out in random order
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
176 (let (case-fold-search)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
177 (if (or (null switches)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
178 ;; In case efs is handling the switches itself.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
179 (not (string-match "t" switches)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
180 (progn
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
181 (goto-char (point-max))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
182 (if (re-search-backward efs-netware-date-regexp nil t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
183 (save-restriction
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
184 (forward-line 1)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
185 (narrow-to-region (point-min) (point))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
186 (forward-line -1)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
187 ;; Count how many fields
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
188 (let ((fields 0))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
189 (skip-chars-forward " \t")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
190 (while (not (eolp))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
191 (skip-chars-forward "^ \t\n")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
192 (skip-chars-forward " \t")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
193 (setq fields (1+ fields)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
194 (sort-fields fields (point-min) (point-max)))))))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
195
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
196 ;;; end of efs-netware.el