From xemacs-m  Sun Jun 15 14:54:42 1997
Received: from bittersweet.inetarena.com (karlheg@bittersweet.inetarena.com [206.129.216.38])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id OAA19402
	for <xemacs-beta@xemacs.org>; Sun, 15 Jun 1997 14:54:28 -0500 (CDT)
Received: (from karlheg@localhost)
	by bittersweet.inetarena.com (8.8.5/8.8.5) id MAA08123;
	Sun, 15 Jun 1997 12:54:42 -0700
Date: Sun, 15 Jun 1997 12:54:42 -0700
Message-Id: <199706151954.MAA08123@bittersweet.inetarena.com>
From: "Karl M. Hegbloom" <karlheg@inetarena.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
To: <xemacs-beta@xemacs.org>
Subject: [patch] efs/{dired-{shell,xemacs},dired,efs-{cms,dired,dl,
	dos-distinct,guardian,hell,ka9q,mpe,ms-unix,mts,mvs,netrc,netware,
	nos-ve,pc,tops-20,vms,vos},efs}.el
X-Mailer: VM 6.32 under 20.3 "Oslo" XEmacs Lucid (beta7)
X-Face: /Q}=yl}1_v7nP)xXo5XjG8+tl@=uVu7o5u6)f]zN?+<hB!K.m9:[|*p34jVN`O;:XZXVSy>/\R>qDt(t8w!-i{(y0"`jFw^uk8inzO9wXabd'CdjUWfC\GHi:6nO*YC89#-qD>Q4r%9!V"<RYJ=7D#$";q=zML5'!=wvXk^$`6FT=5CMofQX)WUKt0p:OKl.mFOXx/D


8<----------------------------------------------------------------->8
*** dired-shell.el.orig	Sun Jun 15 12:37:17 1997
--- dired-shell.el	Sun Jun 15 12:48:23 1997
***************
*** 1,4 ****
! ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;;
  ;; File:          dired-shell.el
  ;; Dired Version: #Revision: 7.9 $
--- 1,4 ----
! !;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;;
  ;; File:          dired-shell.el
  ;; Dired Version: #Revision: 7.9 $
***************
*** 551,557 ****
  	  (if append
  	      (progn
  		(goto-char (point-max))
! 		(or (= (preceding-char) ?\n) (bobp) (insert "\n")))
  	    (erase-buffer)
  	    (if (stringp in-background)
  		(progn
--- 551,557 ----
  	  (if append
  	      (progn
  		(goto-char (point-max))
! 		(or (= (char-before (point)) ?\n) (bobp) (insert "\n")))
  	    (erase-buffer)
  	    (if (stringp in-background)
  		(progn
***************
*** 570,576 ****
  	(if append
  	    (progn
  	      (goto-char (point-max))
! 	      (or (= (preceding-char) ?\n) (bobp) (insert "\n")))
  	  (erase-buffer))
  	(dired-shell-call-process command dir)))))
  
--- 570,576 ----
  	(if append
  	    (progn
  	      (goto-char (point-max))
! 	      (or (= (char-before (point)) ?\n) (bobp) (insert "\n")))
  	  (erase-buffer))
  	(dired-shell-call-process command dir)))))
  
*** dired-xemacs.el.orig	Sun Jun 15 12:37:43 1997
--- dired-xemacs.el	Sun Jun 15 12:48:35 1997
***************
*** 335,341 ****
  	(save-excursion
  	  (goto-char (event-point event))
  	  (beginning-of-line)
! 	  (if (char-equal (following-char) dired-del-marker)
  	      (dired-unflag 1)
  	    (dired-flag-file-deletion 1)))
        (error
--- 335,341 ----
  	(save-excursion
  	  (goto-char (event-point event))
  	  (beginning-of-line)
! 	  (if (char-equal (char-after (point)) dired-del-marker)
  	      (dired-unflag 1)
  	    (dired-flag-file-deletion 1)))
        (error
***************
*** 485,491 ****
    (let ((mark
  	 (save-excursion
  	   (skip-chars-backward "^\n\r")
! 	   (following-char)))
  	(face (extent-face extent)))
      (if (char-equal mark ?\ )
  	(if (consp face)
--- 485,491 ----
    (let ((mark
  	 (save-excursion
  	   (skip-chars-backward "^\n\r")
! 	   (char-after (point))))
  	(face (extent-face extent)))
      (if (char-equal mark ?\ )
  	(if (consp face)
*** dired.el.orig	Sun Jun 15 12:38:03 1997
--- dired.el	Sun Jun 15 12:48:47 1997
***************
*** 770,783 ****
  	   (goto-char (point-min))
  	   (while (not (eobp))
  	     (if (and (, predicate)
! 		      (not (char-equal (following-char) dired-marker-char)))
  		 (progn
  		   ;; Doing this rather than delete-char, insert
  		   ;; avoids re-computing markers
  		   (setq (, temp-pt) (point))
  		   (dired-substitute-marker
  		    (, temp-pt)
! 		    (following-char) dired-marker-char)
  		   (setq (, temp-count) (1+ (, temp-count)))))
  	     (forward-line 1))
  	   (if (, temp-msg)
--- 770,783 ----
  	   (goto-char (point-min))
  	   (while (not (eobp))
  	     (if (and (, predicate)
! 		      (not (char-equal (char-after (point)) dired-marker-char)))
  		 (progn
  		   ;; Doing this rather than delete-char, insert
  		   ;; avoids re-computing markers
  		   (setq (, temp-pt) (point))
  		   (dired-substitute-marker
  		    (, temp-pt)
! 		    (char-after (point)) dired-marker-char)
  		   (setq (, temp-count) (1+ (, temp-count)))))
  	     (forward-line 1))
  	   (if (, temp-msg)
***************
*** 1948,1954 ****
        (goto-char beg)
        (while (re-search-forward dired-re-mark end t)
  	(if (setq fil (dired-get-filename nil t))
! 	    (setq chr (preceding-char)
  		  alist (cons (cons fil chr) alist)))))
      alist))
  
--- 1948,1954 ----
        (goto-char beg)
        (while (re-search-forward dired-re-mark end t)
  	(if (setq fil (dired-get-filename nil t))
! 	    (setq chr (char-before (point))
  		  alist (cons (cons fil chr) alist)))))
      alist))
  
***************
*** 1963,1969 ****
        (if (dired-goto-file fil)
  	  (save-excursion
  	    (beginning-of-line)
! 	    (dired-substitute-marker (point) (following-char) chr))))))
  
  (defun dired-remember-hidden ()
    ;; Return a list of all hidden subdirs.
--- 1963,1969 ----
        (if (dired-goto-file fil)
  	  (save-excursion
  	    (beginning-of-line)
! 	    (dired-substitute-marker (point) (char-after (point)) chr))))))
  
  (defun dired-remember-hidden ()
    ;; Return a list of all hidden subdirs.
***************
*** 2084,2090 ****
  	(quit ; watch out for aborted inserts
  	 (and (= opoint-max (point-max))
  	      (null elt)
! 	      (= (preceding-char) ?\n)
  	      (delete-char -1))
  	 (signal 'quit nil))))
      (or no-posn (dired-initial-position dirname))))
--- 2084,2090 ----
  	(quit ; watch out for aborted inserts
  	 (and (= opoint-max (point-max))
  	      (null elt)
! 	      (= (char-before (point)) ?\n)
  	      (delete-char -1))
  	 (signal 'quit nil))))
      (or no-posn (dired-initial-position dirname))))
***************
*** 2443,2449 ****
  	    (goto-char pos)
  	  (goto-char pos)
  	  (skip-chars-forward "^\r\n")
! 	  (if (= (following-char) ?\r)
  	      (skip-chars-backward "." (- (point) 3)))
  	  (dired-update-mode-line t)
  	  (point))
--- 2443,2449 ----
  	    (goto-char pos)
  	  (goto-char pos)
  	  (skip-chars-forward "^\r\n")
! 	  (if (= (char-after (point)) ?\r)
  	      (skip-chars-backward "." (- (point) 3)))
  	  (dired-update-mode-line t)
  	  (point))
***************
*** 2491,2497 ****
  	   ;; dired-subdir-hidden-p and dired-add-entry depend on point being
  	   ;; at either \n or looking-at ...\r after this function succeeds.
  	   (skip-chars-forward "^\r\n")
! 	   (if (= (preceding-char) ?.)
  	       (skip-chars-backward "." (- (point) 3)))
  	   (if (interactive-p) (dired-update-mode-line))
  	   (point)))))
--- 2491,2497 ----
  	   ;; dired-subdir-hidden-p and dired-add-entry depend on point being
  	   ;; at either \n or looking-at ...\r after this function succeeds.
  	   (skip-chars-forward "^\r\n")
! 	   (if (= (char-before (point)) ?.)
  	       (skip-chars-backward "." (- (point) 3)))
  	   (if (interactive-p) (dired-update-mode-line))
  	   (point)))))
***************
*** 2598,2604 ****
  			(goto-char (match-beginning 0))
  		      (goto-char eol))
  		    (and dired-ls-F-marks-symlinks
! 			 (eq (preceding-char) ?@) ; link really marked?
  			 (memq ?F dired-internal-switches)
  			 (forward-char -1))
  		    (point))
--- 2598,2604 ----
  			(goto-char (match-beginning 0))
  		      (goto-char eol))
  		    (and dired-ls-F-marks-symlinks
! 			 (eq (char-before (point)) ?@) ; link really marked?
  			 (memq ?F dired-internal-switches)
  			 (forward-char -1))
  		    (point))
***************
*** 2609,2615 ****
  		;; e.g. by an FTP ls in efs
  		(and
  		 (memq ?F dired-internal-switches)
! 		 (let ((char (preceding-char)))
  		   (or (and (eq char ?*) (or
  					  (memq
  					   (char-after (+ modes-start 3))
--- 2609,2615 ----
  		;; e.g. by an FTP ls in efs
  		(and
  		 (memq ?F dired-internal-switches)
! 		 (let ((char (char-before (point))))
  		   (or (and (eq char ?*) (or
  					  (memq
  					   (char-after (+ modes-start 3))
***************
*** 2634,2640 ****
  	  (and (null no-error)
  	       (error "No file on this line"))
  	(goto-char eol)
! 	(if (and (memq (preceding-char) '(?@ ?* ?=))
  		 (memq ?F dired-internal-switches))
  	    ;; A guess, since without a long listing, we can't be sure.
  	    (forward-char -1))
--- 2634,2640 ----
  	  (and (null no-error)
  	       (error "No file on this line"))
  	(goto-char eol)
! 	(if (and (memq (char-before (point)) '(?@ ?* ?=))
  		 (memq ?F dired-internal-switches))
  	    ;; A guess, since without a long listing, we can't be sure.
  	    (forward-char -1))
***************
*** 2647,2653 ****
    ;; If point is on a file line, moves to that file.
    ;; This does not move to omitted files.
    (skip-chars-backward "^\n\r")
!   (if (= (preceding-char) ?\r)
        (forward-line 1))
    (let ((max (dired-subdir-max))
  	file)
--- 2647,2653 ----
    ;; If point is on a file line, moves to that file.
    ;; This does not move to omitted files.
    (skip-chars-backward "^\n\r")
!   (if (= (char-before (point)) ?\r)
        (forward-line 1))
    (let ((max (dired-subdir-max))
  	file)
***************
*** 3244,3250 ****
       arg
       (function
        (lambda ()
! 	(if (char-equal (following-char) dired-del-marker)
  	    (progn
  	      (setq dired-del-flags-number (max (1- dired-del-flags-number) 0))
  	      (dired-substitute-marker (point) dired-del-marker ?\ )))))))
--- 3244,3250 ----
       arg
       (function
        (lambda ()
! 	(if (char-equal (char-after (point)) dired-del-marker)
  	    (progn
  	      (setq dired-del-flags-number (max (1- dired-del-flags-number) 0))
  	      (dired-substitute-marker (point) dired-del-marker ?\ )))))))
***************
*** 3282,3288 ****
  		dired-marks-number 0
  		dired-other-marks-number 0)
  	  (while (not (eobp))
! 	    (setq char (following-char))
  	    (cond
  	     ((char-equal char dired-del-marker)
  	      (setq dired-del-flags-number (1+ dired-del-flags-number)))
--- 3282,3288 ----
  		dired-marks-number 0
  		dired-other-marks-number 0)
  	  (while (not (eobp))
! 	    (setq char (char-after (point)))
  	    (cond
  	     ((char-equal char dired-del-marker)
  	      (setq dired-del-flags-number (1+ dired-del-flags-number)))
***************
*** 3510,3516 ****
  	 (not (memq (backup-extract-version fn) base-version-list))
  	 (progn (skip-chars-backward "^\n\r")
  		(bolp)) ; make sure the preceding char isn't \r.
! 	 (dired-substitute-marker (point) (following-char) marker))))
  
  (defun dired-map-dired-file-lines (fun)
    ;; Perform FUN with point at the end of each non-directory line.
--- 3510,3516 ----
  	 (not (memq (backup-extract-version fn) base-version-list))
  	 (progn (skip-chars-backward "^\n\r")
  		(bolp)) ; make sure the preceding char isn't \r.
! 	 (dired-substitute-marker (point) (char-after (point)) marker))))
  
  (defun dired-map-dired-file-lines (fun)
    ;; Perform FUN with point at the end of each non-directory line.
***************
*** 3522,3528 ****
        (while (not (eobp))
  	(save-excursion
  	  (and (not (and dired-re-dir (looking-at dired-re-dir)))
! 	       (not (memq (following-char) '(?\n ?\n)))
  	       (setq file (dired-get-filename nil t)) ; nil on non-file
  	       (progn (skip-chars-forward "^\n\r")
  		      (funcall fun file))))
--- 3522,3528 ----
        (while (not (eobp))
  	(save-excursion
  	  (and (not (and dired-re-dir (looking-at dired-re-dir)))
! 	       (not (memq (char-after (point)) '(?\n ?\n)))
  	       (setq file (dired-get-filename nil t)) ; nil on non-file
  	       (progn (skip-chars-forward "^\n\r")
  		      (funcall fun file))))
***************
*** 3802,3809 ****
       arg
       (function
        (lambda ()
! 	(dired-update-marker-counters (following-char) t)
! 	(dired-substitute-marker (point) (following-char) char)
  	(dired-update-marker-counters char))))
      (dired-update-mode-line-modified)))
  
--- 3802,3809 ----
       arg
       (function
        (lambda ()
! 	(dired-update-marker-counters (char-after (point)) t)
! 	(dired-substitute-marker (point) (char-after (point)) char)
  	(dired-update-marker-counters char))))
      (dired-update-mode-line-modified)))
  
***************
*** 3822,3828 ****
       arg
       (function
        (lambda ()
! 	(let ((char (following-char)))
  	  (or (memq char '(?\  ?\n ?\r))
  	      (progn
  		(cond
--- 3822,3828 ----
       arg
       (function
        (lambda ()
! 	(let ((char (char-after (point))))
  	  (or (memq char '(?\  ?\n ?\r))
  	      (progn
  		(cond
***************
*** 3905,3911 ****
  	      (save-excursion
  		(goto-char (point-min))
  		(while (search-forward string nil t)
! 		  (if (char-equal (preceding-char) old)
  		      (progn
  			(dired-substitute-marker (1- (point)) old new)
  			(set new-count (1+ (symbol-value new-count)))
--- 3905,3911 ----
  	      (save-excursion
  		(goto-char (point-min))
  		(while (search-forward string nil t)
! 		  (if (char-equal (char-before (point)) old)
  		      (progn
  			(dired-substitute-marker (1- (point)) old new)
  			(set new-count (1+ (symbol-value new-count)))
***************
*** 3920,3930 ****
  	    (or (dired-between-files)
  		(looking-at dired-re-dot)
  		(cond
! 		 ((= (following-char) ?\ )
  		  (setq mcount (1+ mcount))
  		  (set old-count (1+ (symbol-value old-count)))
  		  (dired-substitute-marker (point) ?\  old))
! 		 ((= (following-char) old)
  		  (setq ucount (1+ ucount))
  		  (set old-count (max (1- (symbol-value old-count)) 0))
  		  (dired-substitute-marker (point) old ?\ ))))
--- 3920,3930 ----
  	    (or (dired-between-files)
  		(looking-at dired-re-dot)
  		(cond
! 		 ((= (char-after (point)) ?\ )
  		  (setq mcount (1+ mcount))
  		  (set old-count (1+ (symbol-value old-count)))
  		  (dired-substitute-marker (point) ?\  old))
! 		 ((= (char-after (point)) old)
  		  (setq ucount (1+ ucount))
  		  (set old-count (max (1- (symbol-value old-count)) 0))
  		  (dired-substitute-marker (point) old ?\ ))))
***************
*** 3967,3976 ****
  	    (if (or no-query
  		    (dired-query 'query "Unmark file `%s'? "
  				 (dired-get-filename t)))
! 		(let ((ent (assq (preceding-char) count)))
  		  (if ent (setcdr ent (1+ (cdr ent))))
  		  (or count-p (dired-substitute-marker
! 			       (- (point) 1) (preceding-char) ?\ ))))
  	    (forward-line 1))
  	(while (search-forward (format "\n%c" flag) nil t)
  	  (if (or no-query
--- 3967,3976 ----
  	    (if (or no-query
  		    (dired-query 'query "Unmark file `%s'? "
  				 (dired-get-filename t)))
! 		(let ((ent (assq (char-before (point)) count)))
  		  (if ent (setcdr ent (1+ (cdr ent))))
  		  (or count-p (dired-substitute-marker
! 			       (- (point) 1) (char-before (point)) ?\ ))))
  	    (forward-line 1))
  	(while (search-forward (format "\n%c" flag) nil t)
  	  (if (or no-query
***************
*** 4025,4037 ****
        ;; Skip subdir line and following garbage like the `total' line:
        (while (and (< (point) end) (dired-between-files))
  	(forward-line 1))
!       (if (and (/= (following-char) char)
  	       (not (looking-at dired-re-dot))
  	       (save-excursion
  		 (dired-move-to-filename nil (point))))
  	  (progn
! 	    (dired-update-marker-counters (following-char) t)
! 	    (dired-substitute-marker (point) (following-char) char)
  	    (dired-update-marker-counters char)))
        (forward-line 1)))
    (dired-update-mode-line-modified))
--- 4025,4037 ----
        ;; Skip subdir line and following garbage like the `total' line:
        (while (and (< (point) end) (dired-between-files))
  	(forward-line 1))
!       (if (and (/= (char-after (point)) char)
  	       (not (looking-at dired-re-dot))
  	       (save-excursion
  		 (dired-move-to-filename nil (point))))
  	  (progn
! 	    (dired-update-marker-counters (char-after (point)) t)
! 	    (dired-substitute-marker (point) (char-after (point)) char)
  	    (dired-update-marker-counters char)))
        (forward-line 1)))
    (dired-update-mode-line-modified))
***************
*** 4043,4049 ****
      (save-excursion
        (goto-char (point-min))
        (while (not (eobp))
! 	(and (not (memq (setq char (following-char)) '(?\  ?\n ?\r)))
  	     (not (memq char result))
  	     (setq result (cons char result)))
  	(forward-line 1)))
--- 4043,4049 ----
      (save-excursion
        (goto-char (point-min))
        (while (not (eobp))
! 	(and (not (memq (setq char (char-after (point))) '(?\  ?\n ?\r)))
  	     (not (memq char result))
  	     (setq result (cons char result)))
  	(forward-line 1)))
***************
*** 4184,4190 ****
       ;; It is less than general to check for ~ here,
       ;; but it's the only way this runs fast enough.
       (and (save-excursion (end-of-line)
! 			  (eq (preceding-char) ?#))
  	  (not (and dired-re-dir (looking-at dired-re-dir)))
  	  (let ((fn (dired-get-filename t t)))
  	    (if fn (auto-save-file-name-p
--- 4184,4190 ----
       ;; It is less than general to check for ~ here,
       ;; but it's the only way this runs fast enough.
       (and (save-excursion (end-of-line)
! 			  (eq (char-before (point)) ?#))
  	  (not (and dired-re-dir (looking-at dired-re-dir)))
  	  (let ((fn (dired-get-filename t t)))
  	    (if fn (auto-save-file-name-p
***************
*** 4558,4565 ****
      (and (dired-goto-file file)
  	 (progn
  	   (skip-chars-backward "^\n\r")
! 	   (and (not (= ?\040 (following-char)))
! 		(following-char))))))
  
  ;; The basic function for half a dozen variations on cp/mv/ln/ln -s.
  (defun dired-create-files (file-creator operation fn-list name-constructor
--- 4558,4565 ----
      (and (dired-goto-file file)
  	 (progn
  	   (skip-chars-backward "^\n\r")
! 	   (and (not (= ?\040 (char-after (point))))
! 		(char-after (point)))))))
  
  ;; The basic function for half a dozen variations on cp/mv/ln/ln -s.
  (defun dired-create-files (file-creator operation fn-list name-constructor
***************
*** 5244,5250 ****
  	     (progn
  	       (beginning-of-line)
  	       (subst-char-in-region (1- (point)) (point) ?\n ?\r)
! 	       (dired-substitute-marker (point) (following-char)
  					dired-kill-marker-char)
  	       (dired-update-marker-counters dired-marker-char t)
  	       t)
--- 5244,5250 ----
  	     (progn
  	       (beginning-of-line)
  	       (subst-char-in-region (1- (point)) (point) ?\n ?\r)
! 	       (dired-substitute-marker (point) (char-after (point))
  					dired-kill-marker-char)
  	       (dired-update-marker-counters dired-marker-char t)
  	       t)
***************
*** 5252,5258 ****
        ;; Beware of extreme apparent save-excursion lossage here.
        (let ((opoint (point)))
  	(skip-chars-backward "^\n\r")
! 	(if (= (preceding-char) ?\n)
  	    (goto-char opoint)
  	  (setq opoint (- opoint (point)))
  	  (beginning-of-line)
--- 5252,5258 ----
        ;; Beware of extreme apparent save-excursion lossage here.
        (let ((opoint (point)))
  	(skip-chars-backward "^\n\r")
! 	(if (= (char-before (point)) ?\n)
  	    (goto-char opoint)
  	  (setq opoint (- opoint (point)))
  	  (beginning-of-line)
***************
*** 5380,5386 ****
        (narrow-to-region beg end)
        (goto-char (point-min))
        (while (search-forward "\r" nil t)
! 	(and (char-equal (following-char) ?\ )
  	     (subst-char-in-region (1- (point)) (point) ?\r ?\n))))))
  
  (defun dired-do-unhide (char &optional fmt marker)
--- 5380,5386 ----
        (narrow-to-region beg end)
        (goto-char (point-min))
        (while (search-forward "\r" nil t)
! 	(and (char-equal (char-after (point)) ?\ )
  	     (subst-char-in-region (1- (point)) (point) ?\r ?\n))))))
  
  (defun dired-do-unhide (char &optional fmt marker)
***************
*** 5450,5456 ****
      (dired-mark-if
       (and
        ;; not already marked
!       (eq (following-char) ?\ )
        ;; uninteresting
        (setq fn (dired-get-filename localp t))
        (string-match regexp fn))
--- 5450,5456 ----
      (dired-mark-if
       (and
        ;; not already marked
!       (eq (char-after (point)) ?\ )
        ;; uninteresting
        (setq fn (dired-get-filename localp t))
        (string-match regexp fn))
***************
*** 5881,5887 ****
  	    (goto-char oentry)
  	    (delete-region (save-excursion
  			     (skip-chars-backward "^\r\n")
! 			     (dired-update-marker-counters (following-char) t)
  			     (1- (point)))
  			   (progn
  			     (skip-chars-forward "^\r\n")
--- 5881,5887 ----
  	    (goto-char oentry)
  	    (delete-region (save-excursion
  			     (skip-chars-backward "^\r\n")
! 			     (dired-update-marker-counters (char-after (point)) t)
  			     (1- (point)))
  			   (progn
  			     (skip-chars-forward "^\r\n")
***************
*** 6021,6030 ****
  		   (let (buffer-read-only)
  		     (delete-region
  		      (progn (skip-chars-backward "^\n\r")
! 			     (or (memq (following-char) '(\n \r ?\ ))
  				 (progn
  				   (dired-update-marker-counters
! 				    (following-char) t)
  				   (dired-update-mode-line-modified)))
  			     (1- (point)))
  		      (progn (skip-chars-forward "^\n\r") (point)))
--- 6021,6030 ----
  		   (let (buffer-read-only)
  		     (delete-region
  		      (progn (skip-chars-backward "^\n\r")
! 			     (or (memq (char-after (point)) '(\n \r ?\ ))
  				 (progn
  				   (dired-update-marker-counters
! 				    (char-after (point)) t)
  				   (dired-update-mode-line-modified)))
  			     (1- (point)))
  		      (progn (skip-chars-forward "^\n\r") (point)))
*** efs-cms.el.orig	Sun Jun 15 12:38:32 1997
--- efs-cms.el	Sun Jun 15 12:49:02 1997
***************
*** 440,446 ****
  	(progn
  	  (skip-chars-forward " ")
  	  (skip-chars-forward "-A-Z0-9$_+")))
!     (if (or (= opoint (point)) (/= (following-char) ?\ ))
  	(if no-error
  	    nil
  	  (error "No file on this line"))
--- 440,446 ----
  	(progn
  	  (skip-chars-forward " ")
  	  (skip-chars-forward "-A-Z0-9$_+")))
!     (if (or (= opoint (point)) (/= (char-after (point)) ?\ ))
  	(if no-error
  	    nil
  	  (error "No file on this line"))
*** efs-dired.el.orig	Sun Jun 15 12:39:25 1997
--- efs-dired.el	Sun Jun 15 12:49:13 1997
***************
*** 175,181 ****
  	(while (and (not (eobp)) continue)
  	  (and (setq bol (point)
  		     spot (dired-manual-move-to-filename nil bol))
! 	       (setq continue (= (following-char) ?/))
  	       (dired-manual-move-to-end-of-filename t bol)
  	       (progn
  		 (skip-chars-backward "^/")
--- 175,181 ----
  	(while (and (not (eobp)) continue)
  	  (and (setq bol (point)
  		     spot (dired-manual-move-to-filename nil bol))
! 	       (setq continue (= (char-after (point)) ?/))
  	       (dired-manual-move-to-end-of-filename t bol)
  	       (progn
  		 (skip-chars-backward "^/")
*** efs-dl.el.orig	Sun Jun 15 12:39:38 1997
--- efs-dl.el	Sun Jun 15 12:49:22 1997
***************
*** 56,62 ****
  			       (progn
  				 (skip-chars-forward "^ /\n")
  				 (point)))
! 	     (list (eq (following-char) ?/))
  	     tbl)
  	    (forward-line 1))
  	  (efs-put-hash-entry "." '(t) tbl)
--- 56,62 ----
  			       (progn
  				 (skip-chars-forward "^ /\n")
  				 (point)))
! 	     (list (eq (char-after (point)) ?/))
  	     tbl)
  	    (forward-line 1))
  	  (efs-put-hash-entry "." '(t) tbl)
***************
*** 120,126 ****
  	     "File line is omitted. Type \\[dired-omit-toggle] to un-omit."
  	     )))))
      (skip-chars-forward "^ /\r\n\t")
!     (if (or (= opoint (point)) (not (memq (following-char) '(?\  ?/))))
  	(if no-error
  	    nil
  	  (error "No file on this line"))
--- 120,126 ----
  	     "File line is omitted. Type \\[dired-omit-toggle] to un-omit."
  	     )))))
      (skip-chars-forward "^ /\r\n\t")
!     (if (or (= opoint (point)) (not (memq (char-after (point)) '(?\  ?/))))
  	(if no-error
  	    nil
  	  (error "No file on this line"))
*** efs-dos-distinct.el.orig	Sun Jun 15 12:39:51 1997
--- efs-dos-distinct.el	Sun Jun 15 12:49:29 1997
***************
*** 59,65 ****
  	      dir-p)
  	(beginning-of-line)
  	(while (progn
! 		 (setq dir-p (eq (following-char) ?d)) ; we're bolp
  		 (re-search-forward
  		  efs-dos-distinct-date-and-time-regexp nil t))
  	  (efs-put-hash-entry (buffer-substring (point)
--- 59,65 ----
  	      dir-p)
  	(beginning-of-line)
  	(while (progn
! 		 (setq dir-p (eq (char-after (point)) ?d)) ; we're bolp
  		 (re-search-forward
  		  efs-dos-distinct-date-and-time-regexp nil t))
  	  (efs-put-hash-entry (buffer-substring (point)
***************
*** 143,149 ****
  	     "File line is omitted. Type \\[dired-omit-toggle] to un-omit."
  	     )))))
      (skip-chars-forward "-_+=a-z0-9.$")
!     (if (or (= opoint (point)) (not (memq (following-char) '(\n \r))))
  	(if no-error
  	    nil
  	  (error "No file on this line"))
--- 143,149 ----
  	     "File line is omitted. Type \\[dired-omit-toggle] to un-omit."
  	     )))))
      (skip-chars-forward "-_+=a-z0-9.$")
!     (if (or (= opoint (point)) (not (memq (char-after (point)) '(\n \r))))
  	(if no-error
  	    nil
  	  (error "No file on this line"))
*** efs-guardian.el.orig	Sun Jun 15 12:40:02 1997
--- efs-guardian.el	Sun Jun 15 12:50:02 1997
***************
*** 219,229 ****
  	  (substitute-command-keys
  	   "File line is omitted. Type \\[dired-omit-toggle] to un-omit.")))))
    (if (and
!        (>= (following-char) ?A)
!        (<= (following-char) ?Z)
         (progn
  	 (skip-chars-forward "A-Z0-9")
! 	 (= (following-char) ?\ )))
        (point)
      (and (null no-error)
  	 (error "No file on this line"))))
--- 219,229 ----
  	  (substitute-command-keys
  	   "File line is omitted. Type \\[dired-omit-toggle] to un-omit.")))))
    (if (and
!        (>= (char-after (point)) ?A)
!        (<= (char-after (point)) ?Z)
         (progn
  	 (skip-chars-forward "A-Z0-9")
! 	 (= (char-after (point)) ?\ )))
        (point)
      (and (null no-error)
  	 (error "No file on this line"))))
*** efs-hell.el.orig	Sun Jun 15 12:40:12 1997
--- efs-hell.el	Sun Jun 15 12:50:11 1997
***************
*** 67,73 ****
    ;; of a hellsoft listing. Assumes that the point is at the beginning
    ;; of the line.
    (` (let ((eol (save-excursion (end-of-line) (point)))
! 	   (dir-p (= (following-char) ?d)))
         (if (re-search-forward efs-hell-date-and-time-regexp eol t)
  	   (list (buffer-substring (point) (progn (end-of-line) (point)))
  		 dir-p
--- 67,73 ----
    ;; of a hellsoft listing. Assumes that the point is at the beginning
    ;; of the line.
    (` (let ((eol (save-excursion (end-of-line) (point)))
! 	   (dir-p (= (char-after (point)) ?d)))
         (if (re-search-forward efs-hell-date-and-time-regexp eol t)
  	   (list (buffer-substring (point) (progn (end-of-line) (point)))
  		 dir-p
***************
*** 170,176 ****
  	     "File line is omitted. Type \\[dired-omit-toggle] to un-omit."
  	     )))))
      (skip-chars-forward "-_+=a-zA-Z0-9.$~")
!     (if (or (= opoint (point)) (not (memq (following-char) '(?\n ?\r))))
  	(if no-error
  	    nil
  	  (error "No file on this line"))
--- 170,176 ----
  	     "File line is omitted. Type \\[dired-omit-toggle] to un-omit."
  	     )))))
      (skip-chars-forward "-_+=a-zA-Z0-9.$~")
!     (if (or (= opoint (point)) (not (memq (char-after (point)) '(?\n ?\r))))
  	(if no-error
  	    nil
  	  (error "No file on this line"))
*** efs-ka9q.el.orig	Sun Jun 15 12:40:28 1997
--- efs-ka9q.el	Sun Jun 15 12:50:42 1997
***************
*** 83,89 ****
  	    (goto-char (point-min))
  	    (while (re-search-forward efs-ka9q-date-regexp nil t)
  	      (goto-char (match-beginning 0))
! 	      (if (setq dir-p (eq (preceding-char) ?/))
  		  (forward-char -1))
  	      (setq file (buffer-substring (point)
  					   (progn (skip-chars-backward "^ \n")
--- 83,89 ----
  	    (goto-char (point-min))
  	    (while (re-search-forward efs-ka9q-date-regexp nil t)
  	      (goto-char (match-beginning 0))
! 	      (if (setq dir-p (eq (char-before (point)) ?/))
  		  (forward-char -1))
  	      (setq file (buffer-substring (point)
  					   (progn (skip-chars-backward "^ \n")
***************
*** 181,187 ****
  	     "File line is omitted. Type \\[dired-omit-toggle] to un-omit."
  	     )))))
      (skip-chars-forward "^ \n\r/")
!     (if (or (= opoint (point)) (not (memq (following-char) '(?/ ?\ ))))
  	(if no-error
  	    nil
  	  (error "No file on this line"))
--- 181,187 ----
  	     "File line is omitted. Type \\[dired-omit-toggle] to un-omit."
  	     )))))
      (skip-chars-forward "^ \n\r/")
!     (if (or (= opoint (point)) (not (memq (char-after (point)) '(?/ ?\ ))))
  	(if no-error
  	    nil
  	  (error "No file on this line"))
*** efs-mpe.el.orig	Sun Jun 15 12:40:47 1997
--- efs-mpe.el	Sun Jun 15 12:50:55 1997
***************
*** 599,605 ****
  	     "File line is omitted. Type \\[dired-omit-toggle] to un-omit."
  	     )))))
      (skip-chars-forward "A-Z0-9")
!     (if (or (= opoint (point)) (not (memq (following-char) '(?\  ?*))))
  	(if no-error
  	    nil
  	  (error "No file on this line"))
--- 599,605 ----
  	     "File line is omitted. Type \\[dired-omit-toggle] to un-omit."
  	     )))))
      (skip-chars-forward "A-Z0-9")
!     (if (or (= opoint (point)) (not (memq (char-after (point)) '(?\  ?*))))
  	(if no-error
  	    nil
  	  (error "No file on this line"))
*** efs-ms-unix.el.orig	Sun Jun 15 12:40:59 1997
--- efs-ms-unix.el	Sun Jun 15 12:51:03 1997
***************
*** 1,4 ****
! ;; -*-Emacs-Lisp-*-
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;;
  ;; File:         efs-ms-unix.el
--- 1,4 ----
! !;; -*-Emacs-Lisp-*-
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;;
  ;; File:         efs-ms-unix.el
***************
*** 158,164 ****
  	      nil
  	    (error "No file on this line")))
        (end-of-line)
!       (if (char-equal (preceding-char) ?/)
  	  (forward-char -1))
        (point))))
  
--- 158,164 ----
  	      nil
  	    (error "No file on this line")))
        (end-of-line)
!       (if (char-equal (char-before (point)) ?/)
  	  (forward-char -1))
        (point))))
  
*** efs-mts.el.orig	Sun Jun 15 12:41:12 1997
--- efs-mts.el	Sun Jun 15 12:51:14 1997
***************
*** 208,214 ****
  	     "File line is omitted. Type \\[dired-omit-toggle] to un-omit."
  	     )))))
      (skip-chars-forward "-A-Z0-9._!")
!     (if (or (= opoint (point)) (not (memq (following-char) '(?\r ?\n))))
  	(if no-error
  	    nil
  	  (error "No file on this line"))
--- 208,214 ----
  	     "File line is omitted. Type \\[dired-omit-toggle] to un-omit."
  	     )))))
      (skip-chars-forward "-A-Z0-9._!")
!     (if (or (= opoint (point)) (not (memq (char-after (point)) '(?\r ?\n))))
  	(if no-error
  	    nil
  	  (error "No file on this line"))
*** efs-mvs.el.orig	Sun Jun 15 12:41:24 1997
--- efs-mvs.el	Sun Jun 15 12:51:19 1997
***************
*** 226,232 ****
  	     "File line is omitted. Type \\[dired-omit-toggle] to un-omit."
  	     )))))
      (skip-chars-forward "-A-Z0-9$_.+" eol)
!     (if (or (= opoint (point)) (not (memq (following-char) '(?\n ?\r ?\ ))))
  	(if no-error
  	    nil
  	  (error "No file on this line"))
--- 226,232 ----
  	     "File line is omitted. Type \\[dired-omit-toggle] to un-omit."
  	     )))))
      (skip-chars-forward "-A-Z0-9$_.+" eol)
!     (if (or (= opoint (point)) (not (memq (char-after (point)) '(?\n ?\r ?\ ))))
  	(if no-error
  	    nil
  	  (error "No file on this line"))
***************
*** 320,326 ****
  	     (progn
  	       (goto-char eol)
  	       (skip-chars-backward "-A-Z0-9$_.")
! 	       (char-equal (preceding-char) ?\ ))
  	     (/= eol (point)))
  	(point)
        (goto-char bol)
--- 320,326 ----
  	     (progn
  	       (goto-char eol)
  	       (skip-chars-backward "-A-Z0-9$_.")
! 	       (char-equal (char-before (point)) ?\ ))
  	     (/= eol (point)))
  	(point)
        (goto-char bol)
***************
*** 352,358 ****
  	     "File line is omitted. Type \\[dired-omit-toggle] to un-omit."
  	     )))))
      (skip-chars-forward "-A-Z0-9$_.+" eol)
!     (if (or (= opoint (point)) (not (memq (following-char) '(?\n ?\r ?\ ))))
  	(if no-error
  	    nil
  	  (error "No file on this line"))
--- 352,358 ----
  	     "File line is omitted. Type \\[dired-omit-toggle] to un-omit."
  	     )))))
      (skip-chars-forward "-A-Z0-9$_.+" eol)
!     (if (or (= opoint (point)) (not (memq (char-after (point)) '(?\n ?\r ?\ ))))
  	(if no-error
  	    nil
  	  (error "No file on this line"))
*** efs-netrc.el.orig	Sun Jun 15 12:41:38 1997
--- efs-netrc.el	Sun Jun 15 12:51:34 1997
***************
*** 110,116 ****
    ;; Gets the next token plus it's value.
    ;; Returns \(token value-1 value-2 ...\)
    (skip-chars-forward " \t\n")
!   (while (char-equal  (following-char) ?#)
      (forward-line 1)
      (skip-chars-forward " \t\n"))
    (let ((tok (and (not (eobp))
--- 110,116 ----
    ;; Gets the next token plus it's value.
    ;; Returns \(token value-1 value-2 ...\)
    (skip-chars-forward " \t\n")
!   (while (char-equal  (char-after (point)) ?#)
      (forward-line 1)
      (skip-chars-forward " \t\n"))
    (let ((tok (and (not (eobp))
***************
*** 146,155 ****
  (defun efs-netrc-read-token-value ()
    ;; Read the following word as a token value.
    (skip-chars-forward " \t\n")
!   (while (char-equal (following-char) ?#)
      (forward-line 1)
      (skip-chars-forward " \t\n"))
!   (if (eq (following-char) ?\")	;quoted token value
        (prog2
         (forward-char 1)
         (buffer-substring (point)
--- 146,155 ----
  (defun efs-netrc-read-token-value ()
    ;; Read the following word as a token value.
    (skip-chars-forward " \t\n")
!   (while (char-equal (char-after (point)) ?#)
      (forward-line 1)
      (skip-chars-forward " \t\n"))
!   (if (eq (char-after (point)) ?\")	;quoted token value
        (prog2
         (forward-char 1)
         (buffer-substring (point)
*** efs-netware.el.orig	Sun Jun 15 12:41:57 1997
--- efs-netware.el	Sun Jun 15 12:51:42 1997
***************
*** 79,85 ****
  	       (let ((tbl (efs-make-hashtable))
  		     dir-p file size)
  		 (while (let ((eol (save-excursion (end-of-line) (point))))
! 			  (setq dir-p (= (following-char) ?d))
  			  (re-search-forward efs-netware-date-regexp eol t))
  		   (setq file (buffer-substring (point)
  						(progn (end-of-line) (point)))
--- 79,85 ----
  	       (let ((tbl (efs-make-hashtable))
  		     dir-p file size)
  		 (while (let ((eol (save-excursion (end-of-line) (point))))
! 			  (setq dir-p (= (char-after (point)) ?d))
  			  (re-search-forward efs-netware-date-regexp eol t))
  		   (setq file (buffer-substring (point)
  						(progn (end-of-line) (point)))
***************
*** 158,164 ****
  	     "File line is omitted. Type \\[dired-omit-toggle] to un-omit."
  	     )))))
      (skip-chars-forward "^A-Z\n\r")
!     (if (or (= opoint (point)) (not (memq (following-char) '(?\n ?\r ?\ ))))
  	(if no-error
  	    nil
  	  (error "No file on this line"))
--- 158,164 ----
  	     "File line is omitted. Type \\[dired-omit-toggle] to un-omit."
  	     )))))
      (skip-chars-forward "^A-Z\n\r")
!     (if (or (= opoint (point)) (not (memq (char-after (point)) '(?\n ?\r ?\ ))))
  	(if no-error
  	    nil
  	  (error "No file on this line"))
*** efs-nos-ve.el.orig	Sun Jun 15 12:42:09 1997
--- efs-nos-ve.el	Sun Jun 15 12:51:49 1997
***************
*** 200,206 ****
  	     "File line is omitted. Type \\[dired-omit-toggle] to un-omit."
  	     )))))
      (skip-chars-forward "_a-z0-9$@#\\\\[]{}|") ; right char set?
!     (if (or (= opoint (point)) (/= (following-char) ?\ ))
  	(if no-error
  	    nil
  	  (error "No file on this line"))
--- 200,206 ----
  	     "File line is omitted. Type \\[dired-omit-toggle] to un-omit."
  	     )))))
      (skip-chars-forward "_a-z0-9$@#\\\\[]{}|") ; right char set?
!     (if (or (= opoint (point)) (/= (char-after (point)) ?\ ))
  	(if no-error
  	    nil
  	  (error "No file on this line"))
*** efs-pc.el.orig	Sun Jun 15 12:42:22 1997
--- efs-pc.el	Sun Jun 15 12:51:58 1997
***************
*** 804,810 ****
  		      dirp (save-excursion
  			     (beginning-of-line)
  			     (skip-chars-forward " ")
! 			     (char-equal (following-char) ?d)))
  		(efs-put-hash-entry
  		 (buffer-substring (point) (progn (end-of-line) (point)))
  		 (list dirp size) tbl)
--- 804,810 ----
  		      dirp (save-excursion
  			     (beginning-of-line)
  			     (skip-chars-forward " ")
! 			     (char-equal (char-after (point)) ?d)))
  		(efs-put-hash-entry
  		 (buffer-substring (point) (progn (end-of-line) (point)))
  		 (list dirp size) tbl)
*** efs-tops-20.el.orig	Sun Jun 15 12:42:33 1997
--- efs-tops-20.el	Sun Jun 15 12:52:08 1997
***************
*** 324,330 ****
  	     )))))
      ;; Is this the right character set?
      (skip-chars-forward "-_A-Z0-9$.;")
!     (if (or (= opoint (point)) (not (memq (following-char) '(?\n ?\r))))
  	(if no-error
  	      nil
  	  (error "No file on this line"))
--- 324,330 ----
  	     )))))
      ;; Is this the right character set?
      (skip-chars-forward "-_A-Z0-9$.;")
!     (if (or (= opoint (point)) (not (memq (char-after (point)) '(?\n ?\r))))
  	(if no-error
  	      nil
  	  (error "No file on this line"))
*** efs-vms.el.orig	Sun Jun 15 12:42:43 1997
--- efs-vms.el	Sun Jun 15 12:52:15 1997
***************
*** 1,342 ****
  ;; -*-Emacs-Lisp-*-
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;;
! ;; File:         efs-vm.el
  ;; Release:      $efs release: 1.15 $
! ;; Version:      #Revision: 1.1 $
  ;; RCS:          
! ;; Description:  Allows the VM  mail reader to access folders using efs.
! ;;               If you are looking for support for VM/CMS, see efs-cms.el.
! ;; Author:       Sandy Rutherford <sandy@ibm550.sissa.it>
! ;; Created:      Mon Nov  9 23:49:18 1992 by sandy on riemann
! ;; Modified:     Sun Nov 27 18:44:07 1994 by sandy on gandalf
! ;; 
! ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
! 
! ;; If vm-get-new-mail (usually bound to "g") is given a prefix, it
! ;; will prompt for a folder from which to collect mail. With
! ;; efs-vm, this folder can be in efs syntax. As is usual
! ;; with VM, this folder will not be deleted. If at the folder prompt,
! ;; you give "/user@host:", efs-vm will collect mail from the
! ;; spool file on the remote machine. The spool file will be deleted if
! ;; the mail is successfully collected. It is not necessary for
! ;; movemail, nor even emacs, to be installed on the remote machine.
! ;; The functionality of movemail is mimicked with FTP commands. Both
! ;; local and remote crashboxes are used, so that mail will not be lost
! ;; if the FTP connection is lost.
! ;;
! ;; To use efs-vm, put (require 'efs-vm) in your .vm file.
! ;;
! ;; Works for vm 5.56 through 5.72.  May not work with older versions.
! ;; If vm grows some file-name-handler-alist support, we should use it.
! ;; Actually it has.  I just haven't gotten around to this yet.
! 
! ;;; Known Bugs:
  ;;
! ;;  1. efs-vm will not be able to collect mail from a spool file if
! ;;     you do not have write permission in the spool directory.
! ;;     I think that this precludes HP-UX.
! ;;     I hope to do something about this.
! ;;
! ;;  2. efs-vm is as clever as at can be about spool file locking.
! ;;     i.e. not very clever at all.  At least it uses a rename command
! ;;     to minimize the window for problems.  Use POP if you want to
! ;;     be careful.
! ;;
! 
! ;;; Provisions, requirements, and autoloads
! 
! (provide 'efs-vm)
! (require 'efs-cu)
! (require 'efs-ovwrt)
! (require 'vm)
! ;(require 'vm-folder) ; not provided
! (if (or (not (fboundp 'vm-get-new-mail))
! 	(eq (car-safe (symbol-function 'vm-get-new-mail)) 'autoload))
!     (load-library "vm-folder"))
! (autoload 'efs-make-tmp-name "efs")
! (autoload 'efs-del-tmp-name "efs")
! (autoload 'efs-send-cmd "efs")
! (autoload 'efs-re-read-dir "efs")
! (autoload 'efs-copy-file-internal "efs")
! 
! ;;; User variables
! 
! (defvar efs-vm-spool-files nil
!   "Association list of \( USER@MACHINE . SPOOLFILES \) pairs that
! specify the location of the default remote spool file for MACHINE. SPOOLFILES
! is a list of remote spool files.")
  
! (defvar efs-vm-crash-box "~/EFS.INBOX.CRASH"
!   "Local file where efs keeps its local crash boxes.")
  
! ;;; Internal variables
  
! (defconst efs-vm-version
    (concat (substring "$efs release: 1.15 $" 14 -2)
  	  "/"
! 	  (substring "#Revision: 1.1 $" 11 -2)))
! 
  
! (defun efs-vm-get-new-mail (&optional arg)
!   "Documented as original"
!   (interactive "P")
!   (vm-select-folder-buffer)
!   (vm-check-for-killed-summary)
!   (vm-error-if-virtual-folder)
!   (vm-error-if-folder-read-only)
!   (cond
!    ((null arg)
!     (if (not (eq major-mode 'vm-mode))
! 	(vm-mode))
!     (if (consp (car (vm-spool-files)))
! 	(message "Checking for new mail for %s..." buffer-file-name)
!       (message "Checking for new mail..."))
!     (let (new-messages totals-blurb)
!       (if (and (vm-get-spooled-mail)
! 	       (setq new-messages (vm-assimilate-new-messages t)))
! 	  (progn
! 	    (if vm-arrived-message-hook
! 		(while new-messages
! 		  (vm-run-message-hook (car new-messages)
! 				       'vm-arrived-message-hook)
! 		  (setq new-messages (cdr new-messages))))
! 	    ;; say this NOW, before the non-previewers read
! 	    ;; a message, alter the new message count and
! 	    ;; confuse themselves.
! 	    (setq totals-blurb (vm-emit-totals-blurb))
! 	    (vm-display nil nil '(vm-get-new-mail) '(vm-get-new-mail))
! 	    (if (vm-thoughtfully-select-message)
! 		(vm-preview-current-message)
! 	      (vm-update-summary-and-mode-line))
! 	    (message totals-blurb))
! 	(if (consp (car (vm-spool-files)))
! 	    (message "No new mail for %s" buffer-file-name)
! 	  (message "No new mail."))
! 	(sit-for 4)
! 	(message ""))))
!    (t
!     (let* ((buffer-read-only nil)
! 	   (folder (read-file-name "Gather mail from folder: "
! 				   vm-folder-directory t))
! 	   (parsed (efs-ftp-path folder))
! 	   mcount new-messages totals-blurb)
!       (if parsed
! 	  (if (string-equal (nth 2 parsed) "")
! 	      ;; a spool file
! 	      (if (not (and (efs-vm-get-remote-spooled-mail folder)
! 			    (setq new-messages
! 				  (vm-assimilate-new-messages t))))
! 		  (progn
! 		    (message
! 		     "No new mail, or mail couldn't be retrieved by ftp.")
! 		    ;; don't let this message stay up forever...
! 		    (sit-for 4)
! 		    (message ""))
! 		(if vm-arrived-message-hook
! 		    (while new-messages
! 		      (vm-run-message-hook (car new-messages)
! 					   'vm-arrived-message-hook)
! 		      (setq new-messages (cdr new-messages))))
! 		;; say this NOW, before the non-previewers read
! 		;; a message, alter the new message count and
! 		;; confuse themselves.
! 		(setq totals-blurb (vm-emit-totals-blurb))
! 		(vm-display nil nil '(vm-get-new-mail) '(vm-get-new-mail))
! 		(if (vm-thoughtfully-select-message)
! 		    (vm-preview-current-message)
! 		  (vm-update-summary-and-mode-line))
! 		(message totals-blurb))
! 	    
! 	    ;; a remote folder
! 	    (let ((tmp-file (car (efs-make-tmp-name nil (car parsed))))
! 		  (folder (expand-file-name folder)))
! 	      (unwind-protect
! 		  (progn
! 		    (efs-copy-file-internal
! 		     folder parsed tmp-file nil t nil
! 		     (format "Getting %s" folder)
! 		     ;; asynch worries me here
! 		     nil nil)
! 		    (if (and vm-check-folder-types
! 			     (not (vm-compatible-folder-p tmp-file)))
! 			(error
! 			 "Folder %s is not the same format as this folder."
! 			 folder))
! 		    (save-excursion
! 		      (vm-save-restriction
! 		       (widen)
! 		       (goto-char (point-max))
! 		       (insert-file-contents tmp-file)))
! 		    (setq mcount (length vm-message-list))
! 		    (if (setq new-messages (vm-assimilate-new-messages))
! 			(progn
! 			  (if vm-arrived-message-hook
! 			      (while new-messages
! 				(vm-run-message-hook (car new-messages)
! 						     'vm-arrived-message-hook)
! 				(setq new-messages (cdr new-messages))))
! 			  ;; say this NOW, before the non-previewers read
! 			  ;; a message, alter the new message count and
! 			  ;; confuse themselves.
! 			  (setq totals-blurb (vm-emit-totals-blurb))
! 			  (vm-display nil nil '(vm-get-new-mail)
! 				      '(vm-get-new-mail))
! 			  (if (vm-thoughtfully-select-message)
! 			      (vm-preview-current-message)
! 			    (vm-update-summary-and-mode-line))
! 			  (message totals-blurb)
! 			  ;; The gathered messages are actually still on disk
! 			  ;; unless the user deletes the folder himself.
! 			  ;; However, users may not understand what happened if
! 			  ;; the messages go away after a "quit, no save".
! 			  (setq vm-messages-not-on-disk
! 				(+ vm-messages-not-on-disk
! 				   (- (length vm-message-list)
! 				      mcount))))
! 		      (message "No messages gathered."))
! 		    (efs-del-tmp-name tmp-file)))))
! 
! 	;; local
! 	
! 	(if (and vm-check-folder-types
! 		 (not (vm-compatible-folder-p folder)))
! 	    (error "Folder %s is not the same format as this folder."
! 		   folder))
! 	(save-excursion
! 	  (vm-save-restriction
! 	   (widen)
! 	   (goto-char (point-max))
! 	   (insert-file-contents folder)))
! 	(setq mcount (length vm-message-list))
! 	(if (setq new-messages (vm-assimilate-new-messages))
! 	    (progn
! 	      (if vm-arrived-message-hook
! 		  (while new-messages
! 		       (vm-run-message-hook (car new-messages)
! 					    'vm-arrived-message-hook)
! 		       (setq new-messages (cdr new-messages))))
! 	      ;; say this NOW, before the non-previewers read
! 	      ;; a message, alter the new message count and
! 	      ;; confuse themselves.
! 	      (setq totals-blurb (vm-emit-totals-blurb))
! 	      (vm-display nil nil '(vm-get-new-mail) '(vm-get-new-mail))
! 	      (if (vm-thoughtfully-select-message)
! 		  (vm-preview-current-message)
! 		(vm-update-summary-and-mode-line))
! 	      (message totals-blurb)
! 	      ;; The gathered messages are actually still on disk
! 	      ;; unless the user deletes the folder himself.
! 	      ;; However, users may not understand what happened if
! 	      ;; the messages go away after a "quit, no save".
! 	      (setq vm-messages-not-on-disk
! 		       (+ vm-messages-not-on-disk
! 			  (- (length vm-message-list)
! 			     mcount))))
! 	  (message "No messages gathered.")))))))
! 
! (defun efs-vm-gobble-remote-crash-box (remote-crash-box)
!   (let ((remote-crash-box (expand-file-name remote-crash-box))
! 	(crash-box (expand-file-name efs-vm-crash-box))
! 	lsize)
!     (if (file-exists-p vm-crash-box)
  	(progn
! 	  ;; This should never happen, but let's make sure that we never
! 	  ;; clobber mail.
! 	  (message "Recovering messages from local crash box...")
! 	  (vm-gobble-crash-box efs-vm-crash-box)
! 	  (message "Recovering messages from local crash box... done")))
!     (efs-copy-file-internal remote-crash-box (efs-ftp-path remote-crash-box)
! 			    crash-box nil nil nil
! 			    (format "Getting %s" remote-crash-box)
! 			    ;; asynch worries me here
! 			    nil nil)
!     ;; only delete the remote crash box if we are sure that we have everything
!     (if (and (setq lsize (nth 7 (file-attributes crash-box)))
! 	     (eq lsize (nth 7 (file-attributes remote-crash-box)))
! 	     (vm-compatible-folder-p crash-box))
! 	(progn
! 	  (vm-gobble-crash-box crash-box)
! 	  (delete-file remote-crash-box))
!       ;; don't leave garbage in the local crash box
!       (condition-case () (delete-file crash-box) (error nil))
!       (error "Problem reading remote crash box %s" remote-crash-box))))
! 
! (defun efs-vm-get-remote-spooled-mail (remote-path)
!   ;; remote-path is usually of the form /user@machine:
!   ;; Usually vm sets inhibit-quit to t for this. This is probably
!   ;; a bad idea if there is ftp activity.
!   ;; I don't want to assume that the remote machine has movemail.
!   ;; Try to mimic movemail with ftp commands as best as possible.
!   ;; For this to work, we need to be able to create a subdirectory
!   ;; in the spool directory.
!   (if vm-block-new-mail
!     (error "Can't get new mail until you save this folder."))
!   (let* ((parsed (efs-ftp-path remote-path))
! 	 (host (car parsed))
! 	 (user (nth 1 parsed))
! 	 (spool-files
! 	  (or (cdr (assoc (concat user "@" host)
! 			  efs-vm-spool-files))
! 	      (list (concat "/usr/spool/mail/" user))))
! 	 got-mail)
!     (while spool-files
!       (let* ((s-file (car spool-files))
! 	     (spool-file (format efs-path-format-string user host s-file))
! 	     ;; rmdir and mkdir bomb if this path ends in a /.
! 	     (c-dir (concat s-file ".CRASHBOX"))
! 	     (rc-file (concat c-dir "/CRASHBOX"))
! 	     (crash-dir (concat spool-file ".CRASHBOX/"))
! 	     (remote-crash-file (concat crash-dir "CRASHBOX"))
! 	     (crash-box (expand-file-name efs-vm-crash-box)))
! 	(if (file-exists-p crash-box)
! 	    (progn
! 	      (message "Recovering messages from crash box...")
! 	      (vm-gobble-crash-box crash-box)
! 		 (message "Recovering messages from crash box... done")
! 		 (setq got-mail t)))
! 	(if (let ((efs-allow-child-lookup nil))
! 	      (file-exists-p remote-crash-file))
! 	    (progn
! 	      (message "Recovering messages from remote crash box...")
! 	    (efs-vm-gobble-remote-crash-box remote-crash-file)
! 	    (message "Recovering messages from remote crash box... done")
! 	    (setq got-mail t)))
! 	(if (file-exists-p crash-box)
! 	    (progn
! 	      (message "Recovering messages from crash box...")
! 	      (vm-gobble-crash-box crash-box)
! 	      (message "Recovering messages from crash box... done")
! 	      (setq got-mail t)))
! 	(unwind-protect
! 	    (if (car
! 		 (efs-send-cmd
! 		  host user (list 'mkdir c-dir)
! 		  (format "Making crash directory %s" crash-dir)))
  		(progn
! 		  (efs-re-read-dir crash-dir)
! 		  (message "Unable to make crash directory %s" crash-dir)
! 		  (ding))
! 	      (or (car
! 		   (efs-send-cmd host user (list 'rename s-file rc-file)
! 				 (format "Checking spool file %s" spool-file)))
! 		  (progn
! 		    (message "Getting new mail from %s..." spool-file)
! 		    ;; The rename above wouldn't have updated the cash.
! 		    (efs-re-read-dir crash-dir)
! 		    (efs-vm-gobble-remote-crash-box remote-crash-file)
! 		    (message "Getting new mail from %s... done" spool-file)
! 		    (setq got-mail t))))
! 	  (condition-case nil
! 	      (efs-send-cmd
! 	       host user (list 'rmdir c-dir)
! 	       "Removing crash directory")
! 	    (error nil))))
!       (setq spool-files (cdr spool-files)))
!     got-mail))
  
! ;;; Overwrite existing functions
! 
! (efs-overwrite-fn "efs" 'vm-get-new-mail)
  
! ;;; end of efs-vm.el
--- 1,760 ----
  ;; -*-Emacs-Lisp-*-
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;;
! ;; File:         efs-vms.el
  ;; Release:      $efs release: 1.15 $
! ;; Version:      #Revision: 1.13 $
  ;; RCS:          
! ;; Description:  VMS support for efs
! ;; Authors:      Andy Norman, Joe Wells, Sandy Rutherford <sandy@itp.ethz.ch>
! ;; Modified:     Sun Nov 27 18:44:59 1994 by sandy on gandalf
  ;;
! ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  
! ;;; This file is part of efs. See efs.el for copyright
! ;;; (it's copylefted) and warrranty (there isn't one) information.
  
! (provide 'efs-vms)
! (require 'efs)
  
! (defconst efs-vms-version
    (concat (substring "$efs release: 1.15 $" 14 -2)
  	  "/"
! 	  (substring "#Revision: 1.13 $" 11 -2)))
  
! ;;;; ------------------------------------------------------------
! ;;;; VMS support.
! ;;;; ------------------------------------------------------------
! 
! ;;; efs has full support for VMS hosts, including tree dired support.  It
! ;;; should be able to automatically recognize any VMS machine. However, if it
! ;;; fails to do this, you can use the command efs-add-vms-host.  As well,
! ;;; you can set the variable efs-vms-host-regexp in your .emacs file. We
! ;;; would be grateful if you would report any failures to automatically
! ;;; recognize a VMS host as a bug.
! ;;;
! ;;; Filename Syntax:
! ;;;
! ;;; For ease of *implementation*, the user enters the VMS filename syntax in a
! ;;; UNIX-y way.  For example:
! ;;;  PUB$:[ANONYMOUS.SDSCPUB.NEXT]README.TXT;1
! ;;; would be entered as:
! ;;;  /PUB$$:/ANONYMOUS/SDSCPUB/NEXT/README.TXT;1
! ;;; i.e. to log in as anonymous on ymir.claremont.edu and grab the file:
! ;;;  [.CSV.POLICY]RULES.MEM
! ;;; you would type:
! ;;;  C-x C-f /anonymous@ymir.claremont.edu:CSV/POLICY/RULES.MEM
! ;;;
! ;;; A legal VMS filename is of the form: FILE.TYPE;##
! ;;; where FILE can be up to 39 characters
! ;;;       TYPE can be up to 39 characters
! ;;;       ## is a version number (an integer between 1 and 32,767)
! ;;; Valid characters in FILE and TYPE are A-Z 0-9 _ - $
! ;;; $ cannot begin a filename, and - cannot be used as the first or last
! ;;; character.
! ;;;
! ;;; Tips:
! ;;; 1. To access the latest version of file under VMS, you use the filename
! ;;;    without the ";" and version number. You should always edit the latest
! ;;;    version of a file. If you want to edit an earlier version, copy it to a
! ;;;    new file first. This has nothing to do with efs, but is simply
! ;;;    good VMS operating practice. Therefore, to edit FILE.TXT;3 (say 3 is
! ;;;    latest version), do C-x C-f /ymir.claremont.edu:FILE.TXT. If you
! ;;;    inadvertently do C-x C-f /ymir.claremont.edu:FILE.TXT;3, you will find
! ;;;    that VMS will not allow you to save the file because it will refuse to
! ;;;    overwrite FILE.TXT;3, but instead will want to create FILE.TXT;4, and
! ;;;    attach the buffer to this file. To get out of this situation, M-x
! ;;;    write-file /ymir.claremont.edu:FILE.TXT will attach the buffer to
! ;;;    latest version of the file. For this reason, in tree dired "f"
! ;;;    (dired-find-file), always loads the file sans version, whereas "v",
! ;;;    (dired-view-file), always loads the explicit version number. The
! ;;;    reasoning being that it reasonable to view old versions of a file, but
! ;;;    not to edit them.
! ;;; 2. EMACS has a feature in which it does environment variable substitution
! ;;;    in filenames. Therefore, to enter a $ in a filename, you must quote it
! ;;;    by typing $$. There is a bug in EMACS, in that it neglects to quote the
! ;;;    $'s in the default directory when it writes it in the minibuffer.  You
! ;;;    must edit the minibuffer to quote the $'s manually. Hopefully, this bug
! ;;;    will be fixed in EMACS 19. If you use Sebastian Kremer's gmhist (V 4.26
! ;;;    or newer), you will not have this problem.
! 
! 
! ;; Because some VMS ftp servers convert filenames to lower case
! ;; we allow a-z in the filename regexp.
! 
! (defconst efs-vms-filename-regexp
!   "\\([_A-Za-z0-9$][-_A-Za-z0-9$]*\\)?\\.\\([-_A-Za-z0-9$]*\\);[0-9]+")
! ;; Regular expression to match for a valid VMS file name in Dired buffer.
! 
! (defvar efs-vms-month-alist
!   '(("JAN" . 1) ("FEB". 2) ("MAR" . 3) ("APR" . 4) ("MAY" . 5) ("JUN" . 6)
!     ("JUL" . 7) ("AUG" . 8) ("SEP" . 9) ("OCT" . 10)
!     ("NOV" . 11) ("DEC" . 12)))
! 
! (defvar efs-vms-date-regexp
!   (concat
!    "\\([0-3]?[0-9]\\)-"
!    "\\(JAN\\|FEB\\|MAR\\|APR\\|MAY\\|JUN\\|"
!    "JUL\\|AUG\\|SEP\\|OCT\\|NOV\\|DEC\\)-"
!    "\\([0-9][0-9][0-9]?[0-9]?\\) \\(\\([0-5][0-9]\\):\\([0-5][0-9]\\)"
!    "\\(:[0-5][0-9]\\)?\\)? "))
! 
! 
! ;;; The following two functions are entry points to this file.
! ;;; They are defined as efs-autoloads in efs.el
! 
! (efs-defun efs-fix-path vms (path &optional reverse)
!   ;; Convert PATH from UNIX-ish to VMS.
!   ;; If REVERSE given then convert from VMS to UNIX-ish.
!   (efs-save-match-data
!     (if reverse
! 	(if (string-match
! 	     "^\\([^:]+:\\)?\\(\\[[^]]+\\]\\)?\\([^][]*\\)$" path)
! 	    (let (drive dir file)
! 	      (if (match-beginning 1)
! 		  (setq drive (substring path
! 					 (match-beginning 1)
! 					 (match-end 1))))
! 	      (if (match-beginning 2)
! 		  (setq dir
! 			(substring path (match-beginning 2) (match-end 2))))
! 	      (if (match-beginning 3)
! 		  (setq file
! 			(substring path (match-beginning 3) (match-end 3))))
! 	      (and dir
! 		   (setq dir (apply (function concat)
! 				    (mapcar (function
! 					     (lambda (char)
! 					       (if (= char ?.)
! 						   (vector ?/)
! 						 (vector char))))
! 					    (substring dir 1 -1)))))
! 	      (concat (and drive
! 			   (concat "/" drive "/"))
! 		      dir (and dir "/")
! 		      file))
! 	  (error "path %s didn't match" path))
!       (let (drive dir file)
! 	(if (string-match "^/[^:/]+:/" path)
! 	    (setq drive (substring path 1 (1- (match-end 0)))
! 		  path (substring path (1- (match-end 0)))))
! 	(setq dir (file-name-directory path)
! 	      file (efs-internal-file-name-nondirectory path))
! 	(if dir
! 	    (let ((len (1- (length dir)))
! 		  (n 0))
! 	      (if (<= len 0)
! 		  (setq dir nil)
! 		(while (<= n len)
! 		  (and (char-equal (aref dir n) ?/)
! 		       (cond
! 			((zerop n) (aset dir n ?\[))
! 			((= n len) (aset dir n ?\]))
! 			(t (aset dir n ?.))))
! 		  (setq n (1+ n))))))
! 	(concat drive dir file)))))
! 
! ;; It is important that this function barf for directories for which we know
! ;; that we cannot possibly get a directory listing, such as "/" and "/DEV:/".
! ;; This is because it saves an unnecessary FTP error, or possibly the listing
! ;; might succeed, but give erroneous info. This last case is particularly
! ;; likely for OS's (like MTS) for which we need to use a wildcard in order
! ;; to list a directory.
! 
! (efs-defun efs-fix-dir-path vms (dir-path)
!   ;; Convert path from UNIX-ish to VMS ready for a DIRectory listing.
!   ;; Should there be entries for .. -> [-] and . -> [] below. Don't
!   ;; think so, because expand-filename should have already short-circuited
!   ;; them.
!   (cond ((string-equal dir-path "/")
! 	 (error "Cannot get listing for fictitious \"/\" directory."))
! 	((string-match "^/[-A-Z0-9_$]+:/$" dir-path)
! 	 (error "Cannot get listing for device."))
! 	((efs-fix-path 'vms dir-path))))
!   
! ;; These parsing functions are as general as possible because the syntax
! ;; of ftp listings from VMS hosts is a bit erratic. What saves us is that
! ;; the VMS filename syntax is so rigid. If they bomb on a listing in the
! ;; standard VMS Multinet format, then this is a bug. If they bomb on a listing
! ;; from vms.weird.net, then too bad.
! 
! (defmacro efs-parse-vms-filename ()
!   "Extract the next filename from a VMS dired-like listing."
!   (` (if (re-search-forward
! 	  efs-vms-filename-regexp
! 	  nil t)
! 	 (buffer-substring (match-beginning 0) (match-end 0)))))
! 
! (defun efs-parse-vms-listing ()
!   ;; Parse the current buffer which is assumed to be a VMS DIR
!   ;; listing (either a short (NLIST) or long listing).
!   ;; Assumes that point is at the beginning of the buffer.
!   (let ((tbl (efs-make-hashtable))
! 	file)
!     (goto-char (point-min))
!     (efs-save-match-data
!       (while (setq file (efs-parse-vms-filename))
! 	(if (string-match "\\.\\(DIR\\|dir\\);[0-9]+" file)
! 	    ;; deal with directories
! 	    (efs-put-hash-entry
! 	     (substring file 0 (match-beginning 0)) '(t) tbl)
! 	  (efs-put-hash-entry file '(nil) tbl)
! 	  (if (string-match ";[0-9]+$" file) ; deal with extension
! 	      ;; sans extension
! 	      (efs-put-hash-entry
! 	       (substring file 0 (match-beginning 0)) '(nil) tbl)))
! 	(forward-line 1))
!       ;; Would like to look for a "Total" line, or a "Directory" line to
!       ;; make sure that the listing isn't complete garbage before putting
!       ;; in "." and "..", but we can't even count on all VAX's giving us
!       ;; either of these.
!       (efs-put-hash-entry "." '(t) tbl)
!       (efs-put-hash-entry ".." '(t) tbl))
!     tbl))
! 
! (efs-defun efs-parse-listing vms
!   (host user dir path &optional switches)
!   ;; Parse the current buffer which is assumed to be a VMS FTP dir
!   ;; format, and return a hashtable as the result. SWITCHES are never used,
!   ;; but they must be specified in the argument list for compatibility
!   ;; with the unix version of this function.
!   ;; HOST = remote host name
!   ;; USER = user name
!   ;; DIR = directory in as a full remote path
!   ;; PATH = directory in full efs path syntax
!   ;; SWITCHES = ls switches (not relevant here)
!   (goto-char (point-min))
!   (efs-save-match-data
!     ;; check for a DIR/FULL monstrosity
!     (if (search-forward "\nSize:" nil t)
  	(progn
! 	  (efs-add-listing-type 'vms:full host user)
! 	  ;; This will cause the buffer to be refilled with an NLIST
! 	  (let ((efs-ls-uncache t))
! 	    (efs-ls path nil (format "Relisting %s"
! 				     (efs-relativize-filename path))
! 		    t))
! 	  (goto-char (point-min))
! 	  (efs-parse-vms-listing))
!       (efs-parse-vms-listing))))
! 
! 
! ;;;; Sorting of listings
! 
! (efs-defun efs-t-converter vms (&optional regexp reverse)
!   (if regexp
!       nil
!     (goto-char (point-min))
!     (efs-save-match-data
!       (if (re-search-forward efs-vms-filename-regexp nil t)
! 	  (let (list-start start end list)
! 	    (beginning-of-line)
! 	    (setq list-start (point))
! 	    (while (and (looking-at efs-vms-filename-regexp)
! 			(progn
! 			  (setq start (point))
! 			  (goto-char (match-end 0))
! 			  (forward-line (if (eolp) 2 1))
! 			  (setq end (point))
! 			  (goto-char (match-end 0))
! 			  (re-search-forward efs-vms-date-regexp nil t)))
! 	      (setq list
! 		    (cons
! 		     (cons
! 		      (nconc
! 		       (list (string-to-int (buffer-substring
! 					     (match-beginning 3)
! 					     (match-end 3))) ; year
! 			     (cdr (assoc
! 				   (buffer-substring (match-beginning 2)
! 						     (match-end 2))
! 				   efs-vms-month-alist)) ; month
! 			     (string-to-int (buffer-substring
! 					     (match-beginning 1)
! 					     (match-end 1)))) ;day
! 		       (if (match-beginning 4)
! 			   (list
! 			    (string-to-int (buffer-substring
! 					    (match-beginning 5)
! 					    (match-end 5))) ; hour
! 			    (string-to-int (buffer-substring
! 					    (match-beginning 6)
! 					    (match-end 6))) ; minute
! 			    (if (match-beginning 7)
! 				(string-to-int (buffer-substring
! 						(1+ (match-beginning 7))
! 						(match-end 7))) ; seconds
! 			      0))
! 			 (list 0 0 0)))
! 		      (buffer-substring start end))
! 		     list))
! 	      (goto-char end))
! 	    (if list
  		(progn
! 		  (setq list
! 			(mapcar 'cdr
! 				(sort list 'efs-vms-t-converter-sort-pred)))
! 		  (if reverse (setq list (nreverse list)))
! 		  (delete-region list-start (point))
! 		  (apply 'insert list)))
! 	    t)))))
! 
! (defun efs-vms-t-converter-sort-pred (elt1 elt2)
!   (let* ((data1 (car elt1))
! 	 (data2 (car elt2))
! 	 (year1 (car data1))
! 	 (year2 (car data2))
! 	 (month1 (nth 1 data1))
! 	 (month2 (nth 1 data2))
! 	 (day1 (nth 2 data1))
! 	 (day2 (nth 2 data2))
! 	 (hour1 (nth 3 data1))
! 	 (hour2 (nth 3 data2))
! 	 (minute1 (nth 4 data1))
! 	 (minute2 (nth 4 data2)))
!     (or (> year1 year2)
! 	(and (= year1 year2)
! 	     (or (> month1 month2)
! 		 (and (= month1 month2)
! 		      (or (> day1 day2)
! 			  (and (= day1 day2)
! 			       (or (> hour1 hour2)
! 				   (and (= hour1 hour2)
! 					(or (> minute1 minute2)
! 					    (and (= minute1 minute2)
! 						 (or (> (nth 5 data1)
! 							(nth 5 data2)))
! 						 ))))))))))))
! 
! 
! (efs-defun efs-X-converter vms (&optional regexp reverse)
!   ;; Sorts by extension
!   (if regexp
!       nil
!     (goto-char (point-min))
!     (efs-save-match-data
!       (if (re-search-forward efs-vms-filename-regexp nil t)
! 	  (let (list-start start list)
! 	    (beginning-of-line)
! 	    (setq list-start (point))
! 	    (while (looking-at efs-vms-filename-regexp)
! 	      (setq start (point))
! 	      (goto-char (match-end 0))
! 	      (forward-line (if (eolp) 2 1))
! 	      (setq list
! 		    (cons
! 		     (cons (buffer-substring (match-beginning 2)
! 					     (match-end 2))
! 			   (buffer-substring start (point)))
! 		     list)))
! 	    (setq list
! 		  (mapcar 'cdr
! 			  (sort list
! 				(if reverse
! 				    (function
! 				     (lambda (x y)
! 					(string< (car y) (car x))))
! 				  (function
! 				   (lambda (x y)
! 				     (string< (car x) (car y))))))))
! 	    (delete-region list-start (point))
! 	    (apply 'insert list)
! 	    t)))))
! 
! ;; This version only deletes file entries which have
! ;; explicit version numbers, because that is all VMS allows.
! 
! (efs-defun efs-delete-file-entry vms (path &optional dir-p)
!   (let ((ignore-case (memq 'vms efs-case-insensitive-host-types)))
!     (if dir-p
! 	(let ((path (file-name-as-directory path))
! 	      files)
! 	  (efs-del-hash-entry path efs-files-hashtable ignore-case)
! 	  (setq path (directory-file-name path)
! 		files (efs-get-hash-entry (file-name-directory path)
! 					       efs-files-hashtable
! 					       ignore-case))
! 	  (if files
! 	      (efs-del-hash-entry (efs-get-file-part path)
! 				       files ignore-case)))
!       (efs-save-match-data
! 	(let ((file (efs-get-file-part path)))
! 	  (if (string-match ";[0-9]+$" file)
! 	      ;; In VMS you can't delete a file without an explicit	
! 	      ;; version number, or wild-card (e.g. FOO;*)
! 	      ;; For now, we give up on wildcards.
! 	      (let ((files (efs-get-hash-entry
! 			    (file-name-directory path)
! 			    efs-files-hashtable ignore-case)))
! 		(if files
! 		    (let ((root (substring file 0
! 					   (match-beginning 0)))
! 			  (completion-ignore-case ignore-case)
! 			  (len (match-beginning 0)))
! 		      (efs-del-hash-entry file files ignore-case)
! 		      ;; Now we need to check if there are any
! 		      ;; versions left. If not, then delete the
! 		      ;; root entry.
! 		      (or (all-completions
! 			   root files
! 			   (function
! 			    (lambda (sym)
! 			      (string-match ";[0-9]+$"
! 					    (symbol-name sym) len))))
! 			  (efs-del-hash-entry root files
! 						   ignore-case)))))))))
!     (efs-del-from-ls-cache path t ignore-case)))
! 
! (efs-defun efs-add-file-entry vms (path dir-p size owner
! 						  &optional modes nlinks mdtm)
!   ;; The vms version of this function needs to keep track
!   ;; of vms's file versions.
!   (let ((ignore-case (memq 'vms efs-case-insensitive-host-types))
! 	(ent (let ((dir-p (null (null dir-p))))
! 	       (if mdtm
! 		   (list dir-p size owner nil nil mdtm)
! 		 (list dir-p size owner)))))
!     (if dir-p
! 	(let* ((path (directory-file-name path))
! 	       (files (efs-get-hash-entry  (file-name-directory path)
! 						efs-files-hashtable
! 						ignore-case)))
! 	  (if files
! 	      (efs-put-hash-entry (efs-get-file-part path)
! 				       ent files ignore-case)))
!       (let ((files (efs-get-hash-entry
! 		    (file-name-directory path)
! 		    efs-files-hashtable ignore-case)))
! 	(if files
! 	    (let ((file (efs-get-file-part path)))
! 	      (efs-save-match-data
! 		;; In VMS files must have an extension. If there isn't
! 		;; one, it will be added.
! 		(or (string-match "^[^;]*\\." file)
! 		    (if (string-match ";" file)
! 			(setq file (concat
! 				    (substring file 0 (match-beginning 0))
! 				    ".;"
! 				    (substring file (match-end 0))))
! 		      (setq file (concat file "."))))
! 		(if (string-match ";[0-9]+$" file)
! 		    (efs-put-hash-entry
! 		     (substring file 0 (match-beginning 0))
! 		     ent files ignore-case)
! 		  ;; Need to figure out what version of the file
! 		  ;; is being added.
! 		  (let* ((completion-ignore-case ignore-case)
! 			 (len (length file))
! 			 (versions (all-completions
! 				    file files
! 				    (function
! 				     (lambda (sym)
! 				       (string-match ";[0-9]+$"
! 						     (symbol-name sym) len)))))
! 			 (N (1+ len))
! 			 (max (apply
! 			       'max
! 			       (cons 0 (mapcar
! 					(function
! 					 (lambda (x)
! 					   (string-to-int (substring x N))))
! 					versions)))))
! 		    ;; No need to worry about case here.
! 		    (efs-put-hash-entry
! 		     (concat file ";" (int-to-string (1+ max))) ent files))))
! 	      (efs-put-hash-entry file ent files ignore-case)))))
!     (efs-del-from-ls-cache path t ignore-case)))
! 
! (efs-defun efs-really-file-p vms (file ent)
!   ;; Returns whether the hash entry FILE with entry ENT is a real file.
!   (or (car ent) ; file-directory-p
!       (efs-save-match-data
! 	(string-match ";" file))))
! 
! (efs-defun efs-internal-file-name-as-directory vms (name)
!   (efs-save-match-data
!     (if (string-match "\\.\\(DIR\\|dir\\)\\(;[0-9]+\\)?$" name)
! 	(setq name (substring name 0 (match-beginning 0))))
!     (let (file-name-handler-alist)
!       (file-name-as-directory name))))
! 
! (efs-defun efs-remote-directory-file-name vms (dir)
!   ;; Returns the VMS filename in unix directory syntax for directory DIR.
!   ;; This is something like /FM/SANDY/FOOBAR.DIR;1
!   (efs-save-match-data
!     (setq dir (directory-file-name dir))
!     (concat dir
! 	    (if (string-match "[a-z]" (nth 2 (efs-ftp-path dir)))
! 		".dir;1"
! 	      ".DIR;1"))))
! 
! (efs-defun efs-allow-child-lookup vms (host user dir file)
!   ;; Returns t if FILE in directory DIR could possibly be a subdir
!   ;; according to its file-name syntax, and therefore a child listing should
!   ;; be attempted.
! 
!   ;; Subdirs in VMS can't have an extension (other than .DIR, which we
!   ;; have truncated).
!   (not (or (string-match "\\." file)
! 	   (and (boundp 'dired-local-variables-file)
! 		(stringp dired-local-variables-file)
! 		(string-equal dired-local-variables-file file)))))
! 
! ;;; Tree dired support:
! 
! ;; For this code I have borrowed liberally from Sebastian Kremer's
! ;; dired-vms.el
! 
! 
! ;; These regexps must be anchored to beginning of line.
! ;; Beware that the ftpd may put the device in front of the filename.
! 
! (defconst efs-dired-vms-re-exe
!   "^. [^ \t.]+\\.\\(EXE\\|exe\\)[; ]")
! 
! (or (assq 'vms efs-dired-re-exe-alist)
!     (setq efs-dired-re-exe-alist
! 	  (cons (cons 'vms  efs-dired-vms-re-exe)
! 		efs-dired-re-exe-alist)))
! 
! (defconst efs-dired-vms-re-dir
!   "^. [^ \t.]+\\.\\(DIR\\|dir\\)[; ]")
! 
! (or (assq 'vms efs-dired-re-dir-alist)
!     (setq efs-dired-re-dir-alist
! 	  (cons (cons 'vms  efs-dired-vms-re-dir)
! 		efs-dired-re-dir-alist)))
! 
! (efs-defun efs-dired-insert-headerline vms (dir)
!   ;; VMS inserts a headerline. I would prefer the headerline
!   ;; to be in efs format. This version tries to
!   ;; be careful, because we can't count on a headerline
!   ;; over ftp, and we wouldn't want to delete anything
!   ;; important.
!   (save-excursion
!     (if (looking-at "^  \\(list \\)?wildcard ")
! 	(forward-line 1))
!     ;; This is really aggressive. Too aggressive?
!     (let ((start (point)))
!       (skip-chars-forward " \t\n")
!       (if (looking-at efs-vms-filename-regexp)
! 	  (beginning-of-line)
! 	(forward-line 1)
! 	(skip-chars-forward " \t\n")
! 	(beginning-of-line))
!       (delete-region start (point)))
!     (insert " \n"))
!   (efs-real-dired-insert-headerline dir))
! 
! (efs-defun efs-dired-fixup-listing vms (file path &optional switches wildcard)
!   ;; Some vms machines list the entire path. Scrape this off.
!   (setq path (efs-fix-path
! 	      'vms
! 	      ;; Need the file-name-directory, in case of widcards.
! 	      ;; Note that path is a `local' path rel. the remote host.
! 	      ;; Lose on wildcards in parent dirs. Fix if somebody complains.
! 	      (let (file-name-handler-alist)
! 		(file-name-directory path))))
!   ;; Some machines put a Node name down too.
!   (let ((regexp (concat "^\\([_A-Za-z0-9][-_A-Za-z0-9]*\\$\\)?"
! 			(regexp-quote path))))
!     (goto-char (point-min))
!     (while (re-search-forward regexp nil t)
!       (delete-region (match-beginning 0) (match-end 0))))
!   ;; Now need to deal with continuation lines.
!   (goto-char (point-min))
!   (let (col start end)
!     (while (re-search-forward
! 	    ";[0-9]+[ \t]*\\(\n[ \t]+\\)[^; \t\n]+[^\n;]*\n" nil t)
!       (setq start (match-beginning 1)
! 	    end (match-end 1))
! 	;; guess at the column dimensions
!       (or col
! 	  (save-excursion
! 	    (goto-char (point-min))
! 	    (if (re-search-forward
! 		 (concat efs-vms-filename-regexp
! 			 "[ \t]+[^ \t\n\r]") nil t)
! 		(setq col (- (goto-char (match-end 0))
! 			     (progn (beginning-of-line) (point))
! 			     1))
! 	      (setq col 0))))
!       ;; join cont. lines.
!       (delete-region start end)
!       (goto-char start)
!       (insert-char ?   (max (- col (current-column)) 2))))
!   ;; Some vms dir listings put a triple null line before the total line.
!   (goto-char (point-min))
!   (skip-chars-forward "\n")
!   (if (search-forward "\n\n\n" nil t)
!       (delete-char -1)))
! 
! (efs-defun efs-dired-manual-move-to-filename vms
!   (&optional raise-error bol eol)
!   ;; In dired, move to first char of filename on this line.
!   ;; Returns position (point) or nil if no filename on this line.
!   ;; This is the VMS version.
!   (or eol (setq eol (save-excursion (skip-chars-forward "^\r\n") (point))))
!   (let (case-fold-search)
!     (if bol
! 	(goto-char bol)
!       (skip-chars-backward "^\n\r"))
!     (if (re-search-forward efs-vms-filename-regexp eol t)
! 	(goto-char (match-beginning 0))
!       (and raise-error (error "No file on this line")))))
! 
! (efs-defun efs-dired-manual-move-to-end-of-filename vms
!   (&optional no-error bol eol)
!   ;; Assumes point is at beginning of filename.
!   ;; So, it should be called only after (dired-move-to-filename t).
!   ;; case-fold-search must be nil, at least for VMS.
!   ;; On failure, signals an error or returns nil.
!   ;; This is the VMS version.
!   (let ((opoint (point)))
!     (and selective-display
! 	 (null no-error)
! 	 (eq (char-after
! 	      (1- (or bol (save-excursion
! 			    (skip-chars-backward "^\r\n")
! 			    (point)))))
! 	     ?\r)
! 	 ;; File is hidden or omitted.
! 	 (cond
! 	  ((dired-subdir-hidden-p (dired-current-directory))
! 	   (error
! 	    (substitute-command-keys
! 	     "File line is hidden. Type \\[dired-hide-subdir] to unhide.")))
! 	  ((error
! 	    (substitute-command-keys
! 	     "File line is omitted. Type \\[dired-omit-toggle] to un-omit."
! 	     )))))
!     (skip-chars-forward "-_A-Za-z0-9$.;")
!     (if (or (= opoint (point)) (not (memq (char-after (point)) '(?\  ?\t ?\n ?\r))))
! 	(if no-error
! 	    nil
! 	    (error "No file on this line"))
!       (point))))
! 
! (efs-defun efs-dired-ls-trim vms ()
!   (goto-char (point-min))
!   (let ((case-fold-search nil))
!     (re-search-forward  efs-vms-filename-regexp))
!   (beginning-of-line)
!   (delete-region (point-min) (point))
!   (forward-line 1)
!   (delete-region (point) (point-max)))
! 
! (efs-defun efs-internal-file-name-sans-versions vms
!   (name &optional keep-backup-version)
!   (efs-save-match-data
!     (if (string-match ";[0-9]+$" name)
! 	(substring name 0 (match-beginning 0))
!       name)))
! 
! (efs-defun efs-dired-collect-file-versions vms ()
!   ;; If it looks like file FN has versions, return a list of the versions.
!   ;; That is a list of strings which are file names.
!   ;; The caller may want to flag some of these files for deletion.
!   (let ((completion-ignore-case (memq 'vms efs-case-insensitive-host-types))
! 	result)
!     (dired-map-dired-file-lines
!      (function
!       (lambda (fn)
! 	(if (string-match ";[0-9]+$" fn)
! 	    (let* ((base-fn (substring fn 0 (match-beginning 0)))
! 		   (base-version (file-name-nondirectory
! 				  (substring fn 0 (1+ (match-beginning 0)))))
! 		   (bv-length (length base-version))
! 		   (possibilities (and
! 				   (null (assoc base-fn result))
! 				   (file-name-all-completions
! 				    base-version
! 				    (file-name-directory fn)))))
! 	      (if possibilities
! 		  (setq result
! 			(cons (cons base-fn
! 				    ;; code this explicitly
! 				    ;; using backup-extract-version has a
! 				    ;; lot of function-call overhead.
! 				    (mapcar (function
! 					     (lambda (fn)
! 					       (string-to-int
! 						(substring fn bv-length))))
! 					    possibilities)) result))))))))
!     result))
  
! (efs-defun efs-dired-flag-backup-files vms (&optional unflag-p)
!   (interactive "P")
!   (let ((dired-kept-versions 1)
! 	(kept-old-versions 0)
! 	marker msg)
!     (if unflag-p
! 	(setq marker ?\040 msg "Unflagging old versions")
!       (setq marker dired-del-marker msg "Purging old versions"))
!     (dired-clean-directory 1 marker msg)))
! 
! (efs-defun efs-internal-diff-latest-backup-file vms (fn)
!   ;; For FILE;#, returns the filename FILE;N, where N
!   ;; is the largest number less than #, for which this file exists.
!   ;; Returns nil if none found.
!   (efs-save-match-data
!     (and (string-match ";[0-9]+$" fn)
! 	 (let ((base (substring fn 0 (1+ (match-beginning 0))))
! 	       (num (1- (string-to-int (substring fn
! 						  (1+ (match-beginning 0))))))
! 	       found file)
! 	   (while (and (setq found (> num 0))
! 		       (not (file-exists-p
! 			     (setq file
! 				   (concat base (int-to-string num))))))
! 	     (setq num (1- num)))
! 	   (and found file)))))
! 
! ;;;;--------------------------------------------------------------
! ;;;; Support for VMS DIR/FULL listings. (listing type vms:full)
! ;;;;--------------------------------------------------------------
! 
! (efs-defun efs-parse-listing vms:full
!   (host user dir path &optional switches)
!   ;; Parse the current buffer which is assumed to be a VMS FTP dir
!   ;; format, and return a hashtable as the result. SWITCHES are never used,
!   ;; but they must be specified in the argument list for compatibility
!   ;; with the unix version of this function.
!   ;; HOST = remote host name
!   ;; USER = user name
!   ;; DIR = directory in as a full remote path
!   ;; PATH = directory in full efs path syntax
!   ;; SWITCHES = ls switches (not relevant here)
!   (goto-char (point-min))
!   (efs-save-match-data
!     (efs-parse-vms-listing)))
! 
! ;;; Tree Dired
! 
! (or (assq 'vms:full efs-dired-re-exe-alist)
!     (setq efs-dired-re-exe-alist
! 	  (cons (cons 'vms:full efs-dired-vms-re-exe)
! 		efs-dired-re-exe-alist)))
! 
! (or (assq 'vms:full efs-dired-re-dir-alist)
!     (setq efs-dired-re-dir-alist
! 	  (cons (cons 'vms:full efs-dired-vms-re-dir)
! 		efs-dired-re-dir-alist)))
! 
! (efs-defun efs-dired-insert-headerline vms:full (dir)
!   ;; Insert a blank line for aesthetics.
!   (insert " \n")
!   (forward-char -2)
!   (efs-real-dired-insert-headerline dir))
! 
! (efs-defun efs-dired-manual-move-to-filename vms:full
!   (&optional raise-error bol eol)
!   (let ((efs-dired-listing-type 'vms))
!     (efs-dired-manual-move-to-filename raise-error bol eol)))
! 
! (efs-defun efs-dired-manual-move-to-end-of-filename vms:full
!   (&optional no-error bol eol)
!   (let ((efs-dired-listing-type 'vms))
!     (efs-dired-manual-move-to-end-of-filename no-error bol eol)))
  
! ;;; end of efs-vms.el
*** efs-vos.el.orig	Sun Jun 15 12:43:03 1997
--- efs-vos.el	Sun Jun 15 12:52:24 1997
***************
*** 256,262 ****
  	     "File line is omitted. Type \\[dired-omit-toggle] to un-omit."
  	     )))))
      (skip-chars-forward "-a-zA-Z0-9@[]\\^`{|}~\"$+,./:_")
!     (if (or (= opoint (point)) (not (memq (following-char) '(?\n ?\r ?\ ))))
  	(if no-error
  	    nil
  	  (error "No file on this line"))
--- 256,262 ----
  	     "File line is omitted. Type \\[dired-omit-toggle] to un-omit."
  	     )))))
      (skip-chars-forward "-a-zA-Z0-9@[]\\^`{|}~\"$+,./:_")
!     (if (or (= opoint (point)) (not (memq (char-after (point)) '(?\n ?\r ?\ ))))
  	(if no-error
  	    nil
  	  (error "No file on this line"))
*** efs.el.orig	Sun Jun 15 12:43:12 1997
--- efs.el	Sun Jun 15 12:52:37 1997
***************
*** 5574,5580 ****
  	    (while (progn
  		     (setq start (point))
  		     (skip-chars-forward "0-9 ")
! 		     (setq link-p (= (following-char) ?l))
  		     (end-of-line)
  		     (setq eol (point)
  			   next (1+ eol))
--- 5574,5580 ----
  	    (while (progn
  		     (setq start (point))
  		     (skip-chars-forward "0-9 ")
! 		     (setq link-p (= (char-after (point)) ?l))
  		     (end-of-line)
  		     (setq eol (point)
  			   next (1+ eol))
***************
*** 6052,6058 ****
  			 "list data file %s not readable" temp-file)))
  	   (skip-chars-forward " 0-9")
  	   (and
! 	    (eq (following-char) ?l)
  	    (re-search-forward efs-month-and-time-regexp nil t)
  	    (setq spot (point))
  	    (re-search-forward " -> " nil t)
--- 6052,6058 ----
  			 "list data file %s not readable" temp-file)))
  	   (skip-chars-forward " 0-9")
  	   (and
! 	    (eq (char-after (point)) ?l)
  	    (re-search-forward efs-month-and-time-regexp nil t)
  	    (setq spot (point))
  	    (re-search-forward " -> " nil t)
8<----------------------------------------------------------------->8

-- 
Karl M. Hegbloom <karlheg@inetarena.com>
http://www.inetarena.com/~karlheg
Portland, OR  USA
Debian GNU 1.3  Linux 2.1.36 AMD K5 PR-133

