annotate lisp/efs/efs-cms-knet.el @ 22:8fc7fe29b841 r19-15b94

Import from CVS: tag r19-15b94
author cvs
date Mon, 13 Aug 2007 08:50:29 +0200
parents
children 8b8b7f3559a2 8619ce7e4c50
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-cms-knet.el
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
5 ;; Release: $efs release: 1.15 $
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
6 ;; Version: $Revision: 1.1 $
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: CMS support for efs using KNET/VM server
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
9 ;; Authors: Sandy Rutherford <sandy@ibm550.sissa.it>
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
10 ;; Joerg-Martin Schwarz <schwarz@hal1.physik.uni-dortmund.de>
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
11 ;; Created: Wed Mar 23 14:39:00 1994 by schwarz on hal1 from efs-cms.el
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
12 ;; Modified: Sun Nov 27 11:45:58 1994 by sandy on gandalf
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
13 ;; Language: Emacs-Lisp
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
14 ;;
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
15 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
16
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
17 ;;; This file is part of efs. See efs.el for copyright
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
18 ;;; (it's copylefted) and warrranty (there isn't one) information.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
19
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
20 (provide 'efs-cms-knet)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
21 (require 'efs)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
23 (defconst efs-cms-knet-version
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
24 (concat (substring "$efs release: 1.15 $" 14 -2)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
25 "/"
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
26 (substring "$Revision: 1.1 $" 11 -2)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
27
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
28 ;;;; ------------------------------------------------------------
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
29 ;;;; CMS support for KNET-VM server
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
30 ;;;; ------------------------------------------------------------
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
31
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
32 ;;; efs has full support, including tree dired support, for hosts running
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
33 ;;; CMS. It should be able to automatically recognize any CMS machine.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
34 ;;; We would be grateful if you would report any failures to automatically
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
35 ;;; recognize a CMS host as a bug.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
36 ;;;
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
37 ;;; Filename syntax:
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
38 ;;;
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
39 ;;; KNET/VM Support (J. M. Schwarz, Mar 12, 1994):
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
40 ;;; This code has been developed and tested with
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
41 ;;; "KNET/VM FTP server Release 3.2.0" by Spartacus.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
42 ;;;
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
43 ;;; This server uses not only a different listing format than the one used in
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
44 ;;; efs-cms.el, but also handles minidisks differently.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
45 ;;; The cd command for changing minidisk is not supported,
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
46 ;;; instead a full filename syntax "FILENAME.FILETYPE.FM" is used, where
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
47 ;;; FM is the filemode. To access a file "PROFILE EXEC A0", efs uses a
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
48 ;;; syntax "/cms-hostname:/A:/PROFILE.EXEC" (Note the ':')
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
49 ;;;
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
50 ;;; In this directory notation, "/A0:" is actually a subset of the "/A:"
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
51 ;;; directory.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
52
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
53 (efs-defun efs-send-pwd cms-knet (host user &optional xpwd)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
54 ;; cms-knet has no concept of current directory.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
55 ;; Is it safe to always assume this is the user's home?
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
56 (cons "A" ""))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
57
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
58 (efs-defun efs-fix-path cms-knet (path &optional reverse)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
59 ;; Convert PATH from UNIX-ish to CMS. If REVERSE is given, convert
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
60 ;; from CMS to UNIX. Actually, CMS doesn't have a full pathname syntax,
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
61 ;; so we fudge things by sending cd's.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
62 (if reverse
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
63 ;; Since we only convert output from a pwd in this direction,
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
64 ;; this should never be applied, as PWD doesn't work for this server.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
65 (concat "/" path "/")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
66 (efs-save-match-data
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
67 (if (string-match "^/[A-Z]/\\([-A-Z0-9$_+@:]+\\.[-A-Z0-9$_+@:]+\\)$"
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
68 path)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
69 (concat
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
70 (substring path (match-beginning 1) (match-end 1))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
71 "."
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
72 ;; minidisk
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
73 (substring path 1 2))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
74 (error "Invalid CMS-KNET filename")))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
75
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
76 (efs-defun efs-fix-dir-path cms-knet (dir-path)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
77 ;; Convert path from UNIX-ish to CMS-KNET ready for a DIRectory listing.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
78 (cond
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
79 ((string-equal "/" dir-path)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
80 "*.*.*")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
81 ((string-match
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
82 "^/[A-Z]/\\([-A-Z0-9$._+@:]+\\.[-A-Z0-9$._+@:]+\\)?$"
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
83 dir-path)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
84 (concat
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
85 (if (match-beginning 1)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
86 (substring dir-path (match-beginning 1) (match-end 1))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
87 "*")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
88 "."
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
89 (substring dir-path 1 2)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
90 (t (error "Invalid CMS-KNET pathname"))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
91
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
92 (defconst efs-cms-knet-file-name-regexp
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
93 (concat
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
94 "^ *\\([-A-Z0-9$_+@:]+\\) +\\([-A-Z0-9$_+@:]+\\) +"
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
95 "\\([A-Z]\\)[0-9] +[VF] +[0-9]+ "))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
96
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
97 (efs-defun efs-parse-listing cms-knet
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
98 (host user dir path &optional switches)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
99 ;; Parse the current buffer which is assumed to be a CMS directory listing.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
100 ;; HOST = remote host name
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
101 ;; USER = remote user name
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
102 ;; DIR = directory as a full remote path
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
103 ;; PATH = directory as a full efs-path
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
104 (let ((tbl (efs-make-hashtable)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
105 (goto-char (point-min))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
106 (efs-save-match-data
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
107 (if (string-equal dir "/")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
108 (let ((case-fold (memq 'cms-knet efs-case-insensitive-host-types))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
109 tbl-alist md md-tbl)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
110 (while (re-search-forward efs-cms-knet-file-name-regexp nil t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
111 (setq md (buffer-substring (match-beginning 3) (match-end 3))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
112 md-tbl (or (cdr (assoc md tbl-alist))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
113 (let ((new-tbl (efs-make-hashtable)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
114 (setq tbl-alist
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
115 (cons (cons md new-tbl)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
116 tbl-alist))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
117 new-tbl)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
118 (efs-put-hash-entry md '(t) tbl)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
119 (efs-put-hash-entry (concat
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
120 (buffer-substring (match-beginning 1)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
121 (match-end 1))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
122 "."
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
123 (buffer-substring (match-beginning 2)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
124 (match-end 2)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
125 '(nil) md-tbl)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
126 (forward-line 1))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
127 (while tbl-alist
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
128 (setq md (car (car tbl-alist))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
129 md-tbl (cdr (car tbl-alist)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
130 (efs-put-hash-entry "." '(t) md-tbl)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
131 (efs-put-hash-entry ".." '(t) md-tbl)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
132 (efs-put-hash-entry (concat path md "/") md-tbl
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
133 efs-files-hashtable case-fold)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
134 (setq tbl-alist (cdr tbl-alist))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
135 (while (re-search-forward efs-cms-knet-file-name-regexp nil t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
136 (efs-put-hash-entry
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
137 (concat (buffer-substring (match-beginning 1)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
138 (match-end 1))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
139 "."
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
140 (buffer-substring (match-beginning 2)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
141 (match-end 2)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
142 '(nil) tbl)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
143 (forward-line 1)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
144 (efs-put-hash-entry "." '(t) tbl)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
145 (efs-put-hash-entry ".." '(t) tbl))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
146 tbl))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
147
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
148 (efs-defun efs-allow-child-lookup cms-knet (host user dir file)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
149 ;; Returns t if FILE in directory DIR could possibly be a subdir
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
150 ;; according to its file-name syntax, and therefore a child listing should
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
151 ;; be attempted.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
152
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
153 ;; CMS file system is flat. Only minidisks are "subdirs".
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
154 (string-equal "/" dir))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
155
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
156 ;;; Tree dired support:
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
157
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
158 (defconst efs-dired-cms-re-exe
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
159 "^. +[-A-Z0-9$_+@:]+ +\\(EXEC\\|MODULE\\) "
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
160 "Regular expression to use to search for CMS executables.")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
161
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
162 (or (assq 'cms efs-dired-re-exe-alist)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
163 (setq efs-dired-re-exe-alist
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
164 (cons (cons 'cms-knet efs-dired-cms-re-exe)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
165 efs-dired-re-exe-alist)))
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 cms-knet (dir)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
168 ;; CMS has no total line, so we insert a blank line for
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
169 ;; aesthetics.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
170 (insert "\n")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
171 (forward-char -1)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
172 (efs-real-dired-insert-headerline dir))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
173
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
174 (efs-defun efs-dired-manual-move-to-filename cms-knet
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
175 (&optional raise-error bol eol)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
176 ;; In dired, move to the first char of filename on this line.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
177 ;; This is the CMS version.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
178 (or eol (setq eol (save-excursion (skip-chars-forward "^\n\r") (point))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
179 (let (case-fold-search)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
180 (if bol
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
181 (goto-char bol)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
182 (skip-chars-backward "^\n\r")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
183 (setq bol (point)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
184 (if (re-search-forward efs-cms-knet-file-name-regexp eol t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
185 (goto-char (match-beginning 1))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
186 (if raise-error
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
187 (error "No file on this line.")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
188 (goto-char bol)))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
189
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
190 (efs-defun efs-dired-manual-move-to-end-of-filename cms-knet
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
191 (&optional no-error bol eol)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
192 ;; Assumes point is at beginning of filename.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
193 ;; So, it should be called only after (dired-move-to-filename t).
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
194 ;; case-fold-search must be nil, at least for VMS.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
195 ;; On failure, signals an error or returns nil.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
196 ;; This is the CMS version.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
197 (and selective-display
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
198 (null no-error)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
199 (eq (char-after
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
200 (1- (or bol (save-excursion
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
201 (skip-chars-backward "^\r\n")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
202 (point)))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
203 ?\r)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
204 ;; File is hidden or omitted.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
205 (cond
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
206 ((dired-subdir-hidden-p (dired-current-directory))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
207 (error
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
208 (substitute-command-keys
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
209 "File line is hidden. Type \\[dired-hide-subdir] to unhide.")))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
210 ((error
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
211 (substitute-command-keys
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
212 "File line is omitted. Type \\[dired-omit-toggle] to un-omit."
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
213 )))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
214 (if (looking-at "[-A-Z0-9$_+@:]+ +[-A-Z0-9$_+@:]+ +[A-Z][0-9] ")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
215 (goto-char (- (match-end 0) 2)) ; return point
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
216 (if no-error
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
217 nil
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
218 (error "No file on this line."))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
219
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
220 (efs-defun efs-dired-get-filename cms-knet
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
221 (&optional localp no-error-if-not-filep)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
222 (let ((name (efs-real-dired-get-filename 'no-dir no-error-if-not-filep)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
223 (and name
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
224 (if (string-match
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
225 "^\\([-A-Z0-9$_+@:]+\\) +\\([-A-Z0-9$_+@:]+\\) +\\([A-Z]\\)$"
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
226 name)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
227 (let* ((dir (dired-current-directory))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
228 (rdir (nth 2 (efs-ftp-path dir))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
229 (setq name (concat (substring name (match-beginning 1)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
230 (match-end 1))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
231 "."
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
232 (substring name (match-beginning 2)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
233 (match-end 2))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
234 (if (string-equal rdir "/")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
235 (setq name (concat (substring name (match-beginning 3)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
236 (match-end 3)) "/" name)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
237 (if (eq localp 'no-dir)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
238 name
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
239 (concat (if localp
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
240 (dired-current-directory localp)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
241 dir)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
242 name)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
243 (error "Strange CMS-KNET file name %s" name)))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
244
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
245 ;;; end of efs-cms-knet.el