home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / msdos / demacs / edired / emacs-19.el < prev    next >
Encoding:
Text File  |  1991-10-28  |  1.5 KB  |  44 lines

  1. ;;;; Emacs 19 compatibility functions for use in Emacs 18.55
  2. ;;;; $Id: emacs-19.el,v 1.2 90/12/19 17:49:19 sk Exp $
  3.  
  4. (defun remove-directory (fn)
  5.   "Remove a directory."
  6.   (interactive 
  7.    (list (expand-file-name (read-file-name "Remove directory: " nil nil 'confirm)))) 
  8.   (if (file-directory-p fn)
  9.       (call-process "rmdir" nil nil nil fn)
  10.     (error "Not a directory: %s" fn))
  11.   (if (file-exists-p fn)
  12.       (error "Could not remove directory %s" fn)))
  13.  
  14. (defun make-directory (fn)
  15.   "Make a directory."
  16.   (interactive (list (expand-file-name (read-file-name "Make directory: "))))
  17.   (if (file-exists-p fn)
  18.       (error "Cannot make directory %s: file already exists" fn)
  19.     (call-process "mkdir" nil nil nil fn))
  20.   (or (file-directory-p fn)
  21.       (error "Could not make directory %s" fn)))
  22.  
  23. (defun diff (fn1 fn2 &optional interactive)
  24.   "Diff two files.
  25. If interactive (optional third arg if called from a program), edit the
  26. command before execution to insert diff switches." 
  27.   (interactive "fDiff: \nfDiff %s with: \np")
  28.   (let ((command (concat  "diff " fn1 " " fn2)))
  29.   (if interactive
  30.       (setq command (read-string "Execute: " command)))
  31.   (require 'compile "compile")
  32.   (compile1 command "No more diff's" "diff")))
  33.  
  34.  
  35. (defun vms-read-directory (dirname switches buffer)
  36.   ;; Dired calls this function only in the current buffer
  37.   ;; dired-ls gets redefined in dired-vms.el to work under VMS.
  38.   (and buffer
  39.        (not (eq buffer (current-buffer)))
  40.        (error "Must be called in current buffer"))
  41.   (dired-ls dirname switches nil t))
  42.  
  43. (provide 'emacs-19)
  44.