comparison lisp/ange-ftp.el @ 21836:1173cfe8b7bd

(ange-ftp-real-expand-file-name-actual): Locally bind old-name, new-name, final, drive-letter.
author Richard M. Stallman <rms@gnu.org>
date Wed, 29 Apr 1998 05:24:09 +0000
parents 37c1ced8578a
children 3313e702e442
comparison
equal deleted inserted replaced
21835:f1df0fd84e42 21836:1173cfe8b7bd
5674 (setq ange-ftp-disable-netrc-security-check t)) 5674 (setq ange-ftp-disable-netrc-security-check t))
5675 5675
5676 ;; If a drive letter has been added, remote it. Otherwise, if the drive 5676 ;; If a drive letter has been added, remote it. Otherwise, if the drive
5677 ;; letter existed before, leave it. 5677 ;; letter existed before, leave it.
5678 (defun ange-ftp-real-expand-file-name-actual (&rest args) 5678 (defun ange-ftp-real-expand-file-name-actual (&rest args)
5679 (setq old-name (car args)) 5679 (let (old-name new-name final drive-letter)
5680 (setq new-name (ange-ftp-run-real-handler 'expand-file-name args)) 5680 (setq old-name (car args))
5681 (setq drive-letter (substring new-name 0 2)) 5681 (setq new-name (ange-ftp-run-real-handler 'expand-file-name args))
5682 ;; I'd like to distill the following lines into one (if) statement 5682 (setq drive-letter (substring new-name 0 2))
5683 ;; removing the need for the temp final variable 5683 ;; I'd like to distill the following lines into one (if) statement
5684 (setq final new-name) 5684 ;; removing the need for the temp final variable
5685 (if (not (equal (substring old-name 0 1) "~")) 5685 (setq final new-name)
5686 (if (or (< (length old-name) 2) 5686 (if (not (equal (substring old-name 0 1) "~"))
5687 (not (string-match "/[a-zA-Z]:" old-name))) 5687 (if (or (< (length old-name) 2)
5688 (setq final (substring new-name 2)))) 5688 (not (string-match "/[a-zA-Z]:" old-name)))
5689 final) 5689 (setq final (substring new-name 2))))
5690 final))
5690 5691
5691 5692
5692 ;;;; ------------------------------------------------------------ 5693 ;;;; ------------------------------------------------------------
5693 ;;;; Finally provide package. 5694 ;;;; Finally provide package.
5694 ;;;; ------------------------------------------------------------ 5695 ;;;; ------------------------------------------------------------