comparison lisp/files.el @ 1134:05c961416bb5

*** empty log message ***
author Richard M. Stallman <rms@gnu.org>
date Mon, 14 Sep 1992 01:39:31 +0000
parents c9feb3e64805
children 756152bcdbc0
comparison
equal deleted inserted replaced
1133:f36b965cfeb0 1134:05c961416bb5
219 (defun load-library (library) 219 (defun load-library (library)
220 "Load the library named LIBRARY. 220 "Load the library named LIBRARY.
221 This is an interface to the function `load'." 221 This is an interface to the function `load'."
222 (interactive "sLoad library: ") 222 (interactive "sLoad library: ")
223 (load library)) 223 (load library))
224
225 ;; OTHER is the other file to be compared.
226 (defun file-local-copy (file)
227 "Copy the file FILE into a temporary file on this machine.
228 Returns the name of the local copy, or nil, if FILE is directly
229 accessible."
230 (let (handler (handlers file-name-handler-alist))
231 (save-match-data
232 (while (and (consp handlers) (null handler))
233 (if (and (consp (car handlers))
234 (stringp (car (car handlers)))
235 (string-match (car (car handlers)) file))
236 (setq handler (cdr (car handlers))))
237 (setq handlers (cdr handlers))))
238 (if handler
239 (funcall handler 'file-local-copy file)
240 nil)))
224 241
225 (defun switch-to-buffer-other-window (buffer) 242 (defun switch-to-buffer-other-window (buffer)
226 "Select buffer BUFFER in another window." 243 "Select buffer BUFFER in another window."
227 (interactive "BSwitch to buffer in other window: ") 244 (interactive "BSwitch to buffer in other window: ")
228 (let ((pop-up-windows t)) 245 (let ((pop-up-windows t))
829 This is a separate procedure so your site-init or startup file can 846 This is a separate procedure so your site-init or startup file can
830 redefine it. 847 redefine it.
831 If the optional argument KEEP-BACKUP-VERSION is non-nil, 848 If the optional argument KEEP-BACKUP-VERSION is non-nil,
832 we do not remove backup version numbers, only true file version numbers." 849 we do not remove backup version numbers, only true file version numbers."
833 (let (handler (handlers file-name-handler-alist)) 850 (let (handler (handlers file-name-handler-alist))
834 (while (and (consp handlers) (null handler)) 851 (save-match-data
835 (if (and (consp (car handlers)) 852 (while (and (consp handlers) (null handler))
836 (stringp (car (car handlers))) 853 (if (and (consp (car handlers))
837 (string-match (car (car handlers)) name)) 854 (stringp (car (car handlers)))
838 (setq handler (cdr (car handlers)))) 855 (string-match (car (car handlers)) name))
839 (setq handlers (cdr handlers))) 856 (setq handler (cdr (car handlers))))
857 (setq handlers (cdr handlers))))
840 (if handler 858 (if handler
841 (funcall handler 'file-name-sans-versions name keep-backup-version) 859 (funcall handler 'file-name-sans-versions name keep-backup-version)
842 (substring name 0 860 (substring name 0
843 (if (eq system-type 'vax-vms) 861 (if (eq system-type 'vax-vms)
844 ;; VMS version number is (a) semicolon, optional 862 ;; VMS version number is (a) semicolon, optional
1428 1446
1429 This works by running a directory listing program 1447 This works by running a directory listing program
1430 whose name is in the variable `ls-program'. 1448 whose name is in the variable `ls-program'.
1431 If WILDCARD, it also runs the shell specified by `shell-file-name'." 1449 If WILDCARD, it also runs the shell specified by `shell-file-name'."
1432 (let (handler (handlers file-name-handler-alist)) 1450 (let (handler (handlers file-name-handler-alist))
1433 (while (and (consp handlers) (null handler)) 1451 (save-match-data
1434 (if (and (consp (car handlers)) 1452 (while (and (consp handlers) (null handler))
1435 (stringp (car (car handlers))) 1453 (if (and (consp (car handlers))
1436 (string-match (car (car handlers)) file)) 1454 (stringp (car (car handlers)))
1437 (setq handler (cdr (car handlers)))) 1455 (string-match (car (car handlers)) file))
1438 (setq handlers (cdr handlers))) 1456 (setq handler (cdr (car handlers))))
1457 (setq handlers (cdr handlers))))
1439 (if handler 1458 (if handler
1440 (funcall handler 'insert-directory file switches 1459 (funcall handler 'insert-directory file switches
1441 wildcard full-directory-p) 1460 wildcard full-directory-p)
1442 (if (eq system-type 'vax-vms) 1461 (if (eq system-type 'vax-vms)
1443 (vms-read-directory file switches (current-buffer)) 1462 (vms-read-directory file switches (current-buffer))